BookingLive: Online Booking System

BookingLive API

Overview

The BookingLive API allows developers to interact with our Booking Software. The API makes it easy to create web, desktop & mobile applications that integrate and with your BookingLive account.

Our API is built around open, standard and secure technologies to streamline development and maintain integrity of your data.

Contents


 

basketdata

Returns the basket data of a "known" session.

Request URL: http://your-booking-system-url/api/plain
Request Type: basketdata

Parameters

Parameter Description
ID ID of basket (provided at time of posting initial booking)

Response

Reponse format: JSON

Code is the status of the reponse 1=successful, 0=failed.

Data contains the total cost of the baskets content, it also contains the id and quantity of each item in the basket.

 

{
	"Code" : 1,
	"Data" : [
		{
			"Total" : "0.00",
			"Item_1_Quantity" : "1",
			"Item_1_ActivityID" : "8",
			"Item_1_ActivityPriceCategoryID" : "0"
		}
	]
}

PHP Code Example

$arrPost = array(
'RequestType' => 'basketdata',
'ID' => 'test'
);
$strSecretPhrase = 'secretpassphrase';

$arrPost['HashString'] = strtoupper(hash_hmac('sha256',get_field_string($arrPost),$strSecretPhrase));

$strURL = 'http://your-domain.com/api/plain';

set_time_limit(60);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $strURL);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $arrPost);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
$rawresponse = curl_exec($ch);
curl_close ($ch);

$response = json_decode($rawresponse);
 

get

Returns the all the objects in the system of the requested type

 

Request URL: http://your-booking-system-url/api/plain
Request Type: get

Parameters

Parameter Description
Object Allowed = "Extra", "Activity", "Category","ExtraCategory","ActivityPriceCategory"

Response

Reponse Format: JSON

Code is the status of the reponse 1=successful, 0=failed.

{
	"Code" : 1,
	"Data" : [
		{
			"ID" : 1, 
			"Name" : "Activity One",
			"Code" : "ACT_ONE",
			"SubTitle" : "A fun activity",
			"Description":"This is a description for Activity One.", 
			"BriefDescription" : "This is a brief description for Activity One",
			"CategoryID" : 1,
			"ActivityAttributeIDs" : "",
			"ExtraIDs" : "1,2"
		},
		{
			"ID" : 2,
			"Name" : "Activity Two",
			"Code" : "ACT_TWO",
			"SubTitle" : "A fun activity",
			"Description" : "This is a description for Activity Two",
			"BriefDescription" : "This is a brief description for Activity Two",
			"CategoryID" : 6,
			"ActivityAttributeIDs" : "",
			"ExtraIDs" : "1,3"
		},
		{
			"ID" : 3,
			"Name" : "Activity Three",
			"Code" : "ACT_THREE",
			"SubTitle" : "Activity Three",
			"Description" : "This is the description for Activity Three",
			"BriefDescription" : "This is a brief description for Activity Three",
			"CategoryID" : 7,
			"ActivityAttributeIDs" : "",
			"ExtraIDs" : "1,3"
		}
	]
}

PHP Code Example

$arrPost = array(
'RequestType' => 'get',
'Object' => 'Activity'
);
$strSecretPhrase = 'secretpassphrase';

$arrPost['HashString'] = strtoupper(hash_hmac('sha256',get_field_string($arrPost),$strSecretPhrase));

$strURL = 'http://your-domain.com/api/plain';

set_time_limit(60);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $strURL);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $arrPost);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
$rawresponse = curl_exec($ch);
curl_close ($ch);

$response = json_decode($rawresponse);

 


 

getloggedbookings

All bookings are stored with every change, this call will get all changes with a time window.

Request URL: http://your-booking-system-url/api/plain
Request Type: getloggedbookings

Parameters

Parameter Description
DateRangeEnd in YYY-MM-DD format
DateRangeStart in YYY-MM-DD format

Response

Reponse Format: JSON

Code is the status of the reponse 1=successful, 0=failed.

{
	"Code" : 1,
	"Data" : {
		"Bookings" : [
			{
				"Booking" : {
					"Data" : {
						"ActivityLastMinuteBooking" : "0",
						"Deposit" : "0.00",
						"BookingFinalTotalCost" : "200.00",
						"BookingAmountDue" : 0,
						"OverviewStatus" : "Completed",
						"AllParticipantInformation" : false,
						"RedeemedAVoucher" : false,
						"IsVoucherInTin" : false
					},
					"Purchaser" : {
						"ID" : 10,
						"MemberID" : "11",
						"SocialTitle" : "Mr",
						"FirstName" : "John",
						"Surname" : "Smith",
						"Email" : "john@example.com",
						"Telephone" : "01324 567899",
						"MobileTelephone" : "07012345678",
						"Address1" : "Address line 1",
						"Address2" : "Address line 2",
						"Address3" : null,
						"County" : null,
						"Town" : "Bristol",
						"PostCode": null
					},
					"Transaction" : [
						{
							"ID":1155,
							"Type":"Card",
							"Status":"Completed",
							"Amount":"200.00"
						}
					],
					"Item" : [
						{
							"ID":200,
							"Quantity":"2",
							"ActivityID":"6",
							"ActivityPriceCategoryID":"0",
							"ExtraID":"0",
							"Cost":"200.00",
							"Participants" : [
								{
									"MemberID":"0",
									"SocialTitle":null,
									"FirstName":"John",
									"Surname":"Smith",
									"Dob":"1980-09-03",
									"Telephone":null,
									"MobileTelephone":null,
									"TelephoneOther":null,
									"Email":null
								},
								{
									"MemberID":"0",
									"SocialTitle":null,
									"FirstName":"Grace",
									"Surname":"Smith",
									"Dob":"2004-10-04",
									"Telephone":null,
									"MobileTelephone":null,
									"TelephoneOther":null,
									"Email":null
								}
							]
						}
					]
				}
			}
		]
	}
}

PHP Code Example


$arrPost = array(
'RequestType' => 'getloggedbookings',
'DateRangeStart' => '2013-01-01',
'DateRangeEnd' => '2013-12-16'
);
$strSecretPhrase = 'secretpassphrase';

$arrPost['HashString'] = strtoupper(hash_hmac('sha256',http_build_query($arrPost),$strSecretPhrase));

$strURL = 'http://your-domain.com/api/plain';

set_time_limit(60);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $strURL);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $arrPost);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
$rawresponse = curl_exec($ch);
curl_close ($ch);

$response = json_decode($rawresponse);

 

getobject

Returns the details of the requested object.

Request URL: http://your-booking-system-url/api/plain
Request Type: get

Parameters

Parameter Description
Object allowed types = "Extra", "Activity", "Category","ExtraCategory","ActivityPriceCategory"
ObjectID ID of requested object

Response

Reponse Format: JSON

Code is the status of the reponse 1=successful, 0=failed.

{
	"Code" : 1,
	"Data" : [
		{
			"ID" : 1,
			"Name" : "Activity One",~
			"Code" : "ACT_ONE",
			"SubTitle" : "A fun activity",
			"Description" : "A description for Activity One",
			"BriefDescription" : "A brief description for Activity One",
			"CategoryID" : 6,
			"ActivityAttributeIDs" : "",
			"ExtraIDs" : "1,9,3"
		}
	]
}

PHP Code Example

$arrPost = array(
'RequestType' => 'getobject',
'Object' => 'Activity',
'ObjectID' => '1'
);
$strSecretPhrase = 'secretpassphrase';

$arrPost['HashString'] = strtoupper(hash_hmac('sha256',get_field_string($arrPost),$strSecretPhrase));

$strURL = 'http://your-domain.com/api/plain';

set_time_limit(60);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $strURL);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $arrPost);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
$rawresponse = curl_exec($ch);
curl_close ($ch);

$response = json_decode($rawresponse);

 

health

Simple AI method to check the system is active and responding.

Request URL: http://your-booking-system-url/api/plain
Request Type: get

Response

Response Format: JSON

Code is the status of the reponse 1=successful, 0=failed.

{
	"Code" : 1,
	"Data" : []
}

PHP Code Example

$arrPost = array(
'RequestType' => 'health'
);
$strSecretPhrase = 'secretpassphrase';

$arrPost['HashString'] = strtoupper(hash_hmac('sha256',http_build_query($arrPost),$strSecretPhrase));

$strURL = 'http://your-domain.com/api/plain';

set_time_limit(60);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $strURL);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $arrPost);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
$rawresponse = curl_exec($ch);
curl_close ($ch);

$response = json_decode($rawresponse);
echo '<pre>';print_r($rawresponse);echo '</pre>';

 

scheduleavailability

Returns the number of available slots for the requested schedule.

Parameters

Parameter Description
ScheduleID ID of the schedule the availability request is for.

Response

Reponse Format: JSON

Code is the status of the reponse 1=successful, 0=failed.

{
	"Code" : 1,
	"Data" : [
		{
			"NumberOfAvialableSlots" : 20,
			"IsWaitingListAllowed" : "0"
		}
	]
}

PHP Code Example


$arrPost = array(
'RequestType' => 'scheduleavailability',
'ScheduleID' => '2510'
);
$strSecretPhrase = 'secretpassphrase';

$arrPost['HashString'] = strtoupper(hash_hmac('sha256',get_field_string($arrPost),$strSecretPhrase));

$strURL = 'http://your-domain.com/api/plain';

set_time_limit(60);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $strURL);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $arrPost);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
$rawresponse = curl_exec($ch);
curl_close ($ch);

$response = json_decode($rawresponse);

 

scheduledetail

Returns all schedules (in BRIEF format) for activity wihtin dates

Request URL: http://your-booking-system-url/api/plain
Request Type: scheduledetail

Parameters

Parameter Description
ActivityID  
DateRangeEnd YYYY-MM-DD
DateRangeStart YYYY-MM-DD

Response

Reponse Format: JSON

Code is the status of the reponse 1=successful, 0=failed.

{
	"Code" : 1,
	"Data" : [
		{
			"ID" : 1,
			"Status" : "Active",
			"StartDate" : "2014-01-12",
			"EndDate" : "2014-01-12","
			StartTime" : "09:00:00",
			"EndTime" : "10:00:00",
			"OriginalSlots" : "20",
			"LocationID" : "1",
			"ActivityIDs" : "",
			"NumberOfAvialableSlots" : 20,
			"IsWaitingListAllowed" : "0"
		},
		{
			"ID" : 5,
			"Status" : "Cancelled",
			"StartDate" : "2013-05-02",
			"EndDate" : "2013-05-19",
			"StartTime" : "09:30:00",
			"EndTime" : "17:00:00",
			"OriginalSlots" : "20",
			"LocationID" : "1",
			"ActivityIDs" : "",
			"NumberOfAvialableSlots" : 0,
			"IsWaitingListAllowed" : "0"
		}
	]
}

PHP Code Example


$arrPost = array(
'RequestType' => 'scheduledetail',
'ActivityID' => '1',
'DateRangeStart' => '2013-01-01',
'DateRangeEnd' => '2013-06-01'
);
$strSecretPhrase = 'secretpassphrase';

$arrPost['HashString'] = strtoupper(hash_hmac('sha256',get_field_string($arrPost),$strSecretPhrase));

$strURL = 'http://your-domain.com/api/plain';

set_time_limit(60);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $strURL);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $arrPost);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
$rawresponse = curl_exec($ch);
curl_close ($ch);

$response = json_decode($rawresponse);

 

updateheaderandfooter

Updates the booking systems header and footer text.

Request URL: http://your-booking-system-url/api/plain
Request Type: updateheaderandfooter

Parameters

Parameter Description
Footer Text to be displayed in the footer
Header Text to be displayed in the header

Response

Reponse Format: JSON

Code is the status of the reponse 1=successful, 0=failed.

{
	"Code" : 1,
	"Data" : "Header and footer updated"
}

PHP Code Example

$arrPost = array(
'RequestType' => 'updateheaderandfooter',
'Footer' => 'Footer content',
'Header' => 'Header content'
);
$strSecretPhrase = 'secretpassphrase';

$arrPost['HashString'] = strtoupper(hash_hmac('sha256',http_build_query($arrPost),$strSecretPhrase));

$strURL = 'http://your-domain.com/api/plain';

set_time_limit(60);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $strURL);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $arrPost);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
$rawresponse = curl_exec($ch);
curl_close ($ch);

$response = json_decode($rawresponse);

 

updateitem

Update properties on an object.

Request URL: http://your-booking-system-url/api/plain
Request Type: updateitemp>

Parameters

Parameter Description
ObjectID ID of specified object
ObjectName currently allowed - "Member","Purchaser","Participant"
xyz_Data Where xyz is.... 'FirstName', 'Surname', 'Email', 'Telephone', 'MobileTelephone', 'Address1', 'Address2', 'Address3', 'County', 'Town', 'DeliveryPostCode', 'DeliveryCountry', This is the value to update on the target object

Response

Reponse Format: JSON

Code is the status of the reponse 1=successful, 0=failed.

{
	"Code" : 1,
	"Data" : [
		"Successfully updated "
	]
}

PHP Code Example

$arrPost = array(
'RequestType' => 'updateitem',
'ObjectName' => 'Participant',
'ObjectID' => '309',
'FirstName_Data' => 'New FirstName',
'Surname_Data' => 'New_Surname'
);
$strSecretPhrase = 'secretpassphrase';

$arrPost['HashString'] = strtoupper(hash_hmac('sha256',http_build_query($arrPost),$strSecretPhrase));

$strURL = 'http://your-domain.com/api/plain';

set_time_limit(60);
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $strURL);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $arrPost);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT,30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
$rawresponse = curl_exec($ch);
curl_close ($ch);

$response = json_decode($rawresponse);