1.1 KiB
1.1 KiB
title |
---|
RESTful API |
Status codes
200 OK
- successful get, patch (return a JSON object)201 Created
- successful post (return a JSON object)202 Accepted
- successful post, delete, path - async204 No content
- successful delete206 Partial content
- successful get - async
Error status
401 Unauthorized
- not authenticated403 Forbidden
- authenticated but no permissions422 Unprocessable entity
- validation
Errors
HTTP/1.1 401 Unauthorized
{
'id': 'auth_failed',
'message': "You're not logged in."
}
Versioning (info)
GET /api/foo
Accept: application/json; version=1
Authentication
curl -is https://$TOKEN@api.service.com/
Methods
GET /articles/1
- read, returns 200PUT /articles/1
- edit (or path), returns 200DELETE /articles/1
- delete, returns 200POST /articles
- create, returns 201GET /articles
- list, returns 200