Repository navigation
Reviews API
Hong edited this page Apr 28, 2020
·
2 revisions
Method: GET
Description: This method is used to get a single review
| Parameters | Format |
|---|---|
| reviewID | Integer |
example request URL: https://localhost:5001/api/reviews/1
STATUS CODE: 200
{
"id": 1,
"name": "Bryan",
"restaurantID": 2,
"review": "Yum!",
},
Method: GET
Description: This method is used to get all the reviews for a restaurant
example request URL: https://localhost:5001/reviews/restaurant/1
STATUS CODE: 200 OK
[{
"id": 1,
"name": "Bryan",
"restaurantID": 2,
"review": "Yum!",
},
{
"id": 2,
"name": "Jeremy",
"restaurantID": 2,
"review": "Great food!",
}]
Method: POST
Description: This method is used to add a new review for a restaurant
Body Input
| Parameters | Format |
|---|---|
| name | String |
| restaurantID | Integer |
| review | String |
Request Body example
{
"id": 1,
"name": "Bryan",
"restaurantID": 2,
"review": "Yum!",
},
example request URL: https://localhost:5001/api/reviews
STATUS CODE: 200 OK
{
"added"
},
Method: DELETE
Description: This method is used to delete a review object
Path Parameters
| Parameters | Format |
|---|---|
| reviewID | Integer |
example request URL: https://localhost:5001/api/reviews/1
STATUS CODE: 200 OK
{
"deleted"
},