Fake Rest API
Introduction
This is a Free and Online Fake REST API. You could use this API on your next blog post, If you need to test your REST client application which you’ve developed with any programming language or you have to check how modern REST API’s are working, how we should create Endpoints or anything that you need to do with REST API could accomplish using the following API which is already hosted and accessible via the internet for FREE.
For the moment we’ve deployed 9 different API endpoints with covering most of the HTTP methods in modern REST API including GET, POST, DELETE, PUT, PATCH. Additionally, This API is accessible with HTTPS too. All the endpoints have separate documentation below on this page, And you just need to copy the URL from Below table and send your request from anywhere you need.
Available Endpoints
Here is the list of Endpoints which available on this fake REST API.
Endpoint | HTTP Method | Description | Action |
---|---|---|---|
https://api.instantwebtools.net/v1/airlines | GET | Read all airlines details. | |
https://api.instantwebtools.net/v1/airlines | POST | Create airline data. | |
https://api.instantwebtools.net/v1/airlines/:id | GET | Read airline by airline ID. | |
https://api.instantwebtools.net/v1/passenger | POST | Create passenger using correct passenger data. | |
https://api.instantwebtools.net/v1/passenger/:id | GET | Read passenger by passenger ID. | |
https://api.instantwebtools.net/v1/passenger/:id | DELETE | Delete passenger by using passenger ID. | |
https://api.instantwebtools.net/v1/passenger/:id | PATCH | Update passenger name with correct passenger ID. | |
https://api.instantwebtools.net/v1/passenger/:id | PUT | Update every detail of a passenger. | |
https://api.instantwebtools.net/v1/passenger?page=0&size=10 | GET | Read all passengers. This endpoint supports pagination |
API Documentation
Here is the full documentation of the mentioned API endpoints above and how you can consume those endpoints. Just copy the endpoint URL and use it with the following guidelines. Basically, we’ve mentioned how you should call the API and what are the things you should add in the request and what are the responses you’re getting from API backend for the specific Request.
Read All Airlines
This endpoint reads all the airlines from DB and return those as a list.
GETResponse :
[
{
"_id":"252d3bca-d9bb-476c-9a97-562d685e235c",
"name":"Sri Lankan Airways",
"country":"Sri Lanka",
"logo":"https://upload.wikimedia.org/wikipedia/en/thumb/9/9b/Qatar_Airways_Logo.svg/sri_lanka.png",
"slogan":"From Sri Lanka",
"head_quaters":"Katunayake, Sri Lanka",
"website":"www.srilankaaairways.com",
"established":"1990"
}
]
Read Airline By ID
Read single airline data by airline id from database. This endpoint returns a single json object on request.
GETSample Response :
{
"_id":"252d3bca-d9bb-476c-9a97-562d685e235c",
"name": "Quatar Airways",
"country": "Quatar",
"logo": "https://upload.wikimedia.org/wikipedia/en/thumb/9/9b/Qatar_Airways_Logo.svg/300px-Qatar_Airways_Logo.svg.png",
"slogan": "Going Places Together",
"head_quaters": "Qatar Airways Towers, Doha, Qatar",
"website": "www.qatarairways.com",
"established": "1994"
}
Create Airline
Create airline with correct airline details. This could create airline data on the database and you can read the airline data when necessary.
POSTSample Request :
{
"_id":"252d3bca-d9bb-476c-9a97-562d685e235c",
"name": "Sri Lankan Airways",
"country": "Sri Lanka",
"logo": "https://upload.wikimedia.org/wikipedia/en/thumb/9/9b/Qatar_Airways_Logo.svg/sri_lanka.png",
"slogan": "From Sri Lanka",
"head_quaters": "Katunayake, Sri Lanka",
"website": "www.srilankaaairways.com",
"established": "1990"
}
Read Passenger Data - Pageable Endpoint
Read passenger data from more than 10000 passenger database. This endpoint supports pagination. You can get pageable response from this API endpoint.
GETSample Request :
{
"totalPassengers": 6,
"totalPages": 6,
"data": [
{
"_id": "5eef7f1bdfa515ddc9feade",
"name": "Saman Jeewantha",
"trips": 500,
"airline": [
{
"_id":"252d3bca-d9bb-476c-9a97-562d685e235c",
"name": "Emirates",
"country": "Dubai",
"logo": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d0/Emirates_logo.svg/150px-Emirates_logo.svg.png",
"slogan": "From Dubai to destinations around the world.",
"head_quaters": "Garhoud, Dubai, United Arab Emirates",
"website": "www.emirates.com/",
"established": "1985"
}
],
"__v": 0
}
]
}
Create Passenger Data
Create passenger data with correct passenger data. Here you need to include passenger name, number of trips and valid airline ID.
POSTSample Request :
{
"name": "John Doe",
"trips": 250,
"airline": 5
}
Read Passenger By Passenger ID
Read single passenger data by passenger ID. Here passenger ID is a string value which is generated by DB.
GETSample Response :
{
"_id": "5ef4a412aab3841847750ce8",
"name": "John Doe",
"trips": 250,
"airline": [
{
"_id":"252d3bca-d9bb-476c-9a97-562d685e235c",
"name": "Eva Air",
"country": "Taiwan",
"logo": "https://upload.wikimedia.org/wikipedia/en/thumb/e/ed/EVA_Air_logo.svg/250px-EVA_Air_logo.svg.png",
"slogan": "Sharing the World, Flying Together",
"head_quaters": "376, Hsin-Nan Rd., Sec. 1, Luzhu, Taoyuan City, Taiwan",
"website": "www.evaair.com",
"established": "1989"
}
],
"__v": 0
}
Delete Passenger
Delete single passenger data by passenger ID.
DELETESample Response :
{
"message": "Passenger data deleted successfully."
}
Update Passenger
Update passenger name by passenger ID. Here we only allow a user to update passenger name using this request. If you need to update the whole passenger, you should use the PUT method below.
PATCHSample Request :
{
"name": "John Doe"
}
Update whole Passenger
Update whole details of passenger. Here, same like the creation request, you should give correct name, number of trips and correct airline ID.
PUTSample Request :
{
"name": "John Doe",
"trips": 500,
"airline": 8
}
Fake REST API with Pagination
Do you need a Fake API that supports pagination? So here we have an endpoint that supports pagination. This API reads a dataset of more than 10000 rows of a dataset and returns a paginated response. Basically, you should introduce pageSize
and pageNumber
while you send the request to the API. Then API will return a response with an array of data, total number of items in the dataset, and total number of pages. Using those parameters you could easily configure pageable tables, views, lazy loadings, and many more where paginated responses should be used.
Fake REST API with HTTPS
Are you having an issue with communicating your mobile app with HTTPS enabled REST API? Do you need to validate your connection? Basically, do you need fake REST API which supports HTTPS? So our API is 100% supports for HTTPS and the certificate is validated through sslshopper as well. This HTTPS certificate was issue by letsencrypt, and all the necessary configurations have done from our side to use as SSL certified HTTPS-enabled Fake REST API.
When Data Getting Reset?
As of now, we are going to open this API to the world through the public internet. So people could use this API whenever they need wherever they need. So data will be junked and deleted by the time, So we are running the data reset process dynamically within a week’s time gap. Normally we run the scheduled process at 12.00 AM UTC. So if you are consuming this API while in the resetting process is running, you could face issues.