We Want to Hear From You! What Do You Want to See on the Community? Tell us here!

Forum Discussion

CanadianIT's avatar
CanadianIT
New member | Level 2
2 years ago
Solved

Help with creating long-lived token

I'm quite new to using the API, but I was successful once and trying to follow the same steps with no luck.  My issue is with trying to generate a long-lived token.  I am creating my new app, and getting my "App Key" and "App Secret".  I then generate an "Access Token".  From there, I use this

 

https://www.dropbox.com/oauth2/authorize?response_type=code&client_id=APP_KEY&redirect_uri=REDIRECT_URI  which then returns an "auth code" in the URL.  

 

Using that Auth Code I use the following:

 

curl -X POST "https://api.dropboxapi.com/oauth2/token" ^
-d code=AUTH_CODE ^
-d grant_type=authorization_code ^
-u APP_KEY:APP_SECRET

 

But every single time I get "{"error": "invalid_grant", "error_description": "redirect_uri mismatch"}" and not sure what I am doing wrong.  

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.6,033 PostsLatest Activity: 3 years ago
409 Following

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!