Skip to content

Instantly share code, notes, and snippets.

@nicodevs
Last active February 20, 2019 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nicodevs/f5128c85dbef5c6e68710be07c318862 to your computer and use it in GitHub Desktop.
Save nicodevs/f5128c85dbef5c6e68710be07c318862 to your computer and use it in GitHub Desktop.
{
"data": [
{
"id": 2,
"content": "My first post",
"user_id": 1,
"user": {
"id": 1,
"first_name": "John",
"last_name": "Doe",
"email": "user_826@example.com"
},
"items": [
{"id": 1, "text": "Lorem"},
{"id": 2, "text": "Ipsum"}
]
}
],
"links": {
"first": "http://api.forum.local/posts?page=1",
"last": "http://api.forum.local/posts?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"path": "http://api.forum.local/posts",
"per_page": 10,
"to": 1,
"total": 1
}
}
{
"data": {
"content": "My first post",
"id": 2,
"user": {
"email": "user_826@example.com",
"first_name": "John",
"id": 1,
"last_name": "Doe"
},
"user_id": 1
}
}
{
"error": {
"code": "ERR-FORBIDDEN",
"http_code": 403,
"message": "Unauthorized. Do you have the right to do this?"
}
}
{
"error": {
"code": "ERR-WRONGARGS",
"http_code": 400,
"message": "The given data was invalid."
},
"errors": {
"first_name": [
"The first name field is required."
],
"password": [
"The password field is required."
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment