0
votes

I am trying to get an access_token using the code I get once the permission is granted by the resource owner. My request is like:

URI:
https://api.amazon.com/auth/o2/token

BODY:
client_id=amzn1.application-oa2-client.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&client_secret=%090xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&code=xxxxxxxxxxxxxxxxxxxxxxxxxx&grant_type=authorization_code&redirect_uri=https%3A%2F%2Flocalhost&scope=clouddrive%3Awrite

HEADERS: host api.amazon.com:443 user-agent MySockets content-type application/x-www-form-urlencoded content-length 271 connection close

I get the error: 404

Please can anyone point me to what I am doing wrong here.

1

1 Answers

0
votes

Problem was that my socket library was sending "GET" http method. Once I set it to "POST" it worked!