Skip to main content
Published: July 17 2006, 5:57:00 PMUpdated: November 28 2020, 2:14:12 PM

Is there sample code on using FetchToken with the .NET SDK?

Attached is a Visual Studio .NET 2003 command line project in C# that shows how to make the FetchToken call using eBay SDK v465.0 for .NET

1. Before you build this sample project, please make sure to check that the project's reference to eBay.Service is valid
The path to this reference is D:\Program Files\eBay\eBay SDK v465.0 for .NET\eBay.Service.dll in this sample.
If needed, remove the existing reference, and add the reference again pointing to whereever this file is on your computer.

2. Before you run the sample, you will need to fill in your information in place of the "xxx" in the following lines of source code, as well as set your SecretID:

// set the dev,app,cert information
oContext.ApiCredential.ApiAccount.Developer = "xxx";
oContext.ApiCredential.ApiAccount.Application = "xxx";
oContext.ApiCredential.ApiAccount.Certificate = "xxx";

// set the username
oContext.ApiCredential.eBayAccount.UserName = "xxx";

// set the SecretID that you used in the signin URL
// important ... use the same case for all characters as you used in the signin URL
// here is an example of a signin URL:
// https://signin.ebay.com/ws/eBayISAPI.dll?SignIn&runame=MyRunameValue&sid=abac7415-5785-4321-bf2d-5dda054f700f
// and here is the same value set in the SecretID:
oFetchTokenCall.SecretID = "abac7415-5785-4321-bf2d-5dda054f700f";

Please note that the default API URL is set to Production:
oContext.SoapApiServerUrl = "https://api.ebay.com/wsapi";

How well did this answer your question?
Answers others found helpful