cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

why does /2/users/get_current_account endpoint require a post request

why does /2/users/get_current_account endpoint require a post request

lazedo
New member | Level 2

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

 

2 Replies 2

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.

lazedo
New 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

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    lazedo New member | Level 2
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?