Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
Cory A.
10 years agoNew member | Level 1
Using previously acquired OAuth2 token with the Java SDK
I'm trying to get a list of folders in a users account to present as a list of choices to upload a photo to. I already have a manually built OAuth2 flow working to allow a user to link their Dropbox...
Cory A.
10 years agoNew member | Level 1
Like I said, I can successfully make calls through HTTP calls to the REST API, so that rules out the token being altered. I have not used the disable_access_token endpoint. The Dropbox account I am testing with is my own, and I have not revoked access.
As I mentioned, I registered my app to be able to access any folder, not just the self-named one under /Apps/Piquero. However, just in case that was the issue, I tried both / and /AppsPiquero as arguments to DbxClient.getMetaWithChildren(). However the exception with the message mentioned above happens in both cases.
In the browser I click on a URL that has been mapped to a servlet in a Java webapp. That servlet does a bunch of data gathering and then uses HttpRequest.getRequestDispatcher() to forward the request onto a JSP. It uses the data to spit out the HTML for the browser in the usual MVC fashion.
The Dropbox Java SDK call which produces the exception happens in the servlet. Milliseconds later in the JSP, a call to https://api.dropbox.com/1/account/info using the same stored access token succeeds.
I can even do
wget -O file.out -dvcS --header="Authorization: Bearer $TOKEN$" " https://api.dropbox.com/1/metadata/auto"
on the command line with the same token gotten by shell access from the database it is stored in and get back an HTTP 200 response with the expected JSON data.
I have yet to rewrite the method using HTTP calls
I am confident that I have ruled out accidental token alteration in that the only wait it fails, ever, is when being used with the Dropbox Java SDK while concurrently being successfully used to make HTTP REST API calls.
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!