1

I'm trying to retrieve summary information about an email send (opens, number sent, number delivered, etc.) using the Marketing Cloud SOAP API. The response I get has an overall status of "OK" but none of the requested data in it (it is a fully formed XML response but only includes the overall status and a RequestID).

I've tried several SendIDs with the same result. I AM able to retrieve link information (ObjectType "LinkSend") for the same SendIDs.

Thanks for any suggestions.

My SOAP request:

      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <RetrieveRequest>
            <ObjectType>Send</ObjectType>
            <Properties>UniqueOpens</Properties>
            <Properties>NumberSent</Properties>
            <Properties>NumberDelivered</Properties>
     <Filter xsi:type="ns1:SimpleFilterPart" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
               <Property>SendID</Property>
               <SimpleOperator>equals</SimpleOperator>
               <Value>xxxx</Value>
            </Filter>
         </RetrieveRequest>
      </RetrieveRequestMsg>

And the response:

        <soap:Body>
            <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
                <OverallStatus>OK</OverallStatus>
                <RequestID>xxxxx-xxxx-xxxxx-xxxx-xxxxxxxxxx</RequestID>
            </RetrieveResponseMsg>
        </soap:Body>
  • Do you have any PHP code for this? – garek007 May 1 '18 at 13:01
  • Hi @garek007, I'm not using PHP. Is there anything specific you're wondering about? – Rocky May 1 '18 at 15:23
  • No I just can't help unless there's PHP, never done it with any other language – garek007 May 1 '18 at 17:40
3

A support ticket with Salesforce solved this problem. The key is adding a dot in the filter property name between "Send" and "ID":

       <Filter xsi:type="ns1:SimpleFilterPart" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
           <Property>Send.ID</Property>
           <SimpleOperator>equals</SimpleOperator>
           <Value>xxxx</Value>
        </Filter>

What I find so odd about this is that when I retrieve click data (using ObjectType "LinkSend") for the same SendIDs, I don't include the dot in the filter property name, and it works. But in any case, it's working now so life is good.

0

This is behavior (OK response with no objects) I often see using clientId/Secret as authentication rather than the newer fueloauth.

Are you using clientid/secret in your soap envelope to authenticate, or are you getting a token then using that?

The difference is:

<o:Security xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" s:mustUnderstand="1">
         <o:UsernameToken>
            <o:Username>{{soapUsername}}</o:Username>
            <o:Password><![CDATA[{{soapPassword}}]]></o:Password>
         </o:UsernameToken>
      </o:Security>

vs.

<a:fueloauth><![CDATA[{token}]]></a:fueloauth>

To get a fueltoken, you can make a rest POST call using the clientId/Secret to:

https://auth-{stack}.exacttargetapis.com/v1/requestToken

with a body

{ "clientId":"{clientId}", "clientSecret":"{clientSecret}", "AccessType": "offline" }

Give that a try and let us know if it works for you. These is also a Rest api endpoint to obtain the same information that is easier IMO to use than making a Soap call. Unfortunately, a lot of the Send and Event tracking information is not available via the Rest Api, but the information you are trying to retrieve is.

  • Hi Mike, I am indeed using fueloauth. But I wasn't aware there's a REST alternative for this info. I can't find the endpoint. Can you point me to it? – Rocky May 1 '18 at 19:34
  • exacttargetapis.com/messaging/v1/messageSends{id}/summary . The documentation is pretty limited. You can get all the endpoints on their various services by calling the rest discovery. For instance, exacttargetapis.com/messaging/v1/rest for messaging. – Mike May 1 '18 at 19:51
  • Thanks very much for your help, Mike. Unfortunately I haven't made any progress. When I try the /messageSends/{ID}/summary endpoint it returns a 404 status code. I take that to mean (although I'm not sure) that it didn't find the job ID I supplied. I also tried using the external key for the ESD to see what would happen and that also returned a 404. I also tried to get the /messageDefinitionSends endpoint and that returned an empty array. – Rocky May 1 '18 at 20:59
  • The emails I'm trying to get data for are user-initiated sends, not triggered sends, if that makes a difference. I'm starting to wonder if there might be a permission issue, although I find it odd that I can get all the click data for these sends. – Rocky May 1 '18 at 20:59

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.