Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
tsumit g.
9 years agoHelpful | Level 6
V2 API - error message format
Hello! I'm trying to make requests to V2 API with incorrect details and I'm getting error messages of the following format. Also, added the CURL requests made to trigger the errors.
Please conf...
- 9 years ago
Yes, all of the cases you shared result in a 400, as they don't follow the specification.
If you try a request with a token that might be valid, that is, it matches the expected pattern, but has been revoked, for example, you will get a 401:
$ curl -vX POST https://api.dropboxapi.com/2/users/get_current_account \ > --header "Authorization: Bearer Zu9U1XOZl8QAAAAAAANVDUuVaEzgdX8UMaDoKneBbU-SCqZdaYwBTtWqY6103uGZ" > POST /2/users/get_current_account HTTP/1.1 > Host: api.dropboxapi.com > User-Agent: curl/7.42.1 > Accept: */* > Authorization: Bearer Zu9U1XOZl8QAAAAAAANVDUuVaEzgdX8UMaDoKneBbU-SCqZdaYwBTtWqY6103uGZ < HTTP/1.1 401 Unauthorized < Server: nginx < Date: Tue, 24 Jan 2017 18:30:51 GMT < Content-Type: application/json < Content-Length: 87 < Connection: keep-alive < User-Agent: < Www-Authenticate: Dropbox-API < X-Dropbox-Request-Id: 8fdb89aaffd147eb489fa61ec0a5058a < * Connection #0 to host api.dropboxapi.com left intact {"error_summary": "invalid_access_token/..", "error": {".tag": "invalid_access_token"}}The other codes that are used for other scenarios are documented here:
https://www.dropbox.com/developers/documentation/http/documentation#error-handling
Greg-DB
Dropbox Community Moderator
9 years agoYes, all of the cases you shared result in a 400, as they don't follow the specification.
If you try a request with a token that might be valid, that is, it matches the expected pattern, but has been revoked, for example, you will get a 401:
$ curl -vX POST https://api.dropboxapi.com/2/users/get_current_account \
> --header "Authorization: Bearer Zu9U1XOZl8QAAAAAAANVDUuVaEzgdX8UMaDoKneBbU-SCqZdaYwBTtWqY6103uGZ"
> POST /2/users/get_current_account HTTP/1.1
> Host: api.dropboxapi.com
> User-Agent: curl/7.42.1
> Accept: */*
> Authorization: Bearer Zu9U1XOZl8QAAAAAAANVDUuVaEzgdX8UMaDoKneBbU-SCqZdaYwBTtWqY6103uGZ
< HTTP/1.1 401 Unauthorized
< Server: nginx
< Date: Tue, 24 Jan 2017 18:30:51 GMT
< Content-Type: application/json
< Content-Length: 87
< Connection: keep-alive
< User-Agent:
< Www-Authenticate: Dropbox-API
< X-Dropbox-Request-Id: 8fdb89aaffd147eb489fa61ec0a5058a
<
* Connection #0 to host api.dropboxapi.com left intact
{"error_summary": "invalid_access_token/..", "error": {".tag": "invalid_access_token"}}
The other codes that are used for other scenarios are documented here:
https://www.dropbox.com/developers/documentation/http/documentation#error-handling
tsumit g.
9 years agoHelpful | Level 6
Thanks Greg, you're right. But I still feel it shouldn't matter how the token is or what form it is. If the authorization has failed due to any reason, throw a 401 status. At the end of the day, the user is deemed to be unauthorized to access the resource.
However, the response payload could be elaborate and say what exactly failed or was missing. Let me know if this is acceptable.
However, the response payload could be elaborate and say what exactly failed or was missing. Let me know if this is acceptable.
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!