cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
From Dropbox Dash and Dropbox AI to seamless integrations with tools like Gmail, learn how Dropbox makes your day more efficient and easier, and how sci-fi is becoming reality 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: 
1
Ask
2
Comments

API access token expired

API access token expired

Emron
New member | Level 2
Go to solution

Hi,

i am using some of the http api endpoints to upload or download files. As i saw in the documentation the API access tokens never expire but can only be revoked. For some reason after i use my token for a day or so i get the message "expired_access_token". Then i need to create a new one. Of course i never revoked it manually or from the api.

I have another account where there i don't have any issue. My token is still working after many months. I followed the same process to create both of them but still they are different. The token for my old account is 64 characters long but the new one is 139 and always starts with "sl.".

Am i doing something wrong? Did anything change on how Dropbox is producing access tokens? Thanks in advance for any help.

1 Accepted Solution

Accepted Solutions

Re: API access token expired

Greg-DB
Dropbox Staff
Go to solution

Based on your description, it sounds like you're getting the access token from the "API v2 Explorer". That tool is just meant for prototyping Dropbox API calls, and currently has early access to an upcoming "short-lived access token" feature. That means that, unlike standard Dropbox API access tokens, the access tokens you get from the API Explorer will expire by themselves. (You can identify them by the "sl." prefix you mentioned.)

To get standard Dropbox API access tokens, you should use your own API app registration. For instance, you can use the "Generate" button on your app's page on the App Console, or use the OAuth app authorization flow with your app.

View solution in original post

7 Replies 7

Re: API access token expired

Greg-DB
Dropbox Staff
Go to solution

Based on your description, it sounds like you're getting the access token from the "API v2 Explorer". That tool is just meant for prototyping Dropbox API calls, and currently has early access to an upcoming "short-lived access token" feature. That means that, unlike standard Dropbox API access tokens, the access tokens you get from the API Explorer will expire by themselves. (You can identify them by the "sl." prefix you mentioned.)

To get standard Dropbox API access tokens, you should use your own API app registration. For instance, you can use the "Generate" button on your app's page on the App Console, or use the OAuth app authorization flow with your app.

Re: API access token expired

Emron
New member | Level 2
Go to solution

Thank you very much for taking the time to answer. I tested like an hour ago to create my app and generate token for my app and its working as expected. The token generated is shorter and does not have the prefix "sl". Its the same format as the token i created in the past through the API Explorer. It was my fault to use the token from the API explorer for my requests. Anyway, thanks again for your help!

Re: API access token expired

ahmed-sharaf
Helpful | Level 5
Go to solution
Hello,

I am facing the same problem which has been resulted from generating access token from "Dropbox API Explorer". The access token become longer and starting with "sl.***".

I have unlinked the Dropbox API Explorer from the connected apps and tried to generate from App Console but it is still generating the longer tokens and shows me that the token is short-lived one and will expire 4 hours after generation.

I am not sure where the fault I did else. Could you please help?

Re: API access token expired

winkelement
Helpful | Level 6
Go to solution

I'm having the same problem.

I never used the "Dropbox API Explorer" but every Token i generate via App Console expires after 4 hours.

Re: API access token expired

ahmed-sharaf
Helpful | Level 5
Go to solution
@winkelement
You are right. I tried through another new account and it generates short-lived tokens although Dropbox API Explorer has never been used.

Re: API access token expired

Greg-DB
Dropbox Staff
Go to solution

@ahmed-sharaf @winkelement Apologies for the confusion! Please refer to my post here for information.

Re: API access token expired

edou123
New member | Level 2

 

 

Thanks a lot!

 

Who's talking

Top contributors to this post

  • User avatar
    edou123 New member | Level 2
  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    ahmed-sharaf Helpful | Level 5
  • User avatar
    winkelement Helpful | Level 6
What do Dropbox user levels mean?
Need more support?