Request for comments: API 20150501

Re: Request for comments: API 20150501

Postby dcracauer » Sun Aug 02, 2015 7:12 am

Here's my take:

200
Any time the request succeeds. So, if, in the example above I ask which lineups are attached to my account, and there are none, you could send a 200 and an empty array. A REST purist may also argue that 404 could be appropriate since 'the resource doesn't exist'. I'd rather be pragmatic and just send the empty array.

400
Any time the client sends a request that is structurally or semantically incorrect. Bad syntax, bad data, etc.

401 vs 403
From what I've seen of this API, 401 should be sent if you need a token for a resource and haven't sent one, and 401 should probably never be sent. From what I've seen (and usually done) 401 means you need to authenticate, and 403 means you've authenticated, but can't do what you are asking to do. Since authorization with this API seems to be all or none, I wouldn't expect to see a 403.
dcracauer
 
Posts: 1
Joined: Sun Aug 02, 2015 6:06 am

Previous

Return to Developer

Who is online

Users browsing this forum: No registered users and 1 guest

cron