Skip to content

Research on testing eBay API

Sanjib Saha edited this page Mar 28, 2021 · 4 revisions

eBay1

Testing options:

  • Postman
  • Ebay API Node.js

With Postman

Requirements:

Site ID: 2 for Canada (English) and 210 for Canada (French) https://developer.ebay.com/devzone/finding/Concepts/SiteIDToGlobalID.html

API Release Notes https://developer.ebay.com/DevZone/finding/ReleaseNotes.html

In order to make a successful request there are a few HTTP headers that need to be sent Capture2

HTTP Header Examples

If you are using the HTTP POST method, use the X-EBAY-API-REQUEST-ENCODING value (or a requestencoding URL parameter) to specify that your input is in one of the following formats: NV (Name-Value Pair), JSON, XML, or SOAP.

The output (response data) will be in the same format as the input, so there is no need to specify a X-EBAY-API-RESPONSE-ENCODING value. However, you can specify an output format that is different from your input format by using a X-EBAY-API-RESPONSE-ENCODING value. This example shows standard Shopping API headers for an HTTP POST call(which uses the same https://open.api.ebay.com/shopping? endpoint as a GET call).

The X-EBAY-API-REQUEST-ENCODING header specifies NV for Name-Value Pair input, and can be changed as follows:: XML for XML input, SOAP for SOAP input, and JSON for JSON input.

X-EBAY-API-CALL-NAME: FindProducts

X-EBAY-API-IAF-TOKEN: YourOAuthTokenHere

X-EBAY-API-VERSION: 1063

X-EBAY-API-SITE-ID: 0

X-EBAY-API-REQUEST-ENCODING: NV

Advantage of using Postman:

  • Very easy to us
  • Collection of API calls, and one has to follow that collection of API calls for testing APIs of application.
  • API call method can be selected from the given dropdown list, set Authorisation, Header, Body information according to the API call

Demo

The Basics of Using Postman for API Testing https://www.youtube.com/watch?v=t5n07Ybz7yI

Using Postman To Connect To The eBay API http://devbay.net/blog/2015/03/22/using-postman-to-connect-to-the-ebay-api/

eBay Site ID to Global ID Mapping https://developer.ebay.com/devzone/finding/Concepts/SiteIDToGlobalID.html

Finding API Tutorials https://developer.ebay.com/DevZone/finding/HowTo/index.html