All responses include a status. Status 0 is indicative of an error state and is accompanied with a value for 'msg'.
{
"status": 0,
"auth": "false",
"msg": "Could not login user with username fred using password supplied"
}
When there is no data to return an error response will be returned
{
"status": 0,
"msg": "No Data Available for the parameters you supplied"
}
The API by default returns data as JSON strings. To return XML append format=xml to the URL.
The API is secured using an api key you must include the following values in the HTTP headers sent to the API
The following public methods are available
Method: GET
Description: Return a list of all reservation sites
Parameters:
Returns: a list of sites
Sample request:
http://api.touchreservation.net/sites?TAK=xxxxxxxx
Sample response:
{
"status": 1,
"sites":
[
{"ID": "1", "NAME": "Cloud Test Site"},
{"ID": "2", "NAME": "Cloud Test Site 2"},
{"ID": "3", "NAME": "Mikeys Site"}
]
}
Method: GET
Description: Return settings for a specific site
Parameters:
Returns: settings for the specific site
Sample request:
http://api.touchreservation.net/sites/1?TAK=xxxxxxxx
Sample response:
{
"status": 1,
"settings": {
"SITENAME": "Cloud Test Site",
"CHECKINTERVAL": "5",
"DAYSCLOSED": "fri|sat|sun",
"DURATION": "02:00",
"EMAIL": "cloud-bookings@localhost",
"STARTRANGE": "1",
"ENDRANGE": "20",
"INTERVAL": "15",
"MAXGUESTS": "10",
"MAXSEATS": "0",
"MAXSEATSPERSLOT": 10,
"ALLOCATIONMODE": "slots",
"NOTIFY": "icrtouchcloud@localhost",
"OPENINGTIMES": {
"mon": {"open":["09:00","16:00"],"closed":["14:00","22:00"],"lastbooking":["13:30","21:30"],"timerange":["Slot 1","Slot 2"]},
"tue": {"open":["09:00","16:00"],"closed":["14:00","22:00"],"lastbooking":["13:30","21:30"],"timerange":["Slot 1","Slot 2"]},
"wed": {"open":["09:00","16:00"],"closed":["14:00","22:00"],"lastbooking":["13:30","21:30"],"timerange":["Slot 1","Slot 2"]},
"thu": {"open":["09:00","16:00"],"closed":["14:00","22:00"],"lastbooking":["13:30","21:30"],"timerange":["Slot 1","Slot 2"]},
"fri": "",
"sat": "",
"sun": ""
},
"PHONE": "01234 567890"
}
}
Method: GET
Description: Return table floorplan for a specific site
Parameters:
Returns: a list of tables
Sample request: (all tables)
http://api.touchreservation.net/tables?TAK=xxxxxxxx&SITE=1
Sample request: (optional table range)
http://api.touchreservation.net/tables?TAK=xxxxxxxx&SITE=1&STARTRANGE=1&ENDRANGE=10
Sample response:
{
"status": 1,
"tables": [
{
"SITE": "1",
"RECORDNUMBER": "1",
"TABLENUMBER": "1",
"SEATS": "7",
"LEVEL": "1",
"SHAPE": "1",
"LEFT": "36",
"TOP": "611",
"WIDTH": "147",
"HEIGHT": "127"
},
{
"SITE": "1",
"RECORDNUMBER": "2",
"TABLENUMBER": "2",
"SEATS": "8",
"LEVEL": "1",
"SHAPE": "1",
"LEFT": "232",
"TOP": "612",
"WIDTH": "148",
"HEIGHT": "128"
},
{
"SITE": "1",
"RECORDNUMBER": "3",
"TABLENUMBER": "3",
"SEATS": "9",
"LEVEL": "1",
"SHAPE": "1",
"LEFT": "433",
"TOP": "617",
"WIDTH": "153",
"HEIGHT": "127"
},
{
"SITE": "1",
"RECORDNUMBER": "4",
"TABLENUMBER": "4",
"SEATS": "8",
"LEVEL": "1",
"SHAPE": "1",
"LEFT": "636",
"TOP": "619",
"WIDTH": "155",
"HEIGHT": "123"
},
{
"SITE": "1",
"RECORDNUMBER": "26",
"TABLENUMBER": "5",
"SEATS": "7",
"LEVEL": "1",
"SHAPE": "1",
"LEFT": "839",
"TOP": "623",
"WIDTH": "155",
"HEIGHT": "120"
},
{
"SITE": "1",
"RECORDNUMBER": "27",
"TABLENUMBER": "6",
"SEATS": "6",
"LEVEL": "1",
"SHAPE": "1",
"LEFT": "52",
"TOP": "530",
"WIDTH": "112",
"HEIGHT": "81"
},
{
"SITE": "1",
"RECORDNUMBER": "28",
"TABLENUMBER": "7",
"SEATS": "5",
"LEVEL": "1",
"SHAPE": "1",
"LEFT": "262",
"TOP": "528",
"WIDTH": "107",
"HEIGHT": "82"
},
{
"SITE": "1",
"RECORDNUMBER": "29",
"TABLENUMBER": "8",
"SEATS": "5",
"LEVEL": "1",
"SHAPE": "1",
"LEFT": "458",
"TOP": "534",
"WIDTH": "114",
"HEIGHT": "83"
},
{
"SITE": "1",
"RECORDNUMBER": "30",
"TABLENUMBER": "9",
"SEATS": "5",
"LEVEL": "1",
"SHAPE": "1",
"LEFT": "655",
"TOP": "532",
"WIDTH": "113",
"HEIGHT": "81"
},
{
"SITE": "1",
"RECORDNUMBER": "31",
"TABLENUMBER": "10",
"SEATS": "6",
"LEVEL": "1",
"SHAPE": "1",
"LEFT": "852",
"TOP": "529",
"WIDTH": "108",
"HEIGHT": "84"
}
]
}
Method: GET
Description: Return all reservation details for a specific site
Parameters:
Returns: a list of reservations
Sample request: (all reservations)
http://api.touchreservation.net/reservations?TAK=xxxxxxxx&SITE=1
Sample request: (optional date range)
http://api.touchreservation.net/reservations?TAK=xxxxxxxx&SITE=1&FROMDATE=2016-08-01&TODATE=2016-08-05
Sample response:
{
"status": 1,
"reservations": [
{
"RESERVATION": "101",
"SITE": "1",
"DATE": "2016-08-04",
"TIME": "17:00:00",
"DURATION": "02:00:00",
"TABLENUMBER": "11",
"GUESTS": "2",
"NAME": "Miss Rose Williams",
"EMAIL": "email@company.com",
"PHONE": "009989871234",
"REFTEXT": "rw101-misswilliams",
"DATETAKEN": "2016-08-04",
"TIMETAKEN": "13:28:00",
"STATUS": "0",
"DEPOSIT": "0",
"NOTES": "Near the window please"
},
{
"RESERVATION": "100",
"SITE": "1",
"DATE": "2016-08-03",
"TIME": "20:00:00",
"DURATION": "02:00:00",
"TABLENUMBER": "2",
"GUESTS": "8",
"NAME": "Mrs Emily Jones",
"EMAIL": "email@company.com",
"PHONE": "00129384021454",
"REFTEXT": "ej100-mrsjones",
"DATETAKEN": "2016-08-03",
"TIMETAKEN": "13:23:00",
"STATUS": "0",
"DEPOSIT": "0",
"NOTES": "Birthday party, can I have some balloons"
},
{
"RESERVATION": "99",
"SITE": "1",
"DATE": "2016-08-02",
"TIME": "19:00:00",
"DURATION": "02:00:00",
"TABLENUMBER": "18",
"GUESTS": "4",
"NAME": "Mr Dave Lister",
"EMAIL": "email@company.com",
"PHONE": "29034023808401234",
"REFTEXT": "dl99-mrlister",
"DATETAKEN": "2016-08-02",
"TIMETAKEN": "11:44:00",
"STATUS": "0",
"DEPOSIT": "0",
"NOTES": ""
},
{
"RESERVATION": "98",
"SITE": "1",
"DATE": "2016-08-02",
"TIME": "20:00:00",
"DURATION": "02:00:00",
"TABLENUMBER": "17",
"GUESTS": "3",
"NAME": "Mr John Smith",
"EMAIL": "email@company.com",
"PHONE": "982174992317",
"REFTEXT": "js98-mrsmith",
"DATETAKEN": "2016-08-02",
"TIMETAKEN": "11:41:00",
"STATUS": "0",
"DEPOSIT": "0",
"NOTES": ""
}
]
}
Sample request: (single id)
http://api.touchreservation.net/reservations/98?TAK=xxxxxxxx&SITE=1
Sample response:
{
"status": 1,
"reservations": {
"RESERVATION": "98",
"SITE": "1",
"DATE": "2016-08-02",
"TIME": "20:00:00",
"DURATION": "02:00:00",
"TABLENUMBER": "17",
"GUESTS": "3",
"NAME": "Mr John Smith",
"EMAIL": "email@company.com",
"PHONE": "982174992317",
"REFTEXT": "js98-mrsmith",
"DATETAKEN": "2016-08-02",
"TIMETAKEN": "11:41:00",
"STATUS": "0",
"DEPOSIT": "0",
"NOTES": ""
}
}
Method: POST
Description: Create a new reservation
Get Parameters:
Post Parameters:
Returns: details of the created reservation.
Sample request:
http://api.touchreservation.net/reservations?TAK=xxxxxxxx&SITE=1
Sample post data:
date=2016-08-09&time=17:00&guests=4&title=mr&firstname=robert&surname=mclaren&email=email@company.com&phone=0120340213844
Sample response:
{
"status": 1,
"detail": {
"RESERVATION": "102",
"SITE": "1",
"DATE": "2016-08-09",
"TIME": "17:00:00",
"DURATION": "02:00:00",
"TABLENUMBER": "18",
"GUESTS": "4",
"NAME": "Mr Robert McLaren",
"EMAIL": "email@company.com",
"PHONE": "0120340213844",
"REFTEXT": "rm102-mrmclaren",
"DATETAKEN": "2016-08-09",
"TIMETAKEN": "15:47:00",
"STATUS": "0",
"DEPOSIT": "0",
"NOTES": ""
}
}
Method: PATCH
Description: Change an existing reservation
Get Parameters:
Patch Parameters:
Returns: details of the modified reservation.
Sample request:
http://api.touchreservation.net/reservations/98?TAK=xxxxxxxx&SITE=1
Sample post data:
date=2016-08-12&time=15:00&guests=4&deposit=20.00
Sample response:
{
"status": 1
"detail": {
"RESERVATION": "98",
"SITE": "1",
"DATE": "2016-08-12",
"TIME": "15:00:00",
"DURATION": "02:00:00",
"TABLENUMBER": "17",
"GUESTS": "4",
"NAME": "Mr John Smith",
"EMAIL": "email@company.com",
"PHONE": "982174992317",
"REFTEXT": "js98-mrsmith",
"DATETAKEN": "2016-08-02",
"TIMETAKEN": "11:41:00",
"STATUS": "0",
"DEPOSIT": "2000",
"NOTES": ""
}
}
NB: Please note the reservation deposit is displayed without the decimal point. This
is how the values are stored within the till system, and is not an error with the API.
Method: DELETE
Description: Delete an existing reservation
Get Parameters:
Delete Parameters:
Returns: details of the deleted reservation.
Sample request:
http://api.touchreservation.net/reservations/98?TAK=xxxxxxxx&SITE=1
Sample post data:
email=email@company.com&reference=js98-mrsmithNB: Please note the reservation id passed in the uri must match the id in the booking reference. i.e. "reservations/98" matches "js98-mrsmith".
Sample response:
{
"status": 1,
"detail": {
"RESERVATION": "98",
"SITE": "1",
"DATE": "2016-08-12",
"TIME": "15:00:00",
"DURATION": "02:00:00",
"TABLENUMBER": "17",
"GUESTS": "4",
"NAME": "Mr John Smith",
"EMAIL": "email@company.com",
"PHONE": "982174992317",
"REFTEXT": "js98-mrsmith",
"DATETAKEN": "2016-08-02",
"TIMETAKEN": "11:41:00",
"STATUS": "0",
"DEPOSIT": "2000",
"NOTES": ""
}
}
Method: GET
Description: Return a list of time slots with number of seats taken
Parameters:
Returns: a list of booked time slots taken and times taken. The number of seats in the slots_taken will be a total of all the guests booked for each slot. The times_taken will return each time slot with the duration of the booking (before and during) adjusted to give the number of seats taken.
Sample request:
http://api.touchreservation.net/availability/slots_taken?TAK=xxxxxxxx&SITE=1&DATE=2020-10-05&DURATION=02:00
Sample response:
{
"status": 1,
"slots_taken": {
"08:00": 0,
"08:15": 0,
"08:30": 0,
"08:45": 0,
"09:00": 0,
"09:15": 0,
"09:30": 0,
"09:45": 0,
"10:00": 0,
"10:15": 0,
"10:30": 10,
"10:45": 0,
"11:00": 0,
"11:15": 0,
"11:30": 0,
"12:00": 10,
"12:15": 0,
"12:30": 0,
"12:45": 0,
"13:00": 0,
"13:15": 8,
"13:30": 0,
"13:45": 0,
"14:00": 0,
"17:30": 0,
"17:45": 0,
"18:00": 0,
"18:15": 5,
"18:30": 0,
"18:45": 0,
"19:00": 0,
"19:15": 0,
"19:30": 0,
"19:45": 0,
"20:00": 0,
"20:15": 0,
"20:30": 0
},
"times_taken": {
"08:00": 0,
"08:15": 0,
"08:30": 0,
"08:45": 10,
"09:00": 10,
"09:15": 10,
"09:30": 10,
"09:45": 10,
"10:00": 10,
"10:15": 20,
"10:30": 20,
"10:45": 20,
"11:00": 20,
"11:15": 20,
"11:30": 18,
"12:00": 18,
"12:15": 18,
"12:30": 18,
"12:45": 18,
"13:00": 8,
"13:15": 8,
"13:30": 8,
"13:45": 8,
"14:00": 8,
"17:30": 5,
"17:45": 5,
"18:00": 5,
"18:15": 5,
"18:30": 5,
"18:45": 5,
"19:00": 5,
"19:15": 0,
"19:30": 0,
"19:45": 0,
"20:00": 0,
"20:15": 0,
"20:30": 0
}
}
Method: GET
Description: Return a list of tables with number of guests/duration
Parameters:
Returns: a list of booked tables
Sample request:
http://api.touchreservation.net/availability/tables_taken?TAK=xxxxxxxx&SITE=1&DATE=2020-10-05
Sample response:
{
"status": 1,
"tables_taken": {
"17": {
"10:30": {
"guests": 8,
"duration": "01:00"
}
},
"1": {
"10:30": {
"guests": 2,
"duration": "01:00"
}
}
}
}
Method: GET
Description: Returns a list of time slots with number of seats taken, tables with number of guests/duration and tables free for the number of guests specified
Parameters:
Returns: a list of booked slots taken, times taken, booked tables and available tables. The number of seats in the slots_taken will be a total of all the guests booked for each slot. The times_taken will return each time slot with the duration of the booking (before and during) adjusted to give the number of seats taken. The number of guests shown for timeslots against an available table are seats available rather than taken.
Sample request:
http://api.touchreservation.net/availability/check?TAK=xxxxxxxx&SITE=1&DATE=2020-10-05&GUESTS=8&DURATION=02:00
Sample response:
{
"status": 1,
"slots_taken": {
"08:00": 0,
"08:15": 0,
"08:30": 0,
"08:45": 0,
"09:00": 0,
"09:15": 0,
"09:30": 0,
"09:45": 0,
"10:00": 0,
"10:15": 0,
"10:30": 10,
"10:45": 0,
"11:00": 0,
"11:15": 0,
"11:30": 0,
"12:00": 10,
"12:15": 0,
"12:30": 0,
"12:45": 0,
"13:00": 0,
"13:15": 8,
"13:30": 0,
"13:45": 0,
"14:00": 0,
"17:30": 0,
"17:45": 0,
"18:00": 0,
"18:15": 5,
"18:30": 0,
"18:45": 0,
"19:00": 0,
"19:15": 0,
"19:30": 0,
"19:45": 0,
"20:00": 0,
"20:15": 0,
"20:30": 0
},
"times_taken": {
"08:00": 0,
"08:15": 0,
"08:30": 0,
"08:45": 10,
"09:00": 10,
"09:15": 10,
"09:30": 10,
"09:45": 10,
"10:00": 10,
"10:15": 20,
"10:30": 20,
"10:45": 20,
"11:00": 20,
"11:15": 20,
"11:30": 18,
"12:00": 18,
"12:15": 18,
"12:30": 18,
"12:45": 18,
"13:00": 8,
"13:15": 8,
"13:30": 8,
"13:45": 8,
"14:00": 8,
"17:30": 5,
"17:45": 5,
"18:00": 5,
"18:15": 5,
"18:30": 5,
"18:45": 5,
"19:00": 5,
"19:15": 0,
"19:30": 0,
"19:45": 0,
"20:00": 0,
"20:15": 0,
"20:30": 0
},
"tables_taken": {
"17": {
"10:30": {
"guests": 8,
"duration": "01:00"
}
},
"1": {
"10:30": {
"guests": 2,
"duration": "01:00"
}
}
},
"tables_free": [
{
"table": 15,
"times": {
"08:00": 6,
"08:15": 6,
"08:30": 6,
"08:45": 6,
"09:00": 6,
"09:15": 6,
"09:30": 6,
"09:45": 6,
"10:00": 6,
"10:15": 6,
"10:30": 6,
"10:45": 6,
"11:00": 6,
"11:15": 6,
"11:30": 6,
"12:00": 6,
"12:15": 6,
"12:30": 6,
"12:45": 6,
"13:00": 6,
"13:15": 6,
"13:30": 6,
"13:45": 6,
"14:00": 6,
"17:30": 6,
"17:45": 6,
"18:00": 6,
"18:15": 6,
"18:30": 6,
"18:45": 6,
"19:00": 6,
"19:15": 6,
"19:30": 6,
"19:45": 6,
"20:00": 6,
"20:15": 6,
"20:30": 6
}
},
{
"table": 16,
"times": {
"08:00": 7,
"08:15": 7,
"08:30": 7,
"08:45": 7,
"09:00": 7,
"09:15": 7,
"09:30": 7,
"09:45": 7,
"10:00": 7,
"10:15": 7,
"10:30": 7,
"10:45": 7,
"11:00": 7,
"11:15": 7,
"11:30": 7,
"12:00": 7,
"12:15": 7,
"12:30": 7,
"12:45": 7,
"13:00": 7,
"13:15": 7,
"13:30": 7,
"13:45": 7,
"14:00": 7,
"17:30": 7,
"17:45": 7,
"18:00": 7,
"18:15": 7,
"18:30": 7,
"18:45": 7,
"19:00": 7,
"19:15": 7,
"19:30": 7,
"19:45": 7,
"20:00": 7,
"20:15": 7,
"20:30": 7
}
},
{
"table": 17,
"times": {
"08:00": 8,
"08:15": 8,
"08:30": 8,
"08:45": 0,
"09:00": 0,
"09:15": 0,
"09:30": 0,
"09:45": 0,
"10:00": 0,
"10:15": 0,
"10:30": 0,
"10:45": 0,
"11:00": 0,
"11:15": 0,
"11:30": 8,
"12:00": 8,
"12:15": 8,
"12:30": 8,
"12:45": 8,
"13:00": 8,
"13:15": 8,
"13:30": 8,
"13:45": 8,
"14:00": 8,
"17:30": 8,
"17:45": 8,
"18:00": 8,
"18:15": 8,
"18:30": 8,
"18:45": 8,
"19:00": 8,
"19:15": 8,
"19:30": 8,
"19:45": 8,
"20:00": 8,
"20:15": 8,
"20:30": 8
}
}
]
}
Page rendered in 0.0161 seconds