EBay Notification Introduction

Source: Internet
Author: User

?

1. Introduction

"Notification Service" (the contract is the Chinese name of notification), is a convenient tool provided by EBAYAPI, with real-time characteristics.

?

Its design idea is based on the publish-subscribe model. Once a client subscribes to an event that requires notification, the client receives a notification from ebay in real time when the server sends a notification.

?

Official API Documentation:

http://developer.ebay.com/Devzone/guides/ebayfeatures/Notifications/Notifications.html This document should be the best first-hand information.

?

Forum Posts:

http://community.ebay.cn/thread-1200288175-1-1.html This post is more comprehensive.

?

. NET WebService Receive Example:

https://ebaydts.com/eBayKBDetails?KBid=2112 can be used directly, mainly in the configuration of SOAP message reception.

2.Usage

2.1 Process Description

1) Use the Setnotificationpreference interface to set the event type, notification address (email or URL) of the subscription

2) If you choose email, just consider how you will handle it after you receive the email.

3) If you choose a URL, you need to provide an address, such as Ebayapi.company.com's address to receive, here Note that the port number as far as possible to use 80 (8080 and 443 have not tried, should be able to), but the use of 94, the results are not received. Asked about ebay's technology, only with the default port.

4) When an event with a subscription occurs, ebay will proactively push the message to your pre-set notification address.

?

2.2 Setting the Receive address

?

Mainly divided into wake-up mailbox Settings , the default receive URL, a specified URL(up to 25) three blocks.

Alertemail,applicationurl,deliveryurldetailtype, in turn, respectively.

  1. [Test]
  2. Public void Setnotification_enableordisable_applicaitondelivery_test ()
  3. {
  4. ???? var context = Apicontextfactory.getapicontext (token);
  5. ???? //var context = Sandboxenvironment.getapicontextofsendbox ();
  6. ???? Setnotificationpreferencescall call = new setnotificationpreferencescall (context);
  7. ?
  8. ???? var enable = enablecodetype.enable;
  9. ???? var type = new applicationdeliverypreferencestype ()
  10. ???? {
  11. ???????? Alertemail = "mailto://[email protected]",
  12. ???????? Alertenable = Enable,
  13. ???????? Alertenablespecified = true,
  14. ?
  15. ???????? ApplicationUrl = "mailto://[email protected]",
  16. ???????? Applicationenable = Enable,
  17. ???????? Applicationenablespecified = true,
  18. ?
  19. ???????? Deliveryurldetails = new deliveryurldetailtypecollection (
  20. ???????????? New Deliveryurldetailtype[] {
  21. ???????????? New Deliveryurldetailtype ()
  22. ???????????? {
  23. ???????????????? Status = Enable,
  24. ???????????????? Deliveryurlname = "seller1_delivery",
  25. ???????????????? Deliveryurl = "http://address1.com",
  26. ???????????????? Statusspecified = true
  27. ????????????},new Deliveryurldetailtype () {
  28. ???????????????????? Status = Enable,
  29. ???????????????????? Deliveryurlname = "seller2_delivery",
  30. ???????????????????? Deliveryurl = "http://address2.com",
  31. ???????????????????? Statusspecified = true
  32. ????????????}})
  33. ????};
  34. ?
  35. ???? Call. Setnotificationpreferences (type);
  36. }

?

View specified results

  1. [Test]
  2. Public void Getnotification_rolecodetype_application_test ()
  3. {
  4. ???? var context = Apicontextfactory.getapicontext (token);
  5. ???? //var context = Sandboxenvironment.getapicontextofsendbox ();
  6. ???? Getnotificationpreferencescall call = new getnotificationpreferencescall (context);
  7. ???? Call. Getnotificationpreferences (notificationrolecodetype.application);
  8. ???? Console.WriteLine (call. Applicationdeliverypreferences);
  9. ???? Console.WriteLine (call. Applicationdeliverypreferences.alertemail);
  10. ???? Console.WriteLine (call. Applicationdeliverypreferences.applicationurl);
  11. ???? Console.WriteLine (call. ApplicationDeliveryPreferences.AlertEnable.ToString ());
  12. ???? Console.WriteLine (call. ApplicationDeliveryPreferences.ApplicationEnable.ToString ());
  13. ???? Console.WriteLine (call. ApplicationDeliveryPreferences.DeviceType.ToString ());
  14. ???? Console.WriteLine (call. ApplicationDeliveryPreferences.NotificationPayloadType.ToString ());
  15. ???? foreach (Deliveryurldetailtype item in call.) Applicationdeliverypreferences.deliveryurldetails)
  16. ???? {
  17. ???????? Console.WriteLine (item. Deliveryurl);
  18. ???????? Console.WriteLine (item. Deliveryurlname);
  19. ???????? Console.WriteLine (item. Status.tostring ());
  20. ????}
  21. }

?

?

2.3 Subscribe to EventType

?

  1. [Test]
  2. Public void Setnotificationpreferences_enableordisbable_eventtypes ()
  3. {
  4. ???? var context = Apicontextfactory.getapicontext (token);
  5. ???? //var context = Sandboxenvironment.getapicontextofsendbox ();
  6. ???? Setnotificationpreferencescall call = new setnotificationpreferencescall (context);
  7. ?
  8. ???? var enable = enablecodetype.enable;
  9. ???? Call. Deliveryurlname = "seller1_ Delivery "; //If specified, use the URL of the corresponding name, or vice versa. ApplicationUrl
  10. ???? var coll = new notificationenabletypecollection ();
  11. ?
  12. ???? Coll. ADD (new Notificationenabletype ()
  13. ???? {
  14. ???????? Eventenable = Enable,
  15. ???????? Eventenablespecified = true,
  16. ???????? EventType = Notificationeventtypecodetype.auctioncheckoutcomplete,
  17. ???????? Eventtypespecified = true
  18. ????});
  19. ?
  20. ???? Coll. ADD (new Notificationenabletype ()
  21. ???? {
  22. ???????? Eventenable = Enable,
  23. ???????? Eventenablespecified = true,
  24. ???????? EventType = Notificationeventtypecodetype.fixedpricetransaction,
  25. ???????? Eventtypespecified = true
  26. ????});
  27. ?
  28. ???? Coll. ADD (new Notificationenabletype ()
  29. ???? {
  30. ???????? Eventenable = Enable,
  31. ???????? Eventenablespecified = true,
  32. ???????? EventType = Notificationeventtypecodetype.endofauction,
  33. ???????? Eventtypespecified = true
  34. ????});
  35. ?
  36. ?
  37. ???? Call. Setnotificationpreferences (coll);
  38. }

?

View Subscription Results

?

  1. [Test]
  2. Public void Getnotification_userlevel_test ()
  3. {
  4. ?
  5. ???? var context = Apicontextfactory.getapicontext (token);
  6. ???? //var context = Sandboxenvironment.getapicontextofsendbox ();
  7. ?
  8. ???? Getnotificationpreferencescall call = new getnotificationpreferencescall (context);
  9. ???? Call. Getnotificationpreferences (Notificationrolecodetype.user);
  10. ?
  11. ???? Console.WriteLine (call. Deliveryurlname);
  12. ???? Console.WriteLine (call. Detaillevellist.count);
  13. ?
  14. ???? foreach (Notificationenabletype item in call.) Userdeliverypreferencelist)
  15. ???? {
  16. ???????? Console.WriteLine (item. Eventenable.tostring ());
  17. ???????? Console.WriteLine (item. Eventtype.tostring ());
  18. ????}
  19. }

?

2.4 Mail Receive results

The content is an XML document.

3. Precautions

3.1 Ports

If using HTTP or HTTPS, the port number should use the default port number (80,443) as far as possible

3.2 Token

When subscribing to a seller's eventtype, it is necessary to specify the token of the seller;

3.3 Applicationdeliverypreferencestype

When Applicationdeliverypreferencestype is set to disable, all enabled subscription events are not sent unless they are also set to enable.

EBay Notification Introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.