1

Using REST API v1 and trying to find a simple way to list all attributes for a particular data extension. My main objective is to send an event to initiate a journey (API: interaction/v1/events). In order to send an event I need to populate EventDefinitionKey and contact attributes for Data.

I'm able to list event definitions (API: interaction/v1/eventDefinitions) which contains id, dataExtensionId and dataExtensionName. Awesome and easy, but I can't figure out which endpoint to hit to list attributes for data extension to populate event Data.

API /contacts/v1/attributeSetDefinitions is great but lists every data extension with attributes which feels heavy handed and unnecessary. Attribute set definitions can be filtered with /contacts/v1/schemas/{schemaId}/attributeSetDefinitions/{id} but now schema ID needs to be fetched too resulting in more API calls and seemingly unnecessary work.

Is there a convenient API endpoint to save me all this trouble? If not, what's a recommended workaround?

1 Answer 1

1

We managed to retrieve the fields of a given DE using SOAP Api, you also can place it in a REST call. You can use a token or a User/pwd to authenticate.

Example of rest call using POSTMAN:

        POST /Service.asmx HTTP/1.1 
        Host: <Your host instance ie: webservice.s6.exacttarget.com> 
        Content-Type: text/xml 
        SOAPAction: "Retrieve" 
        Cache-Control: no-cache 
        Postman-Token: 588f0a33-ff05-de0f-b4f2-28ce7751c582

        <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:par="http://exacttarget.com/wsdl/partnerAPI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <!--<soapenv:Header>    
    <fueloauth xmlns="http://exacttarget.com"><YOUR TOKEN></fueloauth>   
    </soapenv:Header>-->    
    <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>
                        <wsse:Username><YOUR USERNAME></wsse:Username>
                        <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"><YOUR PWD></wsse:Password>
                     </wsse:UsernameToken>
                  </wsse:Security>    
</soapenv:Header>    
<soapenv:Body>
                  <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
                     <RetrieveRequest>
                        <ObjectType>DataExtensionField</ObjectType>
                        <Properties>FieldType</Properties>
                        <Properties>Name</Properties>
                        <Properties>IsRequired</Properties>
                        <Properties>MaxLength</Properties>
                        <Properties>Ordinal</Properties>
                        <Properties>Scale</Properties>  
                        <Filter xsi:type="SimpleFilterPart">
                           <Property>DataExtension.CustomerKey</Property>
                           <SimpleOperator>equals</SimpleOperator>
                           <Value><YOUR DE_CustomerKey></Value>
                        </Filter>
                        <QueryAllAccounts>false</QueryAllAccounts>
                        <Retrieves />
                        <Options>
                           <SaveOptions />
                           <IncludeObjects>true</IncludeObjects>
                        </Options>
                     </RetrieveRequest>
                  </RetrieveRequestMsg>    
        </soapenv:Body> 
        </soapenv:Envelope>
2
  • Thank you for the answer. I decided to not use Soap API because it requires to specify a hostname which I can't easily obtain and have to reach out to a representative. Plus it is not necessary to fire a journey event (only need www.exacttargetapis.com as endpoint). I'm going to leave it up to our end users to look up correct attribute names in Salesforce UI and enter them manually. It is far from ideal, but acceptable until REST API catches up with SOAP. Commented Sep 14, 2017 at 22:56
  • @VladPoskatcheev what was your rest api solution at the end!
    – TaouBen
    Commented Sep 4, 2022 at 20:34

You must log in to answer this question.

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