Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FORMAT: 1A
- HOST: https://reqres.in/api
- # REST API - Prenos Dรกt
- Polls is a simple API allowing consumers to view polls and vote in them.
- ## GET [/users?page={id}]
- ### LIST USERS [GET]
- + Parameters
- + id (optional, number, `2`) ... Page ID
- + Response 200 (application/json)
- {
- "page": 2,
- "per_page": 3,
- "total": 12,
- "total_pages": 4,
- "data": [
- {
- "id": 4,
- "first_name": "Eve",
- "last_name": "Holt",
- "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/marcoramires/128.jpg"
- },
- {
- "id": 5,
- "first_name": "Charles",
- "last_name": "Morris",
- "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/stephenmoon/128.jpg"
- },
- {
- "id": 6,
- "first_name": "Tracey",
- "last_name": "Ramos",
- "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/bigmancho/128.jpg"
- }
- ## GET [/users/{id}]
- ### SINGLE USER [GET]
- + Parameters
- + id (required, number, `2`) ... Page ID
- + Response 200 (application/json)
- {
- "data": {
- "id": 2,
- "first_name": "Janet",
- "last_name": "Weaver",
- "avatar": "https://s3.amazonaws.com/uifaces/faces/twitter/josephstein/128.jpg"
- }
- }
- ## GET [/users/23]
- ### SINGLE USER NOT FOUND [GET]
- + Response 404 (application/json)
- {
- }
- ## GET [/{unknown}]
- ### LIST <RESOURCE> [GET]
- + Parameters
- + unknown (optional, string, `unknown`)
- + Response 200 (application/json)
- {
- "page": 1,
- "per_page": 3,
- "total": 12,
- "total_pages": 4,
- "data": [
- {
- "id": 1,
- "name": "cerulean",
- "year": 2000,
- "color": "#98B2D1",
- "pantone_value": "15-4020"
- },
- {
- "id": 2,
- "name": "fuchsia rose",
- "year": 2001,
- "color": "#C74375",
- "pantone_value": "17-2031"
- },
- {
- "id": 3,
- "name": "true red",
- "year": 2002,
- "color": "#BF1932",
- "pantone_value": "19-1664"
- }
- ]
- }
- ## GET [/{unknown}/{id}]
- ### SINGLE <RESOURCE> [GET]
- + Parameters
- + unknown (required, string, `unknown`)
- + id (required, number, `2`)
- + Response 200 (application/json)
- {
- "data": {
- "id": 2,
- "name": "fuchsia rose",
- "year": 2001,
- "color": "#C74375",
- "pantone_value": "17-2031"
- }
- }
- ## GET [/{unknown}/23]
- ### SINGLE <RESOURCE> NOT FOUND [GET]
- + Parameters
- + unknown (required, string, `unknown`)
- + Response 404 (application/json)
- {
- }
- ## POST [/users]
- ### CREATE [POST]
- + Request (application/json)
- {
- "name": "morpheus",
- "job": "leader"
- }
- + Response 201 (application/json)
- + Body
- {
- "name": "morpheus",
- "job": "leader",
- "id": "226",
- "createdAt": "2018-03-21T13:38:44.772Z"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement