Establishing a Connection
Configure a Connection Profile
From the CData ribbon, click Get Data and select From eBay connection/s to launch the CData Query window. To setup a new connection, you will have to click the New eBay Connection button. Here you can set the connection settings, test the connection, and save the connection profile.
Connecting to eBay APIs
Set the following to connect to eBay:
- SiteID: Set this to the eBay site ID. By default this is "0" (the U.S. site).
- UseSandbox: Set this to True to use a eBay sandbox account. By default, the add-in connects to production environments.
- RuName: Set this to the RuName (eBay Redirect URL name) that you will use to sign-in. Find this in your eBay Sign-in Settings.
Authenticating to eBay
The add-in can authenticate to eBay using either the OAuth 2.0 authentication standard or Auth'n'Auth, the traditional authentication used by the eBay APIs.
User Accounts (OAuth)
Set AuthScheme to OAuth.
Desktop Applications
You need to create a custom OAuth application. See Creating a Custom OAuth App for information about creating custom applications.Get and Refresh the OAuth Access Token
After setting the following, you are ready to connect:
- OAuthClientId: Set this to the App ID (Client ID) in your keyset.
- OAuthClientSecret: Set this to the Cert ID (Client Secret) in your keyset.
- CallbackURL: Set to a URL containing the server name and port of the device running the add-in. Any localhost address is usable. The default callback URL is: http://localhost:33333.
User Accounts with Legacy Apps (Auth'n'Auth)
The add-in can authenticate using eBay's legacy Auth'n'Auth protocol. Select this authentication scheme if you're using an older application that was built to use Auth'n'Auth.
Set AuthScheme to AuthNAuth.
You need to create a custom OAuth application. See Creating a Custom OAuth App for more information.
Access Token
An OAuthAccessToken is required when authenticating via Auth'n'Auth. Set the following connection properties to obtain the OAuthAccessToken:
- OAuthClientId: Set this to the App ID (Client ID) in your keyset.
- OAuthClientSecret: Set this to the Cert ID (Client Secret) in your keyset.
- DevID: Set this to the Developer ID from your keyset.
Then call stored procedures to complete the token exchange:
-
Call the GetOAuthAuthorizationURL stored procedure. Set the RuName input to the eBay Redirect URL you specified in your app settings. The stored procedure returns the URL to the OAuth endpoint.
- Navigate to the URL that the stored procedure returned in Step 1. Log in, and authorize the web application. After authenticating, the browser redirects you to the redirect URI. There will be a parameter called sessionid appended to the redirect URI. Note the value of this parameter. If you are using the recommeded https://oauth.cdata.com/oauth/ as your "auth accepted URL", the value will be BASE64 encoded and will need to be decoded before proceeding.
- Call the GetOAuthAccessToken stored procedure. Set the AuthMode input to WEB. Set the SessionId input parameter to either the value of the 'sessionid' in the query string of the authorization URL or the BASE64 decoded session ID from the callback URL.
Set the following connection properties to connect to data:
- OAuthClientId: Set this to the App ID (Client ID) in your keyset.
- OAuthClientSecret: Set this to the Cert ID (Client Secret) in your keyset.
- OAuthAccessToken: Set this to the Auth'n'Auth token returned by GetOAuthAccessToken.
Note: Auth'n'Auth tokens expire after 18 months. You will need to generate a new token after the token expires.
- DevID: Set this to the Developer ID from your keyset.
Connection Properties
The Connection properties describe the various options that can be used to establish a connection.
Managing Connections
After successfully authenticating to eBay you will be able to customize the data you are importing. To learn more about this, see Managing Connections.
See Also
- Querying Data: Use the data selection wizard to pull data into a spreadsheet. You can also configure scheduled data refresh here.
- Using the Excel Add-In: Find other ways to interact with eBay data, such as using the available CData Excel Functions.