Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
hello,
my application runs non stop (daemon) and checks every 10 seconds if a file has changed (lastmodified)
the application works well, but after some time (1 - 2 days) the token seems to be invalidated.
i did not invalidate it, and no one else has access to do this.
if i renew the token, the application will run again for some time and then stop with this error.
i tried generating a token through the dropbox app console and through the web interface.
the issue happens in both cases.
according to the documentation the token should be valid for "years"
can anyone help on how to avoid the token being invalidated.
thanks
environment:
java 7
raspbian latest version
dropbox java sdk latest version.
app name: dbxvfs
OAuth 2 access tokens for the Dropbox API don't expire, as you said, but they can be revoked:
/disable_access_token
Do any of these apply to your app? E.g., check your code for disable_access_token
.
Also, you don't need to "renew" access tokens on the Dropbox API. Can you clarify what you mean by that?
hello,
thanks for your answer.
i think the issue was on my side.
i had 2 instances of the app running in parallel using 2 different tokens.
in addition the apps did not correctly store the tokens.
after resolving this it seems that the issue did not reoccur.
i think you can consider this as a non-issue.
by "renew" i mean is generate a new token through the app console.
hello,
it seems that this still happens.
I am now sure that my application works correctly.
at 15-04-14 08:25:19 (central european time) i created a new token through the app console "generate access token" function and restarted my application
at 15-04-14 20:22:49 the java sdk throws the following exception:
Caused by: {"error": "The given OAuth 2 access token doesn't exist or has expired."}
com.dropbox.core.DbxRequestUtil.unexpectedStatus(DbxRequestUtil.java:208)
com.dropbox.core.DbxClient$2.handle(DbxClient.java:186)
com.dropbox.core.DbxRequestUtil.doGet(DbxRequestUtil.java:242)
com.dropbox.core.DbxClient.doGet(DbxClient.java:1942)
com.dropbox.core.DbxClient.getMetadataWithChildrenBase(DbxClient.java:181)
com.dropbox.core.DbxClient.getMetadataWithChildren(DbxClient.java:148)
it seems that the token has been invalidated after 12 hours.
i am pretty sure that i did not invalidate it.
this is pretty annoying. because it makes the usage of dropbox for this kind of applications unpredictable.
Have you checked your code for disable_access_token
or disableAccessToken
though? (The latter is the method in the Java SDK that calls the /disable_access_token
endpoint.)
hello,
yes, there was a call to disableAccessToken.
the process is restarted approx every 2 hours.
at stop of the process this method was invoked.
however what wonders me is why the invocation of this method may disables the current token at random.
at times the token will be valid for 1-2 days although it is being disabled every 2 hours.
i have not removed all invocations to this method and will post again if this issue still remains.
thanks
-- Ron
ps: typo: i meant to write:
i have removed all invocations to this method and will post again if this issue still remains.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
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!