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: 

How to get Access Token for background process without any user integractions?

How to get Access Token for background process without any user integractions?

devid13
Explorer | Level 4

Hi Team, 

We are doing dropbox integration to upload files from salesforce to dropbox. To do this we are doing background processing and to get access token we always use "Long-lived" from the "Generated access token" section that appears under the app "Settings" tab of the Dropbox app.

Now as per the "Action required: tokens and permissions" notification we would like to know the other way that how we can get access token without user interaction to upload file in the background?

 

3 Replies 3

Greg-DB
Dropbox Staff

Getting an access token always requires some sort of user interaction initially, either via the "Generate" button on the app's page on the App Console (when just getting an access token for the app owner's account), or via the OAuth app authorization flow (which can be used for any arbitrary user, not just the app owner).

 

In either case, once the access token is retrieved, the app can store and re-use it without further manual user interaction.

 

Long-lived access tokens don't expire, so they can be stored and re-used indefinitely (unless/until revoked). Short-lived access tokens expire after four hours though.

 

With the new system of short-lived access tokens and optional refresh tokens, in order to maintain long-term access without further manual user interaction, the app would need to request "offline" access, to get and store a refresh token, in addition to the short-lived access token. A refresh token allows the app to retrieve new short-lived access tokens on demand, whenever needed, without further manual user interaction. The "Generate" button does not currently offer the ability to retrieve refresh tokens, so you'd need to use and implement the OAuth flow in order to get that. You can find information on how that works in the OAuth Guide and authorization documentation. This blog post may also be helpful if you haven't already seen it.

DuraUser
New member | Level 2

Hi Greg/Team,

 

In your response you mentioned that we can use refresh token to get short lived access tokens without further manual interaction. How long can we keep using the refresh token. Is there a time limit on when Refresh token also expires?

 

"With the new system of short-lived access tokens and optional refresh tokens, in order to maintain long-term access without further manual user interaction, the app would need to request "offline" access, to get and store a refresh token, in addition to the short-lived access token"

Greg-DB
Dropbox Staff

@DuraUser Dropbox refresh tokens don't expire automatically, but they can be revoked by the app or user on demand.

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropbox Staff
  • User avatar
    DuraUser New member | Level 2
What do Dropbox user levels mean?