Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
lazedo
9 years agoNew member | Level 2
why does /2/users/get_current_account endpoint require a post request
Hello, the /2/users/get_current_account seems a bit confusing in its usage. it requires "post" verb null as body content "application/json" as content-type afaik, null is not a valid json...
Greg-DB
Dropbox Community Moderator
9 years agolazedo Thanks for the feedback. Dropbox API v2 isn't considered a REST API and so doesn't use all of the concepts typical to one, such as use of the various different HTTP methods.
Instead, it can be considered more like an RPC API, where each API call is a sort of remote procedure call, with HTTPS used as a transport layer.
You can find more information on the design of API v2 on the blog:
https://blogs.dropbox.com/developers/2015/04/a-preview-of-the-new-dropbox-api-v2/
https://blogs.dropbox.com/developers/2015/04/how-many-http-status-codes-should-your-api-use/
For reference, "content-download" style endpoints do support the GET method though:
https://www.dropbox.com/developers/documentation/http/documentation#formats
Also, "null" is technically a valid JSON value, but for endpoints like /2/users/get_current_account, if there aren't any parameters to pass, you can actually just send an empty body instead, with no Content-Type header at all.
lazedo
9 years agoNew member | Level 2
Thanks for the reply.
i am aware that content-download support get verb (works great), that's why i was expecting a simpler way to get the information from get_current_account.
as for the "null", the content-length : 0 (or ommiting it andalso content-type) also works. the problem is that most http libraries expect to send something when using post, and we would prefer not to chage the behaviour of the libraries.
null is valid json value, not a valid json object
https://stackoverflow.com/questions/18419428/what-is-the-minimum-valid-json
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!