For full functionality of this site it is necessary to enable JavaScript.
Here are the instructions how to enable JavaScript in your web browser.

Knowledge base

Find the answer to your question

Advanced Search PView

Search terms
Search Type
Product
Category
Language
Format
SDK
Sort by
Direction

Subscribing to Platform Notifications

  • Answer ID 637
  • Published 08/23/2006 05:09 PM
  • Updated 10/20/2013 06:41 AM
  • Permalink https://ebaydts.com/eBayKBDetails?KBid=637
Product

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

Print Email This Page Delicious Digg Facebook Reddit StumbleUpon Twitter