cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Get summer ready with Dropbox basic - travel documents, plans, progress reminders and more, right over 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: 

Long-term Access Token for using in Node Red

Long-term Access Token for using in Node Red

lsteel11
Explorer | Level 4

Hi, 

 

I am trying to sync data from a raspberry pi to a dropbox app, so that I can access the data remotely in real time (e.g. it updates every 10 mins). I created a flow in Node Red to do this, using the dropbox out node - and put in the access token from my dropbox app. This worked well, however, the access token expired after a few hours. From researching, I see that dropbox is now only generating short term access tokens. However, for my data collection I require long term access.

 

1. Would generating a refresh token solve this problem? 

2. If so, how do I generate a refresh token? I have  downloaded python and python SDK, and tried to follow the documentation, but I am confused and cannot get it to work. 

 

I would really appreciate any help on the above, or any other ideas you may have as to how to sync this data! 

 

Many thanks, 

Laura 

1 Accepted Solution

Accepted Solutions

Re: Long-term Access Token for using in Node Red

Greg-DB
Dropboxer

1. Yes, using a refresh token is the right way to maintain long-term access without repeated manual interaction.

 

2. You can find an example of using the Python SDK to process the app authorization flow to get a refresh token here. Once you have the refresh token, you can store and re-use it to make the Dropbox client object whenever you need, without processing the app authorization flow again. The SDK will use the refresh token to perform the refresh process for you automatically.

View solution in original post

5 Replies 5

Re: Long-term Access Token for using in Node Red

Greg-DB
Dropboxer

1. Yes, using a refresh token is the right way to maintain long-term access without repeated manual interaction.

 

2. You can find an example of using the Python SDK to process the app authorization flow to get a refresh token here. Once you have the refresh token, you can store and re-use it to make the Dropbox client object whenever you need, without processing the app authorization flow again. The SDK will use the refresh token to perform the refresh process for you automatically.

Re: Long-term Access Token for using in Node Red

lsteel11
Explorer | Level 4

Hi Greg, 

 

Thank you so much for this! I have managed to successfully implement the code (using my App Key etc) as far as line 19. 

 

When I run that next section, python just shuts down... any ideas? 

 

Many thanks, 

Laura 

Re: Long-term Access Token for using in Node Red

lsteel11
Explorer | Level 4

Hi Greg, 

 

Thank you so much for this! I have managed to successfully implement the code (using my App key etc) up until line 19. 

 

When I run this next section, python just shuts down ... any ideas? 

 

Many thanks!

Laura 

Re: Long-term Access Token for using in Node Red

lsteel11
Explorer | Level 4

Hi Greg, 

 

Thank you so much for this! I have tried to reply a couple of times but dropbox keeps marking my response as spam and removing it!?

 

I have successfully implemented the example code (using my app key etc) up until line 19. When I try to run this next section, python just shuts down ... any ideas? 

 

Many thanks! 

Re: Long-term Access Token for using in Node Red

Greg-DB
Dropboxer

Apologies for the trouble with the spam filter. I just unflagged your posts. Anyway, I saw your new post and followed up there.

Poll
Which Dropbox Plan do you have?
Who's talking

Top contributors to this post

  • User avatar
    Greg-DB Dropboxer
  • User avatar
    lsteel11 Explorer | Level 4
What do Dropbox user levels mean?
Need more support?