is there any REST API request to get a list of all Data Extensions in my Business Unit?
1 Answer
You'll have to use the SOAP API to retrieve DataExtension objects.
Here's a sample SOAP envelope that illustrates the structure of the call:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-32259181" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>user</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">password</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
<RetrieveRequest>
<ObjectType>DataExtension</ObjectType>
<Properties>CustomerKey</Properties>
<Properties>Name</Properties>
<Properties>CategoryID</Properties>
</RetrieveRequest>
</RetrieveRequestMsg>
</soapenv:Body>
</soapenv:Envelope>
At this point in time, the SFMC SOAP API is significantly more complete/robust/whatever than the REST API. It's a good plan to follow the lead of the SFMC SDK, which utilizes both SOAP and REST.
-
The body of the envelope is exactly what I needed. Perfect! Commented Dec 21, 2019 at 18:55
-
@Adam Is it possible to get the columns information as part of the response?– VishnuCommented Jan 2, 2020 at 2:57