Get a list of Product
GEThttps://dishes-rest-3132f998e75a.herokuapp.com/products/[product-id]
Security
This api use API KEY as an authentication method.
- Name: x-api-key
- In: header
Request Parameters
| Name | Located in | Description | Required | Type |
|---|---|---|---|---|
| [product-id] | URL | ID of Product | Required | string |
Response
| Code | Type |
|---|---|
200 | Return a product details |
401 | Unauthorized. |
404 | Not found |
Example Usage
var headers = new Headers();
headers.append("x-api-key", "API_KEY");
var requestOptions = {
method: "GET",
headers: headers,
redirect: "follow",
};
fetch("https://dishes-rest-3132f998e75a.herokuapp.com/product/123", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.log("error", error));Example Success Response
{
"_id": "6580411187aade9854246759",
"name": "Acharuli Khachapuri",
"subName": "Acharuli Khachapuri, Acharuli, Khachapuri, აჭარული ხაჭაპური, აჭარილი, ხაჭაპური",
"description": "Acharuli Khachapuri description",
"rate": 4.5,
"time": "45min"
}Example Error Response
{
"message": "Unauthorized, invalid request"
}Example Not Found Response
{
"message": "There is no such dish in our kitchen"
}