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 variables2String 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 RetrieveRequest9RetrieveRequest rr = new RetrieveRequest();10rr.ObjectType = "SubscriberStatusEvent";11rr.Properties = new string[] { "Client.ID", "SubscriberID", "SubscriberKey", "ReasonUnsub", "CurrentStatus", "PreviousStatus", "CreatedDate" };12rr.Filter = sfp;13// Execute RetrieveRequest14String status = integrationFramework.Retrieve(rr, out requestID, out results);15// Output the Values16Console.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-fc3d01ecf3a9263_________Properties______________4Date:4/14/2009 11:54:31 PM Name:SubscriberID Value:1996528915Date:4/14/2009 11:54:31 PM Name:SubscriberKey Value:ts6Date:4/14/2009 11:54:31 PM Name:ReasonUnsub Value:unsubscribed by Marketing Cloud RMM service based on subscriber reply email request7Date:4/14/2009 11:54:31 PM Name:CurrentStatus Value:unsub8Date:4/14/2009 11:54:31 PM Name:PreviousStatus Value:normal9Date:4/14/2009 11:54:51 PM Name:SubscriberID Value:19965289510Date:4/14/2009 11:54:51 PM Name:SubscriberKey Value:ts311Date:4/14/2009 11:54:51 PM Name:ReasonUnsub Value:unsubscribed by Marketing Cloud RMM service based on subscriber reply email request12Date:4/14/2009 11:54:51 PM Name:CurrentStatus Value:unsub13Date:4/14/2009 11:54:51 PM Name:PreviousStatus Value:normal14Date:4/14/2009 11:58:33 PM Name:SubscriberID Value:19965289615Date:4/14/2009 11:58:33 PM Name:SubscriberKey Value:ts416Date:4/14/2009 11:58:33 PM Name:ReasonUnsub Value:unsub by email17Date:4/14/2009 11:58:33 PM Name:CurrentStatus Value:unsub18Date:4/14/2009 11:58:33 PM Name:PreviousStatus Value:normal19Date:4/15/2009 12:00:09 AM Name:SubscriberID Value:19965289720Date:4/15/2009 12:00:09 AM Name:SubscriberKey Value:ts521Date:4/15/2009 12:00:09 AM Name:ReasonUnsub Value:unsub by email22Date:4/15/2009 12:00:09 AM Name:CurrentStatus Value:unsub23Date:4/15/2009 12:00:09 AM Name:PreviousStatus Value:normal24Date:4/15/2009 12:01:10 AM Name:SubscriberID Value:19965289325Date:4/15/2009 12:01:10 AM Name:SubscriberKey Value:ts226Date:4/15/2009 12:01:10 AM Name:ReasonUnsub Value:unsub by email27Date:4/15/2009 12:01:10 AM Name:CurrentStatus Value:unsub28Date:4/15/2009 12:01:10 AM Name:PreviousStatus Value:normal29Date:4/15/2009 12:11:46 AM Name:SubscriberID Value:19965289230Date:4/15/2009 12:11:46 AM Name:SubscriberKey Value:ts131Date:4/15/2009 12:11:46 AM Name:ReasonUnsub Value:unsub by email32Date:4/15/2009 12:11:46 AM Name:CurrentStatus Value:unsub33Date: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}