Retrieve the SubscriberStatusEvent

This page contains information about retrieving the SubscriberStatusEvent object.

Why Retrieve the SubscriberStatusEvent 

Retrieving this information gives you identification information about the subscriber, the current subscription status, and the reason why the subscriber unsubscribed, if any. This call only logs events at the All Subscriber list level.

How to Retrieve the SubscriberStatusEvent 

Use the sample code below as a model to construct your own API call.

The CurrentStatus and PreviousStatus properties accept the following values:

  • Normal
  • Held
  • Unsub

The Retrieve call returns an arrary of ObjectExtensions when the ObjectType of the RetrieveRequest is set to SubscriberStatusEvent. If the Retrieve request returns more than 2500 objects, the status of the Retrieve call is MoreDataAvailable, indicating that you need to retrieve the rest of the results in batches using the ContinueRequest property on a RetrieveRequest.

Sample .NET Code Request 

1// intialize variables
2String requestID;
3APIObject[] results;
4SimpleFilterPart sfp = new SimpleFilterPart();
5sfp.Property = "SubscriberKey";
6sfp.SimpleOperator = SimpleOperators.IN;
7sfp.Value = new string[] { "ts","ts1","ts2","ts3","ts4","ts5"};
8// Create RetrieveRequest
9RetrieveRequest rr = new RetrieveRequest();
10rr.ObjectType = "SubscriberStatusEvent";
11rr.Properties = new string[] { "Client.ID", "SubscriberID", "SubscriberKey", "ReasonUnsub", "CurrentStatus", "PreviousStatus", "CreatedDate" };
12rr.Filter = sfp;
13// Execute RetrieveRequest
14String status = integrationFramework.Retrieve(rr, out requestID, out results);
15// Output the Values
16Console.WriteLine(status);
17Console.WriteLine(requestID);
18Console.WriteLine(results.Length);
19Console.WriteLine("_________Properties______________");
20for (int i = 0; i < results.Length; i++)
21{
22    for (int x = 0; x < ((ObjectExtension)results[i]).Properties.Length; x++)
23    {
24        Console.WriteLine("Date:{0}\tName:{1} \t Value:{2}", ((ObjectExtension)results[i]).CreatedDate,  ((ObjectExtension)results[i]).Properties[x].Name, ((ObjectExtension)results[i]).Properties[x].Value);
25    }
26   }
27}

Sample .NET Code Results 

If the unsubscribe occurs due to a Feedback loop, the reason is Spam complaint from <domain>

1c1edd148-8bbc-4a19-8818-fc3d01ecf3a9
26
3_________Properties______________
4Date:4/14/2009 11:54:31 PM    Name:SubscriberID      Value:199652891
5Date:4/14/2009 11:54:31 PM    Name:SubscriberKey      Value:ts
6Date:4/14/2009 11:54:31 PM    Name:ReasonUnsub      Value:unsubscribed by Marketing Cloud RMM service based on subscriber reply email request
7Date:4/14/2009 11:54:31 PM    Name:CurrentStatus      Value:unsub
8Date:4/14/2009 11:54:31 PM    Name:PreviousStatus      Value:normal
9Date:4/14/2009 11:54:51 PM    Name:SubscriberID      Value:199652895
10Date:4/14/2009 11:54:51 PM    Name:SubscriberKey      Value:ts3
11Date:4/14/2009 11:54:51 PM    Name:ReasonUnsub      Value:unsubscribed by Marketing Cloud RMM service based on subscriber reply email request
12Date:4/14/2009 11:54:51 PM    Name:CurrentStatus      Value:unsub
13Date:4/14/2009 11:54:51 PM    Name:PreviousStatus      Value:normal
14Date:4/14/2009 11:58:33 PM    Name:SubscriberID      Value:199652896
15Date:4/14/2009 11:58:33 PM    Name:SubscriberKey      Value:ts4
16Date:4/14/2009 11:58:33 PM    Name:ReasonUnsub      Value:unsub by email
17Date:4/14/2009 11:58:33 PM    Name:CurrentStatus      Value:unsub
18Date:4/14/2009 11:58:33 PM    Name:PreviousStatus      Value:normal
19Date:4/15/2009 12:00:09 AM    Name:SubscriberID      Value:199652897
20Date:4/15/2009 12:00:09 AM    Name:SubscriberKey      Value:ts5
21Date:4/15/2009 12:00:09 AM    Name:ReasonUnsub      Value:unsub by email
22Date:4/15/2009 12:00:09 AM    Name:CurrentStatus      Value:unsub
23Date:4/15/2009 12:00:09 AM    Name:PreviousStatus      Value:normal
24Date:4/15/2009 12:01:10 AM    Name:SubscriberID      Value:199652893
25Date:4/15/2009 12:01:10 AM    Name:SubscriberKey      Value:ts2
26Date:4/15/2009 12:01:10 AM    Name:ReasonUnsub      Value:unsub by email
27Date:4/15/2009 12:01:10 AM    Name:CurrentStatus      Value:unsub
28Date:4/15/2009 12:01:10 AM    Name:PreviousStatus      Value:normal
29Date:4/15/2009 12:11:46 AM    Name:SubscriberID      Value:199652892
30Date:4/15/2009 12:11:46 AM    Name:SubscriberKey      Value:ts1
31Date:4/15/2009 12:11:46 AM    Name:ReasonUnsub      Value:unsub by email
32Date:4/15/2009 12:11:46 AM    Name:CurrentStatus      Value:unsub
33Date:4/15/2009 12:11:46 AM    Name:PreviousStatus      Value:normal

How to Retrieve the SubscriberStatusEvent for Incremental Periods of Time 

The code below retrieves a list of subscriber status changes for an account for a date range using SubscriberStatusEvent. Using this object, your can read the data into your application to build a subscriber status history for subscribers.

The Describe call provides the properties available to be retrieved. A Describe call accepts one or many ObjectDefinitionRequest and returns one or many ObjectDefinitions. The ObjectDefinitionRequest takes an ObjectType to specify which object you wish to describe.

Sample .NET Code Request 

1ObjectDefinitionRequest request = new ObjectDefinitionRequest();
2request.ObjectType = "SubscriberStatusEvent";
3ObjectDefinition[] results = integrationFramework.Describe(new ObjectDefinitionRequest[] { request }, out requestID);
4Console.WriteLine("_________Properties______________");
5for (int i = 0; i < results[0].Properties.Length; i++)
6{
7    Console.WriteLine("Name:\t" + results[0].Properties[i].Name);
8    Console.WriteLine("PropertyType:\t" + results[0].Properties[i].PropertyType);
9    Console.WriteLine("isRetrievable:\t" + results[0].Properties[i].IsRetrievable + "\n");
10}

Sample .NET Results 

1_________Properties______________
2Name:    ObjectID
3PropertyType:    string
4isRetrievable:    True
5Name:    SubscriberID
6PropertyType:    string
7isRetrievable:    True
8Name:    Client.ID
9PropertyType:    string
10isRetrievable:    True
11Name:    CurrentStatus
12PropertyType:    string
13isRetrievable:    True
14Name:    PreviousStatus
15PropertyType:    string
16isRetrievable:    True
17Name:    CreatedDate
18PropertyType:    string
19isRetrievable:    True
20Name:    SubscriberKey
21PropertyType:    string
22isRetrievable:    True
23Name:    ReasonUnsub
24PropertyType:    string
25isRetrievable:    True
26Name:    Client
27PropertyType:    string
28isRetrievable:    False
29Name:    PartnerProperties
30PropertyType:    string
31isRetrievable:    False
32Name:    ModifiedDate
33PropertyType:    string
34isRetrievable:    False
35Name:    ID
36PropertyType:    string
37isRetrievable:    False
38Name:    CustomerKey
39PropertyType:    string
40isRetrievable:    False
41Name:    Owner
42PropertyType:    string
43isRetrievable:    False
44_________ExtendedProperties______________

Sample SOAP Envelopes 

This sample code demonstrates how to describe the SubscriberStatusEvent to see what information can be retrieved:

1<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">
2   <soapenv:Header>
3      <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
4         <wsse:UsernameToken wsu:Id="UsernameToken-31606811" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
5            <wsse:Username>XXXXX</wsse:Username>
6            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXX</wsse:Password>
7         </wsse:UsernameToken>
8      </wsse:Security>
9   </soapenv:Header>
10   <soapenv:Body>
11      <DefinitionRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
12         <DescribeRequests>
13            <ObjectDefinitionRequest>
14               <ObjectType>SubscriberStatusEvent</ObjectType>
15            </ObjectDefinitionRequest>
16         </DescribeRequests>
17      </DefinitionRequestMsg>
18   </soapenv:Body>
19</soapenv:Envelope>

This sample code demonstrates how to retrieve the SubscriberStatusEvent.

1<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">
2   <soapenv:Header>
3      <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
4         <wsse:UsernameToken wsu:Id="UsernameToken-24440876" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
5            <wsse:Username>XXXXX</wsse:Username>
6            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXX</wsse:Password>
7         </wsse:UsernameToken>
8      </wsse:Security>
9   </soapenv:Header>
10   <soapenv:Body>
11      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
12         <RetrieveRequest>
13            <Options/>
14            <ObjectType>SubscriberStatusEvent</ObjectType>
15            <Properties>ObjectID</Properties>
16            <Properties>SubscriberID</Properties>
17            <Properties>Client.ID</Properties>
18            <Properties>CurrentStatus</Properties>
19            <Properties>PreviousStatus</Properties>
20            <Properties>CreatedDate</Properties>
21            <Properties>SubscriberKey</Properties>
22            <Properties>ReasonUnsub</Properties>
23            <Filter xsi:type="par:ComplexFilterPart" xmlns:par="http://exacttarget.com/wsdl/partnerAPI">
24               <LeftOperand xsi:type="par:SimpleFilterPart">
25                  <Property>CurrentStatus</Property>
26                  <SimpleOperator>equals</SimpleOperator>
27                  <Value>Held</Value>
28               </LeftOperand>
29               <LogicalOperator>AND</LogicalOperator>
30               <RightOperand xsi:type="par:SimpleFilterPart">
31                  <Property>CreatedDate</Property>
32                  <SimpleOperator>between</SimpleOperator>
33                  <DateValue>2009-01-01T19:58:33.434707Z</DateValue>
34                  <DateValue>2010-04-07T19:58:33.434707Z</DateValue>
35               </RightOperand>
36            </Filter>
37         </RetrieveRequest>
38      </RetrieveRequestMsg>
39   </soapenv:Body>
40</soapenv:Envelope>

This sample code demonstrates how to use the RetrieveAllSinceLastBatch option to pull back the most recent information:

1<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">
2   <soapenv:Header>
3      <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
4         <wsse:UsernameToken wsu:Id="UsernameToken-24440876" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
5            <wsse:Username>XXXXX</wsse:Username>
6            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">XXXXX</wsse:Password>
7         </wsse:UsernameToken>
8      </wsse:Security>
9   </soapenv:Header>
10   <soapenv:Body>
11      <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
12         <RetrieveRequest>
13            <Options>
14               <Client>
15                  <ID>12345</ID>
16               </Client>
17            </Options>
18            <ObjectType>SubscriberStatusEvent</ObjectType>
19            <Properties>ObjectID</Properties>
20            <Properties>SubscriberID</Properties>
21            <Properties>Client.ID</Properties>
22            <Properties>CurrentStatus</Properties>
23            <Properties>PreviousStatus</Properties>
24            <Properties>CreatedDate</Properties>
25            <Properties>SubscriberKey</Properties>
26            <Properties>ReasonUnsub</Properties>
27            <Filter xsi:type="par:ComplexFilterPart" xmlns:par="http://exacttarget.com/wsdl/partnerAPI">
28               <LeftOperand xsi:type="par:SimpleFilterPart">
29                  <Property>CurrentStatus</Property>
30                  <SimpleOperator>equals</SimpleOperator>
31                  <Value>Unsubscribed</Value>
32               </LeftOperand>
33               <LogicalOperator>AND</LogicalOperator>
34               <RightOperand xsi:type="par:SimpleFilterPart">
35                  <Property>CreatedDate</Property>
36                  <SimpleOperator>greaterThan</SimpleOperator>
37                  <DateValue>2011-04-07T19:58:33.434707Z</DateValue>
38               </RightOperand>
39            </Filter>
40            <RetrieveAllSinceLastBatch>true</RetrieveAllSinceLastBatch>
41         </RetrieveRequest>
42      </RetrieveRequestMsg>
43   </soapenv:Body>
44</soapenv:Envelope>