ODBC Driver for eBay

Build 20.0.7587

Creating a Custom OAuth App

There are two authentication methods available for connecting to eBay: Using a token generated for accessing only personal data or using tokens that allow other users to access their own data. Both methods require you to join the eBay Developers Program.

Register and Get Your Keys

After joining the eBay Developers Program, you can obtain the following values from the Application Keys page (My Account -> Application access keys).

  1. OAuthClientId (App ID)
  2. DevID
  3. OAuthClientSecret (Cert ID)

Using a Personal Token

If you're working with your own account, follow the steps below to generate a token:

  1. Go to your Developer Account Dashboard and open the Application Keys page.
  2. In the App ID (Client ID) row for the key set you want to use, click User Tokens.

    Use production keys if you're searching for real items or listing real items to the live eBay site. Use sandbox keys if you're creating test listings in the sandbox.

  3. Click Get a User Token Here and log in with credentials for either your sandbox or production eBay account.
You can then set the following connection properties and connect:
  • DevID: Set this to the Developer ID from your key set.
  • OAuthClientId: Set this to the App ID (Client ID) from your key set.
  • OAuthClientSecret: Set this to the Cert ID (Client Secret) from your key set.
  • SiteID: Set this to the eBay site ID. By default this is 0 (the U.S. site).
  • OAuthAccessToken: Set this to the personal token you generated from your developer account dashboard.
  • UseSandbox: Set this to true if you are using a sandbox account.
  • UseOAuth: Set this to true if you want to use OAuth 2.0 as an authentication method. If it is set to "false" or if it is not specified, Auth and Auth will be used to authenticate.

Getting Tokens for Applications with Multiple Users

eBay implements the OAuth authentication standard, which you can use to allow other users to access their own data.

OAuth requires the authenticating user to interact with eBay using the browser. The driver facilitates this in various ways as described in the following sections.

Set Up an OAuth App

Follow the steps below to configure the user consent flow:

  1. Go to your Developer Account Dashboard and open the Application Keys page.
  2. In the App ID (Client ID) row for your app, click User Tokens.
  3. Click Get a Token from eBay via Your Application, then click Add eBay Redirect URL, and set the RuName to the resulting value.

Authenticate to eBay from a Desktop Application

After setting the following connection properties, you are ready to connect:

  • DevID: Set this to the Developer ID from your key set.
  • OAuthClientId: Set this to the App ID (Client ID) from your key set.
  • OAuthClientSecret: Set this to the Cert ID (Client Secret) from your key set.
  • RuName: Set this to the Redirect URL name on the Token from eBay via your Application section of the User Tokens page.
  • SiteID: Set this to the eBay site ID. By default this is 0 (the U.S. site).
  • CallbackURL: Set this to http://localhost:33333 or another port of your choice.
  • InitiateOAuth: Set this to GETANDREFRESH.
  • UseSandbox: Set this to true if you are using a sandbox account.
  • UseOAuth: Set this to true if you want to use OAuth 2.0 as an authentication method. If it is set to "false" or if it is not specified, Auth and Auth will be used to authenticate.
When you connect, the driver opens the OAuth or Auth and Auth endpoint in your default browser. Log in and grant permissions to the application. The driver then completes the authentication process:
  1. Extracts the token and authenticates requests.
  2. Saves OAuth values in OAuthSettingsLocation to be persisted across connections.

Authenticate to eBay from a Web Application

To obtain the access token, set the following connection properties:

  • DevID: Set this to the Developer ID in your key set.
  • OAuthClientId: Set this to the App ID (Client ID) in your key set.
  • OAuthClientSecret: Set this to the Cert ID (Client Secret) in your key set.
  • SiteID: Set this to the eBay site ID. By default this is 0, (U.S.)
  • RuName: Set this to the Redirect URL name on the Token from eBay via your Application section of the User Tokens page.
  • UseSandbox: Set this to true if you are using a sandbox account.
  • UseOAuth: Set this to true if you want to use OAuth 2.0 as an authentication method. If it is set to "false" or if it is not specified, Auth and Auth will be used to authenticate.

When connecting via a Web application, or if the driver is not authorized to open a browser window, you need to exchange a session Id (if you are using Auth and Auth as an authentication method) or a verifier code (if you are using OAuth 2.0) for the OAuthAccessToken:

  1. Set the UseSandbox connection property to true if you are using a sandbox account.
  2. Set the UseOAuth connection property to true if you want to use OAuth instead of Auth and Auth to authenticate.
  3. Call GetOAuthAuthorizationURL. The stored procedure returns the URL to the OAuth endpoint.
  4. Log in and authorize the application. You are redirected back to the callback URL.
  5. Call GetOAuthAccessToken. Set the AuthMode paramater to "WEB". If you are using OAuth to authenticate, set the Verifier value to the value of the code returned from the previous step. Otherwise, if you are using Auth and Auth, set the SessionId parameter to the SessionId parameter returned in the query string of the callback URL from the previous step.
To make requests to eBay, set the OAuthAccessToken returned in addition to the preceding connection properties. Set InitiateOAuth to REFRESH to automatically refresh the access token when it expires.

Copyright (c) 2020 CData Software, Inc. - All rights reserved.
Build 20.0.7587