Using the eBay API Test Tool to Authenticate a User

The "Getting a User Token" section of Chapter 5 discusses a technique for authenticating a user with a series of Web pages. You can find the code for performing this task in the "Modifying the Basic Technique to Perform Authentication" section of Chapter 6. However, it's not always convenient for a developer to authenticate a test user with these techniques. Fortunately, you have an alternative available in the eBay API Test Tool. A special call named GetToken() lets you authenticate a user for testing purposes only. To use this call, you must rely on the special authentication keys discussed on the Getting Started with eBay Authentication and Authorization page at http://developer.ebay.com/DevZone/get-started/ authauth.asp.

To use this technique, open the eBay API Test Tool at http://developer.ebay.com/ DevZone/build-test/test-tool.asp. Select Sandbox mode. Input the authentication keys and provide your test user's name and password. Select GetToken as the request template and click Submit. You'll receive a message containing the token as a response. This is a short-term token that lasts either 10 minutes or 2 hours depending on which set of authentication keys you use. Unlike the real user token created in Chapters 5 and 6, this token isn't escaped—it doesn't include special sequences such as %2F for the / (slash) or %2B for the + (plus sign), so you don't need to worry about any special conversion before using the authentication token.

eBay Cash Insider

eBay Cash Insider

I refined my information, added notes as things came up and took out old or outdated information. Each time I discovered a new little tip or trick as I was making money with EBay, I added that information. Today, I bring home anywhere from 500 to 2000 each week with EBay. Thats not too shabby for someone who was just a year ago afraid to even purchase something from the site.

Get My Free Ebook


Post a comment