Making Requests

Initial Setup

Before getting started with the Seatninja Consumer API, you will need an API key to access our sandbox environment. Once you have properly tested your application in our sandbox environment, you will need to submit the app for us to review. Once we approve your app, you will receive a production API key that you can use to work in our production environment.

Production URL: https://api.seatninja.com

Sandbox API URL: https://sandbox.seatninja.com

Making API Calls

To make an API call, you will need to set the x-api-key header with your API key. Complete list of API's can be found here https://docs.seatninja.com/reference

API keys are scoped to allow access to the restaurants you have permission to access. You can see what restaurants you have permission to access by making a call to our restaurants endpoint see Restaurants. If you attempt to access a restaurant ID not allowed by your API key, you will get back a 403 Forbidden response.

Limits

The sandbox server has a limitation on the number of requests you can make in a given day and hour. If you go over this limit, you will be throttled. The production API environment has no limitation on API requests.

CORS

Building a client-side only integration in Javascript that will run in a web browser is not recommended as it exposes your API key without restriction.

Knowing what restaurants your API key can access

API keys are scoped to allow access to the restaurants you have permission to access. You can see what restaurants you have permission to access by making a call to our restaurants endpoint see Restaurants. If you attempt to access a restaurant ID not allowed by your API key, you will get back a 403 Forbidden response.

curl --request GET \
  --url https://sandbox.seatninja.com/restaurants \
  --header 'accept: application/json' \
  --header 'x-api-key: YOUR_API_KEY'
{
	"data": [{
		"id": 1778,
		"name": "Justin Prod Test",
		"address": "5521 Eagle View Way",
		"city": "Sacramento",
		"state": "Ca",
		"zip": "95842",
		"country": "United States",
		"phoneNumber": "9166019783",
		"timeZone": "Pacific Standard Time",
		"templatedLogoUrl": "https://dev-restaurant-images.s3.amazonaws.com/2017/08/15/r_1778_cfc5eace-19e9-4ad8-9abb-177bfa6f9b08_{0}.png",
		"lat": 38.6959611,
		"lon": -121.3351612,
		"storeNumber": null,
		"timeStamp": 11
	}],
	"error": null
}

You will get back a list of restaurants that you can then store and match up with your own data. The ID property on the return objects is the Seatninja restaurant ID and will be used for future API calls.
See restaurants API

πŸ“˜

Sandbox vs Production

The IDs in sandbox vs production may differ.


What’s Next