Skip to content

hammasattila/Sapientia-2020-Android-RestAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sapientia-2020-Android-RestAPI

This project was a replacement for OpenTableAPI during the development of Android course project. It is hosted on one of the subdomains at Imok.

1. Overview

2. API Reference

2.1. List all countries

GET /api/countries

Returns response:

{
  "count": 8,
  "countries": ["WY","AR", "CA", "CO", "HI", ...]
}

2.2. List all states

GET /api/states

Returns response:

{
  "count": 8,
  "states": ["WY","AR", "CA", "CO", "HI", ...]
}

2.3. List all cities

GET /api/cities

Returns response:

{
  "count": 1234,
  "cities": [
    "Chicago",
    "San Francisco",
    "New York",
    ...
  ]
}

2.4. Find restaurants

GET /api/restaurants

Parameters for filtering:

  • price - Price range for the restaurant. Values: 1-4.
  • name - Name of the restaurant
  • address - Address line. Should not contain state or city or zip.
  • state - State code (ex.: IL)
  • city - City name (ex.: Chicago)
  • zip - Zipcode (ex: 60601)
  • country - Country code (ex: US)
  • page - Page (default: 1)
  • per_page - Entries per Page, can be one of [5, 10, 15, 25, 50, 100] (default: 25)

Returns response:

{
  "count": 521,
  "per_page": 25,
  "current_page": 1,
  "restaurants": [ ... ]
}

2.5. Find a single restaurant

GET /api/restaurants/:id

Returns a single restaurant record, see reference for details. Example:

{
  "id": 107257,
  "name": "Las Tablas Colombian Steak House",
  "address": "2942 N Lincoln Ave",
  "city": "Chicago",
  "state": "IL",
  "area": "Chicago / Illinois",
  "postal_code": "60657",
  "country": "US",
  "phone": "7738712414",
  "lat": 41.935137,
  "lng": -87.662815,
  "price": 2,
  "reserve_url": "http://www.opentable.com/single.aspx?rid=107257",
  "mobile_reserve_url": "http://mobile.opentable.com/opentable/?restId=107257",
  "image_url": "https://www.opentable.com/img/restimages/107257.jpg"
}

3. Data Reference

Restaurant attributes:

{
  "id": 107257,
  "name": "Las Tablas Colombian Steak House",
  "address": "2942 N Lincoln Ave",
  "city": "Chicago",
  "state": "IL",
  "area": "Chicago / Illinois",
  "postal_code": "60657",
  "country": "US",
  "phone": "7738712414",
  "lat": 41.935137,
  "lng": -87.662815,
  "price": 2,
  "reserve_url": "http://www.opentable.com/single.aspx?rid=107257",
  "mobile_reserve_url": "http://mobile.opentable.com/opentable/?restId=107257",
  "image_url": "https://www.opentable.com/img/restimages/107257.jpg"
}

Disclaimer

  • This service IS NOT affiliated with OpenTable Inc., any of its products or employees.

About

Simple REST API whit dummy data.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors