You can use the API online from the link,
https://fake-rest-api-deploy.herokuapp.com/
Welcome to the FakeRestAPI where you can find fake attributes about users. This documentation should help you familiarise yourself with the resources available and how to consume them with HTTP requests.
Let's make your first API request to the FakeRestAPI!
I'll be using postman for examples as it displays responses nicely and gives us a whole lot more useful information.
Base URL : https://fake-rest-api-deploy.herokuapp.com/
The Base URL is the root URL for all of the API, if you ever make a request to FakeRestAPI and you get back a 404 NOT FOUND response then check the Base URL first.
This API let's you do all Create, Read, Update, Delete operations on USERS.
Attributes:
full_name
string -- The name and surname of a user.country
string -- The country where the user is from.created_at
date -- Full date of the time when the user's account is created.id
string -- Unique id of that user.email
string -- The email adress of that user.
-
POST a single user with the URL:
https://fake-rest-api-deploy.herokuapp.com/users
With the body:
{ "full_name" : "Atakan Yontar", "country" : "Turkey", "email" : "atakanyontar@gmail.com" }
Example response:
{ "id": 1646155611621, "full_name": "Atakan Yontar", "country": "Turkey", "email": "atakanyontar@gmail.com", "created_at": "2022-03-01T17:26:51.621Z" }
HTTP status: 200 OK
-
GET all of the users with to the URL:
https://fake-rest-api-deploy.herokuapp.com/users/
Example response:
{ "full_name": "Luisa Koelpin", "country": "Austria", "created_at": "2012-12-27T18:51:33.419Z", "id": 0, "email": "Lauriane_Dickens@derrick.us" ... with the rest of the users }
HTTP status: 200 OK
GET the infomation of user with id:0 using the URL:
https://fake-rest-api-deploy.herokuapp.com/users/0
after users/, 0 can be any number and FakeRestAPI will tell you if such user exists or not.
Example response:
{ "full_name": "Luisa Koelpin", "country": "Austria", "created_at": "2012-12-27T18:51:33.419Z", "id": 0, "email": "Lauriane_Dickens@derrick.us" }
HTTP status: 200 OK
-
Change the full_name & country of user 3 with the URL:
https://fake-rest-api-deploy.herokuapp.com/users/3
With the body:
{ "full_name": "Atakan Yontar", "country": "Turkey" }
Example response
{ "full_name": "Atakan Yontar", "country": "Turkey", "created_at": "1996-02-27T17:42:21.329Z", "id": 10, "email": "Freddie@taylor.com" }
HTTP status: 200 OK
-
Delete the user 3 with the URL:
https://fake-rest-api-deploy.herokuapp.com/users/3
Example response:
{ "message": "User is deleted!" }
HTTP status: 200 OK