1

I am new to API Calls, and Postman API Scripts.

I have a Data Extension in Sandbox SFMC, which i want to move to Postman via Postman API call.

I already have a script to get the access token from Sandbox SFMC.

GET call URL https://SUB-DOMAIN.soap.marketingcloudapis.com/Service.asmx

BODY:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <soapenv:Header>
<fueloauth>ZMgDiU9zs0vZXEr9XkNfjhMK</fueloauth>
<action>Retrieve</action>
  </soapenv:Header>
        <soapenv:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
      <RetrieveRequest>
         <ObjectType>DataExtensionObject[C6258E52-A99B-4BA3-8CF2- 
   2846ED90500A]</ObjectType>
         <Properties>Name</Properties>
         <Properties>FieldType</Properties>
         <Properties>IsPrimaryKey</Properties>
         <Properties>IsRequired</Properties>
         <Properties>MaxLength</Properties>
         <Filter xsi:type="SimpleFilterPart">
            <Property>CustomerKey</Property>
            <SimpleOperator>equals</SimpleOperator>
            <Value>C6258E52-A99B-4BA3-8CF2-2846ED90500A</Value>
         </Filter>
      </RetrieveRequest>
    </RetrieveRequestMsg>

enter image description here

  • 1
    can you add more detail on what you mean by 'move to Postman via Postman API call' do you mean you want to use an API call to retrieve it? – Gortonington Jan 16 at 19:57
  • Hi Nat Fan, it might be worth reading How to Ask – Robs Jan 16 at 19:58
  • @Gortonington Thank you for responding. Yes, i meant to say how to use an API call to get the Data Extension. – Nat Fan Jan 16 at 20:02
  • 1
    @Robs Thanks for the pointer. I'm new to this, still learning. – Nat Fan Jan 16 at 20:03
  • Dont need to add auth in header on soap. To verify, you are using POST, right? And you are replacing SUB-DOMAIN with your sfmc sub domain, right? Also make sure that {{accessToken}} matches your var in the body – Gortonington Jan 16 at 22:55
1

I would recommend checking the SFMC Documentation as they have a sample there. You would be required to use the SOAP API as the REST API does not currently have the capability to retrieve Data Extensions.

Below is a sample of the SOAP API Request: (*edited to target the actual data inside of the DE, instead of the info about the DE)

<?xml version="1.0" encoding="UTF-8"?>
  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
      <fueloauth>{{accessToken}}</fueloauth>
    </soapenv:Header>
    <soapenv:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
           <RetrieveRequest>
              <ObjectType>DataExtensionObject[myDEKey]</ObjectType>
              <Properties>CustomerKey</Properties>
              <Properties>Name</Properties>
              <Properties>Keys</Properties>
              <Properties>Type</Properties>
              <Properties>ModifiedDate</Properties>
              <Properties>CreatedDate</Properties>
           </RetrieveRequest>
        </RetrieveRequestMsg>
      </soapenv:Body>
    </soapenv:Envelope>

You would replace {{accessToken}} with your OAuth token and myDEKey with your DE's External Key.

The endpoint to do the POST request to would be gathered via the following for tenant specific endpoints:

SOAP API with Your Tenant's Endpoints All instances: https://YOUR_SUBDOMAIN.soap.marketingcloudapis.com/Service.asmx

or for legacy endpoints, you can go here where it is dependent on the Instance you are using.

You would also want to make sure to include the following Header in your call:

SoapAction: Retrieve


Here are some screen shots that should hopefully help point you in the right direction(based on your feedback in the comments):

Utilize POST action and input your SOAP Endpoint

Headers for your call

Body of the call

and then you would replace:

  • {{soapEndPoint}} with your tenant specific endpoint (should be able to find definitive version of it inside Admin in SFMC as well)
  • {{accessToken}} with your POSTman variable for your OAuth token or replace it directly with your OAuth token
  • myDEKey with the CustomerKey/ExternalKey of your Data Extension.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.