cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Are you interested in hearing how one of our Community members uses Dropbox for sailing trips? Read all about it 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: 

Help with creating long-lived token

Help with creating long-lived token

CanadianIT
New member | Level 2
Go to solution

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_...  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 Accepted Solution

Accepted Solutions

Rich
Super User II
Go to solution

@CanadianIT wrote:

My issue is with trying to generate a long-lived token.


Long-lived tokens were deprecated back in 2021 and can no longer be created. You now use refresh tokens to retrieve new short-lived tokens as needed. See here for more information:

 

View solution in original post

1 Reply 1

Rich
Super User II
Go to solution

@CanadianIT wrote:

My issue is with trying to generate a long-lived token.


Long-lived tokens were deprecated back in 2021 and can no longer be created. You now use refresh tokens to retrieve new short-lived tokens as needed. See here for more information:

 

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Rich Super User II
What do Dropbox user levels mean?