Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
yem a.
11 years agoNew member | Level 1
Best practices for using the core [http] api
I am using ruby ( and don't want to use the sdk) to access the core API and to authenticate the user. In that process it is said in the documentation that I should handle the API errors included directly in the body of the response. ("Errors are returned using standard HTTP error code syntax. Any additional info is included in the body of the return call, JSON-formatted.")
Can anyone guide to the proper way to access and extract that error code?
3 Replies
Replies have been turned off for this discussion
- Steve M.11 years ago
Dropbox Staff
The error code is just the HTTP status code. E.g., you might see a 400 status code if you submit a bad request.
If you're still having trouble figuring it out, please let us know what HTTP library you're using and share some code.
- yem a.11 years agoNew member | Level 1
I plan to use the Faraday gem for the calls to the API. But for the authorization process, I simply redirect the user to "www.dropbox.com/1/oauth2/authorize" using the "redirect_to". I have no other code yet since I am stuck trying to figure out how to access the response code when Dropbox redirects back to my app with the (authorization) code. I can see it in the terminal thanks to rake server but I am wondering how to access it in the code. Sounds silly, I know.
- Steve M.11 years ago
Dropbox Staff
It's hard to give much help here, since you haven't actually written the code yet to handle the redirect, but maybe this code will help get you started? https://github.com/smarx/othw/tree/master/Ruby
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!