cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The authorization code grant request

Hi there I'm using the following API to generate the access token and I'm putting all inputs:

 

curl -X POST 'https://api.ebay.com/identity/v1/oauth2/token' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Authorization: Basic Y .... 4OThj' \
-d 'grant_type=authorization_code&
code=v^1.1#i ..... #MA==&
redirect_uri=foo'

 

but it returns this :

{"error":"invalid_request","error_description":"request is missing a required parameter or malformed."}

 

Am I wrong about something?

Message 1 of 5
latest reply
4 REPLIES 4

The authorization code grant request

@hoss_4807  

I'm not versed in cURL, but I don't see the 'scope' parameter in that data. The scope would be a space-delimited list of URLs that is sometimes optional. You may want to ensure that you are not omitting a required scope for your application:

https://developer.ebay.com/api-docs/static/oauth-scopes.html

 

ShipScript has been an eBay Community volunteer since 2003, specializing in HTML, CSS, Scripts, Photos, Active Content, Technical Solutions, and online Seller Tools.
Message 2 of 5
latest reply

The authorization code grant request

Hi @hoss_4807 

 

Please find the cURL code snippet for the step "Exchanging the authorization code for a User access token" below:

 

--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic client_id:client_secret(Base64-encoded OAuth credentials here)' \
--data-urlencode 'grant_type=authorization_code' \
--data-urlencode 'code=v^1.1#i^' \
--data-urlencode 'redirect_uri=RuName value assigned to your application'
 
For more details, please refer to The authorization code grant flow here
Best Regards,
eBay Developer Support
Message 3 of 5
latest reply

The authorization code grant request

I've tried this before and the result is the same.
The problem isn't here.

Message 4 of 5
latest reply

The authorization code grant request

my tires are not limited to curl,
I've tried this with Postman and browsers like Chrome.
Input data and responses are the same.

Message 5 of 5
latest reply