Skip to content

API Reviews Endpoints

Earl Fong edited this page Dec 15, 2020 · 1 revision

Endpoints and HTTP verbs used for Espresso reviews that have been implemented.

N.B. By default input string fields are silently truncated to 255 characters without reporting an error or raising an exception. Any string fields that are different from this default are so described.

/reviews - GET

List all reviews, returning all fields for each.

No input arguments.

In all cases the returned object contains a success boolean property at the top-level.

Examples of returned json are below. The id and restaurant_id properties are non-negative integers. The comment property may be blank or null and is limited to 1000 characters. All other properties are not null and not blank.

(1) The happy path returning two reviews, status code 200

{
  "api_version": "2.0",
  "message": null,
  "reviews": [
    {
      "author": "[email protected]"
      "comment": "Pretty decent espresso and outstanding pastries"
      "date": "12-14-2020"
      "id": 1
      "rating": 4
      "restaurant_id": 2
    }, 
    {
      "author": "[email protected]"
      "comment": "espresso was way too weak for my tastes, like a watered down Americano"
      "date": "12-14-2020"
      "id": 2
      "rating": 1
      "restaurant_id": 5
    }
  ], 
  "success": true
}
Clone this wiki locally