Restaurants - API Documentation

Know about the menus, reviews and rating of the restaurants nearby.

Add restaurant

Reggisters a restaurant.

POST
/restaurants

Parameters
access_token String A valid access token.
titleString
logoString
coverString
urlString
categories[String]
accepts_reservationsBoolean
serves_cuisine[String]
star_ratingNumber
opening_hours
[
    {
        "open": "Time",
        "close": "Time"
    }
]
payment_methods[String]
can_home_deleverBoolean
photos[Image]
emailString
phoneString
websiteString
Response
Status: 201

Search restaurants

Search for restaurants with given parameters.

GET
/restaurants

Parameters
access_token String A valid access token.
Response
[
	{
		"_id": "8as8das8da8sda9ds8a9sdah",
		"title": "Kababish",
		"url": "kababish-bangalore",
		"cover": "8as8das8da8sda9ds8a9sdah-restaurant-cover.jpg",
		"url": "kababish-bangalore",
		"opening_hours": [
			{
				"open": "Time",
				"close": "Time"
			}
		],
		"can_home_delever": true,
		"address": {
			"addressLine1": "1st Cross, Bn Road",
			"addressLine2": "2nd Stage",
			"landmark": "SBI Bank",
			"state": "Karnataka",
			"city": "Bangalore",
			"district": "Bangalore",
			"country": "India",
			"geo": {
				"latitude": 21.00,
				"longitude": 34.088
			}
		},
		"email": "kabas=bish-bangalore@gmail.com",
		"phone": "9797474795",
		"website": "http://kababish.com",
		"rating": 4.5
	}
]

Get Restaurant

Get detials of the specified restaurant.

GET
/restaurants/:restaurant_id

Parameters
access_token String A valid access token.
Response
{
	"_id": ID,
	"title": String,
	"logo": String,
	"url": String,
	"type": [String],
	"categories": [String],
	"accepts_reservations": String,
	"serves_cuisine": [String],
	"star_rating": String,
	"opening_hours": [String],
	"payment_methods": [String],
	"can_home_delever": Boolean,
	"price_range": [String],
	"photos": [String],
	"badges": [{
        "badge_id": ID,
        "badge_name": String,
        "badge_cover": String,
        "recieved": DateTime
    }],
	"address": {       
	    "addressLine1": String,
	    "addressLine2": String,
	    "landmark": String,
	    "state": String,
	    "city": String,
	    "district": String,
	    "country": String,
	    "geo": {
	        "latitude": Number,
	        "longitude": Number
	    }
	},
	"contact": {
	    "email": String,
	    "phone": String
	},
	"owner": {
	    "user_id": ID,
	    "user_avatar": String,
	    "user_username": String,
	    "user_first_name": String,
	    "user_rating": Number
	},
	"comments": {
	    "user_id": ID,
	    "user_avatar": String,
	    "user_username": String,
	    "user_first_name": String,
	    "user_rating": Number,
	    "comment": String,
	    "rating": Number
	}
}

Edit Restaurant

Updates the restaurant details with the given info

PUT
/restaurants/:restaurant_id

Parameters
access_token String A valid access token.
Response
{
	"_id": ID,
	"title": String,
	"logo": String,
	"url": String,
	"type": [String],
	"categories": [String],
	"accepts_reservations": String,
	"serves_cuisine": [String],
	"star_rating": String,
	"opening_hours": [String],
	"payment_methods": [String],
	"can_home_delever": Boolean,
	"price_range": [String],
	"photos": [String],
	"address": {       
	    "addressLine1": String,
	    "addressLine2": String,
	    "landmark": String,
	    "state": String,
	    "city": String,
	    "district": String,
	    "country": String,
	    "geo": {
	        "latitude": Number,
	        "longitude": Number
	    }
	},
	"contact": {
	    "email": String,
	    "phone": String
	},
	"owner": {
	    "user_id": ID,
	    "user_avatar": String,
	    "user_username": String,
	    "user_first_name": String,
	    "user_rating": Number
	}
}

Order Recipe

Places a recipe in the order list.

PUT
/restaurants/order

Parameters
access_token String A valid access token.
Response
Status: 201

Comment Restaurant

Adds a rating and comment to the specified restaurant.

PUT
/restaurants/:restaurant_id/comments

Parameters
access_token String A valid access token.
title String Brief about the comment.
body String Body of the comment.
rating Number Rating of the restaurant.
Response
Status: 201

Get Comments

Get the comments of the specified restaurant.

GET
/restaurants/:restaurant_id/comments

Parameters
access_token String A valid access token.
Response
{
  "_id": "58eafdb86a749b66909b87de",
  "title": "Hom Resto",
  "description": "THis is all about",
  "comments": [
    {
      "_id": "58eb305837dc570c08f2683f",
      "user": {
        "_id": "58e5e3158fee4035937a2429",
        "username": "shajanjp",
        "first_name": "Shajan"
      },
      "title": "Hello comment",
      "body": "I really dont like that one",
      "rating": "4"
    }
  ]
}

Report Restaurant

Reports a restaurant.

PUT
/restaurants/:restaurant_id

Parameters
access_token String A valid access token.
Response
Status: 201

Remove Restaurant

Removes the specified restaurant.

DELETE
/restaurants/:restaurant_id

Parameters
access_token String A valid access token.
Response
Status: 204