Using API Explorer to run sample calls

API Explorer is a tool that lets you run sample calls for all the methods in the eBay APIs.

Subtopics

Accessing API Explorer

API Explorer is provided on the eBay Developers Program site and you must log into the site in order to access the tool. If you do not already have an eBay Developers Program account, see Creating a developer account.

Once you log into the eBay Developers Program, navigate to Tools & Samples > API Explorer.

Selecting the method you want to test

The left side of API Explorer displays your application name and several selection boxes, as shown here:

API Explorer selection boxes

Select the Environment and Site ID (marketplace) you want to target, the API you want to use, and the name of the API Call you want to test.

Configuring your test calls

API Explorer has one or more sample calls preconfigured for each API method.

See the Samples dropdown box in the Call Request section of the page to see a list of the available samples for each call. You can edit the provided samples to configure any aspect of the test calls you make.

Because many of the methods in the eBay APIs are sequential in nature, many of the preconfigured samples require that you configure the request before you can make the call.

For example, if you're trying to get the details on a fulfillment policy with GET /fulfillment_policy/{fulfillmentPolicyId}, you need to supply the fulfillmentPolicyId for the policy you want to inspect.

Before making a test call, review the endpoint for the selected sample and make sure you have supplied valid values for any placeholders in the URL. Also, if your method employs a request body, be sure to replace any variables in the sample request with valid values.

In URLs and request bodies, variable placeholders are often signified as variable names placed within curly braces ( { } ) or angle brackets ( < > ). Replace the entire string, brackets and braces included, with the values you want to use for your test call.

Lastly, if the method you're calling uses query parameters, be sure to set the parameters according to the call you want to test.

Authorizing calls made via API Explorer

Like all calls made to eBay APIs, the calls you make through API Explorer must be authorized.

Nearly all methods work with OAuth access tokens, which is the recommended type of authorization.

Be aware that the type of OAuth token you need depends on the API method you select. In general, most methods work with a User access token, while a few work with a more straight-forward Application access token (commonly called an "app token"). Either way, all access tokens expire after a short period.

For details on which type of access token you need, see Using OAuth to access eBay APIs.

After logging into to the eBay Developers Program, you can get both Application access tokens and User access tokens through the API Explorer page. Normally, you can get an app token with a single click, while you need to configure some settings (and consent to use) to obtain a User access token.

Once you've obtained the appropriate access token, paste the token value into the Token box in API Explorer.

Making an API Explorer request

Make your request to the service after you've:

  1. Selected the method you want to call
  2. Set any values needed to make the call in the service's endpoint and request body
  3. Configured the OAuth token

Once set, click the Execute button. If everything is as it should be, check the Call Response section on the page to see the result from your request.

If things don't go as planned, review any error messages and check the API documentation for the call you're trying to make.