[SalesForce] Marketing cloud SOAP API Retrieve records from DE

My DE looks like this
enter image description here

The records in this DE are as shown:
enter image description here

I am trying to use soap api to retrive data from this DE. however i am getting errors. can you help me what is wrong in this request


request :

<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-24440876"
            xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
            <wsse:Username>${#Project#UserName}</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">${#Project#Password}</wsse:Password>
        </wsse:UsernameToken>
    </wsse:Security>
</soapenv:Header>
<soapenv:Body>
    <RetrieveRequestMsg
        xmlns="http://exacttarget.com/wsdl/partnerAPI">
        <RetrieveRequest>
            <ObjectType>DataExtensionObject[Reporting_Sent_Today]</ObjectType>
            <Properties>Market</Properties>
            <Properties>CampCode</Properties>
            <Properties>CampName</Properties>
            <Properties>Hour</Properties>
            <Properties>Count</Properties>
            <Filter xsi:type="SimpleFilterPart">
                <Property>Market</Property>
                <SimpleOperator>equals</SimpleOperator>
                <Value>NLD</Value>
            </Filter>
        </RetrieveRequest>
    </RetrieveRequestMsg>
</soapenv:Body>

and the response is :

<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:570ebd29-a9e9-4eea-a7b7-21e2c83772b4</wsa:MessageID>
      <wsa:RelatesTo>urn:uuid:fd288cd0-602b-46a3-a80e-399d5d94bb49</wsa:RelatesTo>
      <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
      <wsse:Security>
         <wsu:Timestamp wsu:Id="Timestamp-88b1d8df-84a4-4d0f-9b7b-44b5131792eb">
            <wsu:Created>2018-12-26T10:20:49Z</wsu:Created>
            <wsu:Expires>2018-12-26T10:25:49Z</wsu:Expires>
         </wsu:Timestamp>
      </wsse:Security>
   </soap:Header>
   <soap:Body>
      <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <OverallStatus>Error: Invalid object name 'C100012058.01_Reporting_Sent_Today'.</OverallStatus>
         <RequestID>275b95fb-04ca-4378-a476-d08a8279305f</RequestID>
      </RetrieveResponseMsg>
   </soap:Body>
</soap:Envelope>

can you tell me know what is wrong .

Best Answer

I noticed this is a shared Data Extension, which is why you are getting these errors. Shared DEs require you to target the Parent BU in order to access it. You could try adding in the Client ID into your call:

  ...<RetrieveRequest>
        <ClientIDs>
           <ClientID>{{parentMID}}</ClientID>
        </ClientIDs>
        <ObjectType>...

or you would have to use Authentication (Oauth or Legacy User/Pass) that is assigned to the parent BU when making this call.

Please note that using the ent. prefix (used in SQL Queries, etc. to reference shared DEs) will not work here.

References: An awesome answer by Adam and Eliot

This other great answer with sample of ClientID implementation

Related Topic