cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

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

Access Code not working when calling /oauth2/authorize with call back URL

Access Code not working when calling /oauth2/authorize with call back URL

saqib-shafique
Explorer | Level 3

 I have made an API which calls /oauth2/authorize to get access code which is used to get access token and refresh token, since this will be used in an automated process, when I call /oauth2/authorize without callback url, the code I get it works by copying and using in

/oauth2/token, but if I use it with callback URL it always returns "response_body": "{\"error\": \"invalid_grant\", \"error_description\": \"code has already been used\"}".
Call back url(
http://localhost:5000/callback) is configured correctly, otherwise it should not be working when using code manually. 
call back error.png
https://www.dropbox.com/oauth2/authorize?client_id={CLIENT_ID}&token_access_type=offline&response_type=code&redirect_uri={REDIRECT_URI}
"grant_type":"
authorization_code"

any assistance will be really helpful.
1 Reply 1

Здравко
Legendary | Level 20

Hi @saqib-shafique,

As the error message says, you have tried your code more than once. 🙂 This code is for single time use only. Even more - if not some copy/paste mistake, your URL is incorrect. The ending ("grant_type":"authorization_code") has nothing to do there. If you cannot get in touch/understand with your error, post relevant code snippet letting the mistake reproduction here, so we may comment it. 😉

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Здравко Legendary | Level 20
What do Dropbox user levels mean?