We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
kdss-ja
3 years agoExplorer | Level 3
Trying to get token to work or set expiration date to long time
I've copied the example code in SimpleTest and got access token working but expires after short time
I've just want very simple way to write and read files from my drop box programmatically. (and s...
Здравко
3 years agoLegendary | Level 20
kdss-ja wrote:...
Question will this AccessToken last for long time?
Hi kdss-ja,
If as long time, you mean 4 hours or so - Yes, otherwise - No. Doesn't matter how you gonna get your access token, it's always short lived.
Read with some more care Greg's comments above! The Dropbox client object can manage the access token refresh for you. To be possible, you need to pass the refresh token too (for use in the refresh process), otherwise once the passed access token expired exception gonna be thrown. More precise directions how you can construct client objects can be seen here (non PKCE) and here (PKCE). Note that parameters don't exclude the refresh token there, as you are doing. Actually the access token can be removed everywhere (if suitable).
Hope this sheds additional light.
kdss-ja
3 years agoExplorer | Level 3
Ok thanks I was just trying to follow the basic sample.
I would suggest you update the samples to make them work, reading the doco is confusing.
But this does work (again remove the other constructors or get them to throw appropriate exceptions)
new DropboxClient(AccessToken, RefreshToken, ApiKey, ApiSecret, config);
I'm only using drop box as simple way to share files between people (having trouble with the simple)
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!