All responses will have the form
{
"message": "Descriptions of what happened",
"data": "Mixed type holding the content of the response"
}
GET /users
Response
200 OK
on success
[
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "Sincere@april.biz",
"phone": "1-770-736-8031 x56442",
"website": "hildegard.org"
},
{
"id": 2,
"name": "Ervin Howell",
"username": "Antonette",
"email": "Shanna@melissa.tv",
"phone": "010-692-6593 x09125",
"website": "anastasia.net"
}
]
GET /users
Params
id
- int
Response
404 Not Found
if the user does not exist200 OK
on success
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "Sincere@april.biz",
"phone": "1-770-736-8031 x56442",
"website": "hildegard.org"
}
Definition
DELETE /users
Params
id
- int
Response
404 Not Found
if the user does not exist204 No Data
- delete all user's posts
Definition
PUT /users/<int:id>
Arguments
JSON
"name":string
"username":string
"email":string
"phone":string
"website":string
Response
204 No Data
on success
Definition
PATCH /users/<int:id>
Arguments
JSON
"name":string
"username":string
"email":string
"phone":string
"website":string
Response
200 OK
on success
GET /posts
Response
200 OK
on success
[
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
},
{
"userId": 1,
"id": 2,
"title": "qui est esse",
"body": "est rerum tempore vitae\nsequi sint nihil reprehenderit dolor beatae ea dolores neque\nfugiat blanditiis voluptate porro vel nihil molestiae ut reiciendis\nqui aperiam non debitis possimus qui neque nisi nulla"
}
]
Definition
POST /posts
Arguments
JSON
"userId":int
"title":string
"body":string
Response
201 Created
on success
GET /posts
Params
id
- int
Response
404 Not Found
if the post does not exist200 OK
on success
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati excepturi optio reprehenderit",
"body": "quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto"
}
Definition
DELETE /posts
Params
id
- int
Response
404 Not Found
if the post does not exist204 No Data
Definition
PUT /posts/<int:id>
Arguments
JSON
"userId":int
"title":string
"body":string
Response
204 No Data
on success
Definition
PATCH /posts/<int:id>
Arguments
JSON
"userId":int
"title":string
"body":string
Response
200 OK
on success
Definition
GET /users/<int:userId>/posts
Response
200 OK
on success
{
"id": 11,
"userId": 2,
"title": "et ea vero quia laudantium autem",
"body": "delectus reiciendis molestiae occaecati non minima eveniet qui voluptatibus\naccusamus in eum beatae sit\nvel qui neque voluptates ut commodi qui incidunt\nut animi commodi"
},
{
"id": 12,
"userId": 2,
"title": "in quibusdam tempore odit est dolorem",
"body": "itaque id aut magnam\npraesentium quia et ea odit et ea voluptas et\nsapiente quia nihil amet occaecati quia id voluptatem\nincidunt ea est distinctio odio"
}
Definition
DELETE /users/<int:userId>/posts
Response
404 Not Found
if the post does not exist204 No Data
GET /posts/<int:id>/user
Response
404 Not Found
if the user does not exist200 OK
on success
{
"id": 1,
"name": "Leanne Graham",
"username": "Bret",
"email": "Sincere@april.biz",
"phone": "1-770-736-8031 x56442",
"website": "hildegard.org"
}