Skip to main content
Published: August 23 2006, 5:09:00 PMUpdated: November 28 2020, 2:28:19 PM

Summary

Subscribe your application and users to Platform Notifications via the SetNotificationPreferences call. A separate call must be made for the application, and then for each individual user/subscriber.  The steps below walk through an example of subscribing an Application and User to the End Of Auction notification event.


Detailed Description

Briefly, the process is this:

1) For each of the users you support, you need to use that user's auth token and call SetNotificationPreferences with a 'list' (set of XML nodes actually) of messages that user would like to subscribe to.   Here is a sample XML request that will enable a user for EOA (End of Auction) and Feedback notification messages:

<?xml version="1.0" encoding="utf-8"?>

<SetNotificationPreferencesRequest xmlns="urn:ebay:apis:eBLBaseComponents">

<Version>831</Version>

<RequesterCredentials>

<eBayAuthToken>x</eBayAuthToken>

</RequesterCredentials>

<UserDeliveryPreferenceArray>

<NotificationEnable>

<EventType>EndOfAuction</EventType>

<EventEnable>Enable</EventEnable>

</NotificationEnable>

<NotificationEnable>

<EventType>Feedback</EventType>

<EventEnable>Enable</EventEnable>

</NotificationEnable>

</UserDeliveryPreferenceArray>

</SetNotificationPreferencesRequest>


2) Call SetNotificationPreferences again with the URL you wish your application to receive notifications from.  Here is a sample XML request.  You would need to fill in the URL for your server and a token for a user of your application (your own userId is fine). 

Best practice:  Don't include the <ApplicationDeliveryPreferences> container in the SetNotificationPreferences user level subscription request showing above because application level setting applies to each of your subscribed users.

 <?xml version="1.0" encoding="utf-8"?>

<SetNotificationPreferencesRequest xmlns="urn:ebay:apis:eBLBaseComponents">

<Version>831</Version>

<RequesterCredentials>

<eBayAuthToken>x</eBayAuthToken>

</RequesterCredentials>

<ApplicationDeliveryPreferences>

<ApplicationURL>http://mynotificationurl.com/sendhere.cgi</ApplicationURL>

<ApplicationEnable>Enable</ApplicationEnable>

</ApplicationDeliveryPreferences>

</SetNotificationPreferencesRequest>


3) A final note:  If one of your users unsubscribes from your service, then please use the API to unsubscribe them from Platform Notifications. 


Additional Resources

How well did this answer your question?
Answers others found helpful