1

I am trying to retrieve details of data extension from Child BU in Marketing Cloud via SOAP API. I cannot retrieve data from Child BU, whatever I try, it only returns the data from Parent BU. Here is my code:

<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-CHILDBU_MID" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
                <wsse:Username>Username</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>ModifiedDate</Properties>
            <Filter xsi:type="SimpleFilterPart">
                <Property>CustomerKey</Property>
                <SimpleOperator>equals</SimpleOperator>
                <Value>MyTestDataExtension</Value>
            </Filter>
        </RetrieveRequest>
    </RetrieveRequestMsg>
 </soapenv:Body>
</soapenv:Envelope>

And the Response was:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <soap:Header>
        <wsa:Action>RetrieveResponse</wsa:Action>
        <wsa:MessageID>urn:uuid:b243abda-33fc-49e1-8c2d-c9fe01d415f3</wsa:MessageID>
        <wsa:RelatesTo>urn:uuid:2f00958e-2bae-4a22-aebf-8b3711fba00b</wsa:RelatesTo>
        <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
        <wsse:Security>
            <wsu:Timestamp wsu:Id="Timestamp-6c2e19ce-a15d-471c-a777-2a9e1cc9223f">
                <wsu:Created>2020-06-16T06:19:46Z</wsu:Created>
                <wsu:Expires>2020-06-16T06:24:46Z</wsu:Expires>
            </wsu:Timestamp>
        </wsse:Security>
    </soap:Header>
    <soap:Body>
        <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
            <OverallStatus>OK</OverallStatus>
            <RequestID>e0b3de4a-e5d4-4501-9642-dfb9ea69c2c8</RequestID>
        </RetrieveResponseMsg>
    </soap:Body>
</soap:Envelope>

As you can see above, I got the OK status but not the result. I think there is no matching data (for Customer Key "MyTestDataExtension" only exists in Child BU). If you know how to retrieve data from Child BU, please help me out. Thanks!

1

When retrieving from a Child BU, you need to add the below code to specify the MID of the BU you want to retrieve from. You can add this just below the <RetrieveRequest>

<RetrieveRequest>
  <ClientIDs>
    <ClientID>1234567</ClientID>
  </ClientIDs>
  ...
</RetrieveRequest>

https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/using_clientid_in_your_soap_api_code.htm

| improve this answer | |

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.