0

I want to retrieve all contacts from a specific data extension via REST API but I don't find any documentation to do that.

Is there any way of retrieving all records from a data extension via REST API for Marketing Cloud?

2 Answers 2

5

There is an undocumented endpoint for getting records from a Data Extension using REST, with a filter defined by request parameters to the endpoint:

GET /data/v1/customobjectdata/key/YOURDEEXTERNALKEY/rowset?$filter=emailAddress%20eq%20'[email protected]' HTTP/1.1
Host: YOURTENANT.rest.marketingcloudapis.com
Authorization: Bearer YOURAUTHTOKEN
Content-Type: application/json
User-Agent: PostmanRuntime/7.17.1
Accept: */*
Cache-Control: no-cache
Host: YOURTENANT.rest.marketingcloudapis.com
Accept-Encoding: gzip, deflate
Connection: keep-alive
cache-control: no-cache

This is provided with NO GUARANTEES, and can be taken down or altered by Salesforce without any notice. I will not recommend using undocumented features in production context.

As to your question:

I want to retrieve all contacts from a specific data extension

This is doomed to fail, as you potentially don't have any control of the number of records in a given data extension. Remember that your API request might time-out, or return such a huge amount of data, that generating a response will not be feasible. I will advise against a solution which relies on pulling ALL records from a data extension. You would be better off (while building a more robust solution) using Data Extension Extract in Automation Studio.

1

Data extension record retrieval via REST is now supported as part of 2024 spring release! https://help.salesforce.com/s/articleView?id=sf.mc_rn_2024_spring_as_rest_api_endpoints.htm&type=5

Rest route Documentation https://developer.salesforce.com/docs/marketing/marketing-cloud/references/mc-custom_object_data?meta=Get%2Bcustom%2Bobject%2Bdata%2Bby%2Bkey

Great news not having to implement SOAP for such a common task/pattern

1
  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – identigral
    Feb 27 at 16:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .