If the backend is about to run on a different host/port than the frontend, make sure to handle OPTIONS too and return correct Access-Control-Allow-Origin and Access-Control-Allow-Headers (e.g. Content-Type).
Authentication Header:
Authorization: Token jwt.token.here
JSON Objects returned by API:
Make sure the right content type like Content-Type: application/json; charset=utf-8 is correctly returned.
Users (for authentication)
{
"user": {
"email": "jake@jake.jake",
"token": "jwt.token.here",
"username": "jake",
"bio": "I work at statefarm",
"image": null
}
}
Profile
Single Article
Multiple Articles
Single Comment
Multiple Comments
List of Tags
Errors and Status Codes
If a request fails any validations, expect a 422 and errors in the following format:
Other status codes:
401 for Unauthorized requests, when a request requires authentication but it isn't provided
403 for Forbidden requests, when a request may be valid but the user doesn't have permissions to perform the action
404 for Not found requests, when a resource can't be found to fulfill the request