question

jewelryliquidation avatar image
0 Likes"
jewelryliquidation asked ·

Cannot get a User access token

Hi all, I'm trying to get a User Access token, but can't quite understand why it's not working. I've followed all the steps here https://developer.ebay.com/api-docs/static/oauth-authorization-code-grant.html but still not getting it. What I'm doing: 1) I get the user consent (I need it only for my own account) by going to ` https://auth.sandbox.ebay.com/oauth2/authorize?client_id={app-client-id-value}&redirect_uri={app-RuName-value}&response_type=code&scope={scopeList}` for scopeList I'm using a URL encoded string of scopes separated by a space. After going there and accepting, I'm redirected to a url with a parameter of "code". 2) I use that code value to send a POST request to ` https://api.ebay.com/identity/v1/oauth2/token` I use headers of Content-Type: application/x-www-form-urlencoded and Authorization: Basic *base64encoded("{clientID}:{clientSecret}")* For the body of the request I use: grant_type=authorization_code code={code-parameter-from-url in step 1} redirect_uri={RuName used in url to get the user consent in step 1} The response I get is always the same: **{ "error": "invalid_grant", "error_description": "the provided authorization grant code is invalid or was issued to another client" }** I've noticed that changing the grant_type to client_credentials returns an Application Access Token, but I don't understand why when I'm following the User Access token guide step-by-step. I'm using Postman to send all the requests, so it's not a programming error. Once I can get the flow to work, I can program it easily, but I'm stuck on getting the actual User Access token. Any help would be extremely appreciated. Thanks!
errortokentokenstoken erroruser tokeninvalid token
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.

0 Answers

· Write an Answer

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.