Online REST API for Testing and Prototyping

data | real responses | 24/7 online

Trying it Out

POST /public-api/usersCreate a new user
GET /public-api/users/123Get user details
PATCH /public-api/users/123Update user details
PUT /public-api/users/123Update user details
DELETE /public-api/users/123Delete user
OPTIONS /public-api/usersPreflight request
HEAD /public-api/usersHeaders only

Nested Resources

GET /public-api/users/123/postsRetrieves user posts
GET /public-api/posts/123/commentsRetrieves post comments
GET /public-api/users/123/todosRetrieves user todos
POST /public-api/users/123/postsCreates a user post
POST /public-api/posts/123/commentsCreates a post comment
POST /public-api/users/123/todosCreates a user todo

Features

Authentication

Unlike Web applications, RESTful APIs are usually stateless, which means sessions or cookies should not be used. Therefore, each request should come with some sort of authentication credentials. A common practice is to send a secret access token with each request to authenticate the user. Since an access token can be used to uniquely identify and authenticate a user, API requests should always be sent via HTTPS to prevent man-in-the-middle (MitM) attacks.

There are different ways to send an access token:

cUrl Examples

1. List users
curl -i -H "Accept:application/json" -H "Content-Type:application/json" -XGET "https://gorest.co.in/public-api/users"
2. Create user
curl -i -H "Accept:application/json" -H "Content-Type:application/json" -H "Authorization: Bearer ACCESS-TOKEN" -XPOST "https://gorest.co.in/public-api/users" -d '{"name":"Tenali Ramakrishna", "gender":"Male", "email":"tenali.ramakrishna@15ce.com", "status":"Active"}'
3. Update user
curl -i -H "Accept:application/json" -H "Content-Type:application/json" -H "Authorization: Bearer ACCESS-TOKEN" -XPATCH "https://gorest.co.in/public-api/users/123" -d '{"name":"Allasani Peddana", "email":"allasani.peddana@15ce.com", "status":"Active"}'
4. Delete user
curl -i -H "Accept:application/json" -H "Content-Type:application/json" -H "Authorization: Bearer ACCESS-TOKEN" -XDELETE "https://gorest.co.in/public-api/users/123"

Http Response Codes Summary