question

ben3dvd avatar image
0 Likes"
ben3dvd asked ·

Why can't I generate an oauth application token using Curl or Postman?

I'm just trying to generate an application oauth token using Curl as shown in the examples on this page: https://developer.ebay.com/api-docs/static/oauth-client-credentials-grant.html curl -X POST ' https://api.sandbox.ebay.com/identity/v1/oauth2/token' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Authorization: Basic QmVua......MTM' -d 'grant_type=client_credentials≻ope=https%3A%2F% 2Fapi.ebay.com%2Foauth%2Fapi_scope' Response: { "error": "server_error", "error_description": "server encountered an unexpected condition that prevented it from fulfilling the request" } When I try the exact same request with Postman, I get this response: { "error": "invalid_scope", "error_description": "The requested scope is invalid, unknown, malformed, or exceeds the scope granted to the client" } My scope is correct so don't tell me it is not. What is the problem?
oauth2
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
nochkin avatar image
0 Likes"
nochkin answered ·
Just tried it your way and it worked fine in both Prod and Sandbox environments. I see you have "scope" key messed up in your sample, but I guess it was the forum parser. Btw, curl has "-u" option instead of hand-carving Authorization header yourself. Also, "-X POST" is not required as you use -d option already. And setting Content-Type can be omitted too. $ curl ' https://api.sandbox.ebay.com/identity/v1/oauth2/token' -d 'grant_type=client_credentials≻ope=https%3A%2F% 2Fapi.ebay.com%2Foauth%2Fapi_scope' -u 'APPID:CERTID' {"access_token":"v^1.1#i^1#I^3#f^0#r^0#p^1#t^H4sIAA.......RAAA=","expires_in":7200,"token_type":"Application Access Token"}
· 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.