Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check 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.  

1 Reply

Replies have been turned off for this discussion

About Dropbox API Support & Feedback

Node avatar for Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.

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, Facebook or Instagram.

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!