{
"errors": [
"id": "UUID",
"status": "418",
"code": "42",
"title": "You're a teapot",
"detail": "The object is not short nor stout",
"links": {
"about": "https://httpstatuses.com/418"
},
"meta": {
"email": "[email protected]"
}
]
}
Slide 25
Slide 25 text
GET /articles
Accept: application/vnd.api+json
GET /articles/1
Accept: application/vnd.api+json
GET /articles/1/author
Accept: application/vnd.api+json
Slide 26
Slide 26 text
#Request comments with an article
GET /articles/1?include=comments
Accept: application/vnd.api+json
#Request comments as well as the author of each of those comments
GET /articles/1?include=comments.author
Accept: application/vnd.api+json
Slide 27
Slide 27 text
GET /articles?include=comments,author
&fields[people]=first-name,last-name
&sort=-date
» fetch all articles with their associated comments and authors
» Only be return the first and last names
» Sorted by date, most recent first