5

I want to Retrieve Properties from both Data Extension and Data Extension Field Object in Single Retrieve Request

Suppose Consider this Example:

Data Extension Soap Object Request

<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>
    <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <UsernameToken>
        <Username>xxxxxx</Username>
        <Password>xxxxxxx</Password>
      </UsernameToken>
    </Security>
  </soapenv:Header>
  <soapenv:Body>
    <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
      <RetrieveRequest>
        <ObjectType>DataExtension</ObjectType>
        <Properties>CustomerKey</Properties>
        <Properties>Name</Properties>
        <Properties>DataExtension.ObjectID</Properties>
        <Properties>IsSendable</Properties>
        <Properties>SendableSubscriberField.Name</Properties>
        <Properties>SendableDataExtensionField.Name</Properties>
        <Properties>CategoryID</Properties>
        <Filter xsi:type="SimpleFilterPart">
          <Property>CategoryID</Property>
          <SimpleOperator>equals</SimpleOperator>
          <Value>xxxxxx</Value>
        </Filter>
        <QueryAllAccounts>true</QueryAllAccounts>
      </RetrieveRequest>
    </RetrieveRequestMsg>
  </soapenv:Body>
</soapenv:Envelope>

Data Extension field Object Request:

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  <!-- header removed -->
  <s: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>
        <ClientIDs>
          <ID>999999999</ID>
        </ClientIDs>
        <ObjectType>DataExtensionField</ObjectType>
        <Properties>ObjectID</Properties>
        <Properties>PartnerKey</Properties>
        <Properties>CustomerKey</Properties>
        <Properties>Name</Properties>
        <Properties>DefaultValue</Properties>
        <Properties>MaxLength</Properties>
        <Properties>IsRequired</Properties>
        <Properties>Ordinal</Properties>
        <Properties>IsPrimaryKey</Properties>
        <Properties>FieldType</Properties>
        <Properties>CreatedDate</Properties>
        <Properties>ModifiedDate</Properties>
        <Properties>Scale</Properties>
        <Properties>Client.ID</Properties>
        <Properties>DataExtension.CustomerKey</Properties>
        <Properties>StorageType</Properties>
        <Filter xsi:type="SimpleFilterPart">
          <Property>DataExtension.CustomerKey</Property>
          <SimpleOperator>equals</SimpleOperator>
          <Value>DATAEXTENSIONCUSTOMERKEY</Value>
        </Filter>
      </RetrieveRequest>
    </RetrieveRequestMsg>
  </s:Body>
</s:Envelope>

I want to combine these two Request in Single Request,because i want to Retrieve both Data Extension and Data Extension Fields in single Request

I have tried this combination it is not working:

<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>
        <Security xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
          <UsernameToken>
            <Username>xxxxxx</Username>
            <Password>xxxxxxx</Password>
          </UsernameToken>
        </Security>
      </soapenv:Header>
      <soapenv:Body>
        <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
          <RetrieveRequest>
            <ObjectType>DataExtension</ObjectType>
            <Properties>CustomerKey</Properties>
            <Properties>Name</Properties>
            <Properties>DataExtension.ObjectID</Properties>
            <Properties>IsSendable</Properties>

            <ObjectType>DataExtensionField</ObjectType>
            <Properties>ObjectID</Properties>
            <Properties>PartnerKey</Properties>
            <Properties>CustomerKey</Properties>

Tried with two single Retrieve Request:

  <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
          <RetrieveRequest>
            <ObjectType>DataExtension</ObjectType>
            <Properties>CustomerKey</Properties>
          </RetrieveRequest>
        </RetrieveRequestMsg>
<RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
              <RetrieveRequest>
<ObjectType>DataExtensionField</ObjectType>
                <Properties>ObjectID</Properties>
   </RetrieveRequest>
        </RetrieveRequestMsg>

But this Combination also Not Working,If anyone Knows for Retriving the Request from both objects in Single Request please Guide me for this Scenario

  • 1
    To my knowledge, You would need to do two separate SOAP calls and then combine the returned information in your web app or whatever system is making these calls. – Gortonington Sep 20 '17 at 13:41
  • 1
    have you tried adding <Properties>Fields</Properties> for your first soap request for DataExtension Object? 'Fields' are available for DataExtension object, according to this doc developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/… – Bo Hu Oct 3 '17 at 6:00
  • @BoHu Fields are not Retrieving in Data Extension,I have tried also with that Document – SFDC Oct 3 '17 at 7:40
  • @SFDC Well looks like you have to send two separate soap request for each objects then, I think for Email Object, I can specify ContentArea in SOAP request, then it returns a list of ContentArea in that Email Object. Data extension may be different. – Bo Hu Oct 3 '17 at 22:18
  • @BoHu,only possible way for this question is two seperate soap request,I want to retrieve fields also in single soap request , guide me for that way? – SFDC Oct 4 '17 at 5:06

Your Answer

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

Browse other questions tagged or ask your own question.