Introduction
Example project cloning booking.com built with Laravel as part of Course in LaravelDaily.com
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
To authenticate requests, include a X-XSRF-TOKEN
header with the value "{YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your token by making a request to /sanctum/csrf-cookie
Authentication
Register a new user.
[Creates a new user and returns a token for authentication.]
Example request:
curl --request POST \
"http://booking-com-simulation-laravel.test/api/auth/register" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"vjsoxgflpadkawiltji\",
\"email\": \"muller.tristin@example.com\",
\"password\": \"ullam\",
\"role_id\": \"aperiam\"
}"
const url = new URL(
"http://booking-com-simulation-laravel.test/api/auth/register"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "vjsoxgflpadkawiltji",
"email": "muller.tristin@example.com",
"password": "ullam",
"role_id": "aperiam"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'http://booking-com-simulation-laravel.test/api/auth/register',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'vjsoxgflpadkawiltji',
'email' => 'muller.tristin@example.com',
'password' => 'ullam',
'role_id' => 'aperiam',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"access_token": "1|a9ZcYzIrLURVGx6Xe41HKj1CrNsxRxe4pLA2oISo"
}
Example response (422):
{
"message": "The selected role id is invalid.",
"errors": {
"role_id": [
"The selected role id is invalid."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Owner
Property management
Properties list - **INCOMPLETE**
requires authentication
[List of owners properties]
Example request:
curl --request GET \
--get "http://booking-com-simulation-laravel.test/api/owner/properties" \
--header "X-XSRF-TOKEN: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://booking-com-simulation-laravel.test/api/owner/properties"
);
const headers = {
"X-XSRF-TOKEN": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'http://booking-com-simulation-laravel.test/api/owner/properties',
[
'headers' => [
'X-XSRF-TOKEN' => '{YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"success": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Store property
requires authentication
[Stores new property of the owner]
Example request:
curl --request POST \
"http://booking-com-simulation-laravel.test/api/owner/properties" \
--header "X-XSRF-TOKEN: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"iure\",
\"city_id\": \"neque\",
\"address_street\": \"molestiae\",
\"address_postcode\": \"aut\"
}"
const url = new URL(
"http://booking-com-simulation-laravel.test/api/owner/properties"
);
const headers = {
"X-XSRF-TOKEN": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "iure",
"city_id": "neque",
"address_street": "molestiae",
"address_postcode": "aut"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'http://booking-com-simulation-laravel.test/api/owner/properties',
[
'headers' => [
'X-XSRF-TOKEN' => '{YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'iure',
'city_id' => 'neque',
'address_street' => 'molestiae',
'address_postcode' => 'aut',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"name": "My property",
"city_id": 1,
"address_street": "Street Address 1",
"address_postcode": "12345",
"owner_id": 2,
"updated_at": "2023-05-10T07:07:45.000000Z",
"created_at": "2023-05-10T07:07:45.000000Z",
"id": 1,
"city": {
"id": 1,
"country_id": 1,
"name": "New York",
"lat": "40.7127760",
"long": "-74.0059740",
"created_at": "2023-05-10T07:07:45.000000Z",
"updated_at": "2023-05-10T07:07:45.000000Z",
"country": {
"id": 1,
"name": "United States",
"lat": "37.0902400",
"long": "-95.7128910",
"created_at": "2023-05-10T07:07:45.000000Z",
"updated_at": "2023-05-10T07:07:45.000000Z"
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Property photo management
Add a photo to a property
requires authentication
[Adds a photo to a property and returns the filename, thumbnail and position of the photo]
Example request:
curl --request POST \
"http://booking-com-simulation-laravel.test/api/owner/properties/10/photos" \
--header "X-XSRF-TOKEN: {YOUR_AUTH_KEY}" \
--header "Content-Type: multipart/form-data" \
--header "Accept: application/json" \
--form "photo=@/private/var/folders/87/191b_my96m7c_w2ljxt2zv_w0000gn/T/php37SoSR"
const url = new URL(
"http://booking-com-simulation-laravel.test/api/owner/properties/10/photos"
);
const headers = {
"X-XSRF-TOKEN": "{YOUR_AUTH_KEY}",
"Content-Type": "multipart/form-data",
"Accept": "application/json",
};
const body = new FormData();
body.append('photo', document.querySelector('input[name="photo"]').files[0]);
fetch(url, {
method: "POST",
headers,
body,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'http://booking-com-simulation-laravel.test/api/owner/properties/10/photos',
[
'headers' => [
'X-XSRF-TOKEN' => '{YOUR_AUTH_KEY}',
'Content-Type' => 'multipart/form-data',
'Accept' => 'application/json',
],
'multipart' => [
[
'name' => 'photo',
'contents' => fopen('/private/var/folders/87/191b_my96m7c_w2ljxt2zv_w0000gn/T/php37SoSR', 'r')
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"filename": "http://localhost:8000/storage/properties/1/photos/1/IMG_20190601_123456.jpg",
"thumbnail": "http://localhost:8000/storage/properties/1/photos/1/conversions/thumbnail.jpg",
"position": 1
}
Example response (422):
{
"message": "The photo must be an image.",
"errors": {
"photo": [
"The photo must be an image."
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Reorder photos of a property
requires authentication
[Reorders photos of a property and returns the new position of the photo]
Example request:
curl --request POST \
"http://booking-com-simulation-laravel.test/api/owner/properties/9/photos/2/reorder/2" \
--header "X-XSRF-TOKEN: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://booking-com-simulation-laravel.test/api/owner/properties/9/photos/2/reorder/2"
);
const headers = {
"X-XSRF-TOKEN": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'http://booking-com-simulation-laravel.test/api/owner/properties/9/photos/2/reorder/2',
[
'headers' => [
'X-XSRF-TOKEN' => '{YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"newPosition": 2
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Public
Property search
Search properties
[Returns a list of filtered properties]
Example request:
curl --request GET \
--get "http://booking-com-simulation-laravel.test/api/search?city=1&country=4&geoobject=1&adults=2&children=1&facilities[]=1&facilities[]=2&facilities[]=3&price_from=100&price_to=200&start_date=2024-01-01&end_date=2024-01-03" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://booking-com-simulation-laravel.test/api/search"
);
const params = {
"city": "1",
"country": "4",
"geoobject": "1",
"adults": "2",
"children": "1",
"facilities[0]": "1",
"facilities[1]": "2",
"facilities[2]": "3",
"price_from": "100",
"price_to": "200",
"start_date": "2024-01-01",
"end_date": "2024-01-03",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'http://booking-com-simulation-laravel.test/api/search',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'city' => '1',
'country' => '4',
'geoobject' => '1',
'adults' => '2',
'children' => '1',
'facilities[0]' => '1',
'facilities[1]' => '2',
'facilities[2]' => '3',
'price_from' => '100',
'price_to' => '200',
'start_date' => '2024-01-01',
'end_date' => '2024-01-03',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"properties": {
"data": [
{
"id": 2,
"name": "Qui velit ea.",
"address": "2392 Zemlak Port Suite 655, 16225-4383, New York",
"lat": "-54.8191470",
"long": "-70.2183380",
"apartments": [
{
"name": "Mid size apartment",
"type": null,
"size": null,
"beds_list": "",
"bathrooms": 0,
"price": 0
}
],
"photos": [],
"avg_rating": 8
},
{
"id": 1,
"name": "Provident enim est.",
"address": "1487 Ignacio Alley Suite 794, 74215, New York",
"lat": "13.2359740",
"long": "-74.2809120",
"apartments": [
{
"name": "Cheap apartment",
"type": null,
"size": null,
"beds_list": "",
"bathrooms": 0,
"price": 0
}
],
"photos": [],
"avg_rating": 7
}
],
"links": {
"first": "http://booking-com-simulation-laravel.test/api/search?city=1&adults=2&children=1&page=1",
"last": "http://booking-com-simulation-laravel.test/api/search?city=1&adults=2&children=1&page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://booking-com-simulation-laravel.test/api/search?city=1&adults=2&children=1&page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://booking-com-simulation-laravel.test/api/search",
"per_page": 10,
"to": 2,
"total": 2
}
},
"facilities": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Property
Property details
[Returns details of a property]
Example request:
curl --request GET \
--get "http://booking-com-simulation-laravel.test/api/properties/3" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://booking-com-simulation-laravel.test/api/properties/3"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'http://booking-com-simulation-laravel.test/api/properties/3',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"properties": {
"data": [
{
"id": 1,
"name": "Aspernatur nostrum.",
"address": "5716 Leann Point, 24974-6081, New York",
"lat": "8.8008940",
"long": "-82.9095500",
"apartments": [
{
"name": "Mid size apartment",
"type": null,
"size": null,
"beds_list": "",
"bathrooms": 0,
"price": 0
}
],
"photos": [],
"avg_rating": null
}
],
"links": {
"first": "http://booking-com-simulation-laravel.test/api/search?city=1&adults=2&children=1&page=1",
"last": "http://booking-com-simulation-laravel.test/api/search?city=1&adults=2&children=1&page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://booking-com-simulation-laravel.test/api/search?city=1&adults=2&children=1&page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"path": "http://booking-com-simulation-laravel.test/api/search",
"per_page": 10,
"to": 1,
"total": 1
}
},
"facilities": []
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Apartments
Get apartment details
[Returns details about a specific apartment]
Example request:
curl --request GET \
--get "http://booking-com-simulation-laravel.test/api/apartments/16" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://booking-com-simulation-laravel.test/api/apartments/16"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'http://booking-com-simulation-laravel.test/api/apartments/16',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"name": "Large apartment",
"type": null,
"size": null,
"beds_list": "",
"bathrooms": 0,
"facility_categories": {
"First category": [
"First facility",
"Second facility"
],
"Second category": [
"Third facility"
]
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
User
Bookings
List of user bookings
requires authentication
[Returns preview list of all user bookings]
Example request:
curl --request GET \
--get "http://booking-com-simulation-laravel.test/api/user/bookings" \
--header "X-XSRF-TOKEN: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://booking-com-simulation-laravel.test/api/user/bookings"
);
const headers = {
"X-XSRF-TOKEN": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'http://booking-com-simulation-laravel.test/api/user/bookings',
[
'headers' => [
'X-XSRF-TOKEN' => '{YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"id": 1,
"apartment_name": "Fugiat saepe sed.: Apartment",
"start_date": "2023-05-11",
"end_date": "2023-05-12",
"guests_adults": 1,
"guests_children": 0,
"total_price": 0,
"cancelled_at": null,
"rating": null,
"review_comment": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create new booking
requires authentication
[Creates new booking for authenticated user]
Example request:
curl --request POST \
"http://booking-com-simulation-laravel.test/api/user/bookings" \
--header "X-XSRF-TOKEN: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"apartment_id\": \"sunt\",
\"start_date\": \"2023-05-10T11:51:53\",
\"end_date\": \"2023-05-10T11:51:53\",
\"guests_adults\": 5,
\"guests_children\": 7
}"
const url = new URL(
"http://booking-com-simulation-laravel.test/api/user/bookings"
);
const headers = {
"X-XSRF-TOKEN": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"apartment_id": "sunt",
"start_date": "2023-05-10T11:51:53",
"end_date": "2023-05-10T11:51:53",
"guests_adults": 5,
"guests_children": 7
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'http://booking-com-simulation-laravel.test/api/user/bookings',
[
'headers' => [
'X-XSRF-TOKEN' => '{YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'apartment_id' => 'sunt',
'start_date' => '2023-05-10T11:51:53',
'end_date' => '2023-05-10T11:51:53',
'guests_adults' => 5,
'guests_children' => 7,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (201):
{
"id": 1,
"apartment_name": "Hic consequatur qui.: Apartment",
"start_date": "2023-05-11 08:00:51",
"end_date": "2023-05-12 08:00:51",
"guests_adults": 2,
"guests_children": 1,
"total_price": 0,
"cancelled_at": null,
"rating": null,
"review_comment": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
View booking
requires authentication
[Returns details about a booking]
Example request:
curl --request GET \
--get "http://booking-com-simulation-laravel.test/api/user/bookings/8" \
--header "X-XSRF-TOKEN: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://booking-com-simulation-laravel.test/api/user/bookings/8"
);
const headers = {
"X-XSRF-TOKEN": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'http://booking-com-simulation-laravel.test/api/user/bookings/8',
[
'headers' => [
'X-XSRF-TOKEN' => '{YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"id": 1,
"apartment_name": "Hic consequatur qui.: Apartment",
"start_date": "2023-05-11 08:00:51",
"end_date": "2023-05-12 08:00:51",
"guests_adults": 2,
"guests_children": 1,
"total_price": 0,
"cancelled_at": null,
"rating": null,
"review_comment": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update existing booking rating
requires authentication
[Updates booking with new details]
Example request:
curl --request PUT \
"http://booking-com-simulation-laravel.test/api/user/bookings/16" \
--header "X-XSRF-TOKEN: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"rating\": 1,
\"review_comment\": \"ssccvjhgbcmqkhmkpfqnbsqgprxyglhjrezjtayzubihntqqaqcetyntvvrnbytty\"
}"
const url = new URL(
"http://booking-com-simulation-laravel.test/api/user/bookings/16"
);
const headers = {
"X-XSRF-TOKEN": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"rating": 1,
"review_comment": "ssccvjhgbcmqkhmkpfqnbsqgprxyglhjrezjtayzubihntqqaqcetyntvvrnbytty"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
'http://booking-com-simulation-laravel.test/api/user/bookings/16',
[
'headers' => [
'X-XSRF-TOKEN' => '{YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'rating' => 1,
'review_comment' => 'ssccvjhgbcmqkhmkpfqnbsqgprxyglhjrezjtayzubihntqqaqcetyntvvrnbytty',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{
"id": 1,
"apartment_name": "Hic consequatur qui.: Apartment",
"start_date": "2023-05-11 08:00:51",
"end_date": "2023-05-12 08:00:51",
"guests_adults": 2,
"guests_children": 1,
"total_price": 0,
"cancelled_at": null,
"rating": null,
"review_comment": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete booking
requires authentication
[Deletes a booking]
Example request:
curl --request DELETE \
"http://booking-com-simulation-laravel.test/api/user/bookings/9" \
--header "X-XSRF-TOKEN: {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"http://booking-com-simulation-laravel.test/api/user/bookings/9"
);
const headers = {
"X-XSRF-TOKEN": "{YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->delete(
'http://booking-com-simulation-laravel.test/api/user/bookings/9',
[
'headers' => [
'X-XSRF-TOKEN' => '{YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
Example response (200):
{}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.