0

I am retrieving Subscriber attributes and data from the "All Subscribers" list. I am getting all data except 1: Unsubscribed Reason.

Message: Error: The Request Property(s) UnsubscribeReason do not match with the fields of Subscriber retrieve

I tried UnsubscribeReason, UnsubscribedReason, Unsubscribe Reason and no luck

then I decided to use "theLogUnsubEvent Execute Call" to get the Unsubscribe 'Reason' from the return object, but even though I can see the user has unsubscribed and has a reason attribute in "all subscribers" list, this "theLogUnsubEvent Execute Call" will return OK with no data.

Can you help me retrieve the reason to unsubscribe please? theLogUnsubEvent documentation:

https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/unsubscribing_and_logging_an_unsubevent_with_a_logunsubevent_execute_call.html#why-use-the-logunsubevent-execute-call

1 Answer 1

0

I think you're looking for the SubscriberStatusEvent SOAP object, which includes the unsubscribe reason. You can update the filter to suit your requirements. This particular object doesn't appear in the documentation, except for this example.

<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>XXXXX</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXX</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
         <RetrieveRequest>
            <Options>
               <Client>
                  <ID>12345</ID>
               </Client>
            </Options>
            <ObjectType>SubscriberStatusEvent</ObjectType>
            <Properties>ObjectID</Properties>
            <Properties>SubscriberID</Properties>
            <Properties>Client.ID</Properties>
            <Properties>CurrentStatus</Properties>
            <Properties>PreviousStatus</Properties>
            <Properties>CreatedDate</Properties>
            <Properties>SubscriberKey</Properties>
            <Properties>ReasonUnsub</Properties>
            <Filter xsi:type="par:ComplexFilterPart" xmlns:par="http://exacttarget.com/wsdl/partnerAPI">
               <LeftOperand xsi:type="par:SimpleFilterPart">
                  <Property>CurrentStatus</Property>
                  <SimpleOperator>equals</SimpleOperator>
                  <Value>Unsubscribed</Value>
               </LeftOperand>
               <LogicalOperator>AND</LogicalOperator>
               <RightOperand xsi:type="par:SimpleFilterPart">
                  <Property>CreatedDate</Property>
                  <SimpleOperator>greaterThan</SimpleOperator>
                  <DateValue>2011-04-07T19:58:33.434707Z</DateValue>
               </RightOperand>
            </Filter>
            <RetrieveAllSinceLastBatch>true</RetrieveAllSinceLastBatch>
         </RetrieveRequest>
      </RetrieveRequestMsg>
   </soapenv:Body>
</soapenv:Envelope>

Here are the verified retrieveable properties:

Client.ID
CreatedDate
CurrentStatus
ObjectID
PreviousStatus
ReasonUnsub
SubscriberID
SubscriberKey
2
  • This is great, thank you. Is there a FuelSDK method to retrieve this data? I've checked it and could not see. Since I've been working with FuelSDK, ideally I want to keep all my api connection to the sdk
    – DonnyDarko
    Apr 27 at 13:58
  • I doubt it. I stay away from the SDKs. Apr 27 at 15:12

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.