One month down in 2025: How are your resolutions coming along? Check out how to get back on track here.
Forum Discussion
lazedo
8 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 content, but the api server accepts nothing but that value in conjuction with content-type.
a get operation here seems more adequate and in line with other oauth providers, since there's no information the client needs to provide to the server besides the authorization.
can you take this in consideration and implement the get operation on this endpoint ?
Thank You
- Greg-DB
Dropbox Staff
lazedo 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.
- lazedoNew 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.5,941 PostsLatest Activity: 6 days ago
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 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!