cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
What’s new: end-to-end encryption, Replay and Dash updates. Find out more about these updates, new features and more 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: 

Re: Uploading a file to own Dropbox account using API

Uploading a file to own Dropbox account using API

ajay699patel
New member | Level 2

Hi,

 

I want to upload the files from my machine to my own Dropbox account. I have created an App in Dropbox and generated an access token but it expires in sometime. How can I generate an access token and upload a file without going through authorization flow?

 

Thanks

3 Replies 3

Здравко
Legendary | Level 20

@ajay699patel wrote:

... I have created an App in Dropbox and generated an access token but it expires in sometime. How can I generate an access token and upload a file without going through authorization flow?

...


Hi @ajay699patel,

At the beginning let's clarify that long lived access token is something obsolete and in spite an existing long lived access token (received some time ago) can still be used, issuing new such token is dropped already. Now all new access tokens are short lived and keep validity for 4 hours at most. There is new mechanism for long term access, without repeatable user authentication - refresh token. If you are using some of the Dropbox SDK's, there are examples (not all) that show how you can adapt your existing application or use them as a template for authentication' part for a new app. If you are performing direct calls to Dropbox servers (without any SDK), using only access token is no more possible for long term. You should extend your authentication procedure to use refresh mechanism. A simple example of such call sequence could be seen here. 😉

Hope this helps.

Greg-DB
Dropbox Staff

@ajay699patel Здравко is correct, Dropbox is in the process of switching to only issuing short-lived access tokens (and optional refresh tokens) instead of long-lived access tokens. You can find more information on this migration here.

Apps can still get long-term access by requesting "offline" access though, in which case the app receives a "refresh token" that can be used to retrieve new short-lived access tokens as needed, without further manual user intervention. You can find more information in the OAuth Guide and authorization documentation.

For reference, while the creation of new long-lived access tokens is now deprecated, we don't currently have a plan to disable existing long-lived access tokens. (If that changes, we will of course announce that ahead of time.) That being the case, you can continue using existing long-lived access token(s) without interruption, if you have any.

ajay699patel
New member | Level 2

Thanks for revalidating my approach😊😊. I am doing the same work round for uploading the files to my own Dropbox account👍.

Need more support?