question

devel_2 avatar image
0 Likes"
devel_2 asked ·

Invalid IAF token

I am using this call to get a token:

$service = new OAuthServices\OAuthService([

'credentials' => $this->cred['Setting']['credentials'],

'ruName' => $ru_name,

'sandbox' => $this->cred['Setting']['sandbox']

]);

$response = $service->getAppToken();


I am getting a Status code of 200 and a token in the response. However when I use this token with the same credentials for ANY call I am getting an error. Here is an example of a call:


$service = new TradServ\TradingService([

'credentials' => $this->cred['Setting']['credentials'],

'authorization' => $token,

'sandbox' => $this->cred['Setting']['sandbox'],

'siteId' => $this->siteID,

]);

$suggestedCategories = $service->getSuggestedCategories(

new TradTypes\GetSuggestedCategoriesRequestType([

'Query' => $name

])

);

And this is the error I am getting:

[ShortMessage] => Invalid IAF token.                                            
[LongMessage] => IAF token supplied is invalid.                                           [ErrorCode] => 21916984                                            
[SeverityCode] => Error                                            
[ErrorClassification] => RequestError

I have tried setting up both a sandbox and production account as well as having oAuth on and off. I'm sure there is something simple I am missing. Does any one have any recommendations for troubleshooting this?

token error
10 |600 characters needed characters left characters exceeded

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

1 Answer

· Write an Answer
vertika_developersupport avatar image
0 Likes"
vertika_developersupport answered ·

Hi @devel_2

,It seems you are executing getSuggestedCategories call with application token. This call supports the use of OAuth tokens for user authorization. To authorize the request, supply a valid User access token. For details on User access tokens, see OAuth access tokens(https://developer.ebay.com/api-docs/static/oauth-tokens.html).
REF: https://developer.ebay.com/api-docs/static/oauth-authorization-code-grant.html

Best Regards
eBay Developer Support

· Share
10 |600 characters needed characters left characters exceeded

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.