question

netvigator avatar image
0 Likes"
netvigator asked

do I need an OAuth application access token?

I have been using the shopping service for GetSingleItem calls, and today for the first time I got this:

Token not available in request. Please specify a valid token as HTTP header.
ErrorCode: 1.33

This crashed my process. So I changed my code to catch and ignore this error. Running the process again, I got the token error on the exact same item (#164862306610). I did not get an error on any other item -- I got the info on all the other items.

I found this, which I understand to mean I need to get an access token:

https://forums.developer.ebay.com/questions/40982/frequent-invalid-token-errors-using-oauth-for-shop.html

  1. Is getting a token mandatory?
  2. Do I need a user token or an application token?
  3. Do I get one token and use it for each of many GetSingleItem calls, or do I get a new token for each GetSingleItem call?


tokenshopping apitoken errorgetsingleitem
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sanjiv_developersupport avatar image
1 Like"
sanjiv_developersupport answered

Hi @netvigator , Thanks for reaching out.


1. Starting on July 1, 2021, developers using Shopping API calls must authenticate with an OAuth application access token using the X-EBAY-API-IAF-TOKEN HTTP header, as both the appid query parameter and X-EBAY-API-APP-ID HTTP header will be deprecated on June 30, 2021. Developers should start making plans at their earliest convenience to migrate to using OAuth application access tokens with https://api.ebay.com/oauth/api_scope scope. See the The client credentials grant flow topic for more information on generating and managing OAuth application access tokens. See the Specifying OAuth scopes topic for more information on OAuth scopes.

Currently, to use a Shopping API call, developers can either pass in their developer account App ID through either the appid URL parameter or through the X-EBAY-API-APP-ID HTTP header, or they can use an OAuth application access token that is passed into the X-EBAY-API-IAF-TOKEN HTTP header.


2. You need application access token.


3. OAuth Application access token is good for 2 hours.


Best Regards,

eBay Developer Support

10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

pharaohcacheiro-2 avatar image
0 Likes"
pharaohcacheiro-2 answered

@netvigator were you able to get this fixed? I am having the same problem.


@sanjiv_developersupport I was able to get an access token following the client credentials grant flow. Then I removed the appid URL parameter from my Shopping call and added the HTTP header of X-EBAY-API-IAF-TOKEN: <access_token> however I am receiving an undefined error.

Some of the eBay docs mention using the Authorization header instead. However, when I try the HTTP header of Authorization: bearer <access token> I also receive an undefined error.

I have looked through the ebay documentation thoroughly and cannot figure out what I am doing wrong. Any additional specifics on how to change from the old shopping call (using appid parameter) to the new shopping call (somehow using the access_token in the header) or further help would be greatly appreciated.

10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

islandcollector avatar image
0 Likes"
islandcollector answered

Has this been solved? I managed to connect and use the API, but the Application Token is only valid for 1 hour.

· 5
10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

michab2003 avatar image michab2003 commented ·

I would start thinking differently: it does not play a role if the token is valid for one, two or three hours. the concept anyway is: the tokens lifetime is short, that is wanted and the concept of security here. so use the valid token as long it's valid, if it has expired, create a new one, that is a process you cannot avoid.

0 Likes 0 ·
pharaohcacheiro-2 avatar image pharaohcacheiro-2 commented ·
Did you connect to the API using the Shopping call? If so, would you mind sharing a screenshot or the code of what you used to connect? I'm able to get the access token but unable to use it with the Shopping call successfully - I'm assuming my setup is wrong somehow.
0 Likes 0 ·
michab2003 avatar image michab2003 pharaohcacheiro-2 commented ·
with shopping call, you mean the shopping api?
0 Likes 0 ·
pharaohcacheiro-2 avatar image pharaohcacheiro-2 michab2003 commented ·
Thats correct
0 Likes 0 ·
Show more comments
calgarycomputerwholesale avatar image
0 Likes"
calgarycomputerwholesale answered

X-EBAY-API-IAF-TOKEN: <access_token>
works for me. thank you.

10 |600

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.