For full functionality of this site it is necessary to enable JavaScript. Here are the instructions how to enable JavaScript in your web browser.
 You are using an out of date browser, we suggest you upgrade. You may continue if you wish, but aspects of the site may not function correctly.

Availability

This section will outline how you can use the REST API to get the available slots for a bookable item (Services & Events). Below we will explain each of these endpoints in more detail.

Day

The Day end-point will load a list of bookable event items for a particular date.

Parameters

Name Type Description
company_id string company ID
date string Date in ISO-8601
page integer pagination &page=50, will show 50 reults per page
curl -X GET -H "App-Id: {app-id}" -H "App-Key: {app-key}" -H "Content-Type: application/json"
   -H "Cache-Control: no-cache"
"https://{host}.bookingbug.com/api/v1/company_id/day/YYYY-MM-DD"

Day Data

The Day Data gets data for a range of days. This end-point retrieves a set of day date for a bookable service items. Bookable items in BookingBug are a service with either or both of a Resource and a Person. These are combined into a single EventID.

Parameters

Name Type Description
company_id string company ID
event_id integer The underlying Bookable 'event ID' - that descripbes this bookable service combination
service_id integer The ID of service - so you can find all time slots that match a specific service
date string Date in ISO-8601
edate integer End Date in ISO-8601
month integer TA Month in MMYY format - returns an exact month
cal_month string A Month in MMYY format - returns a 6 week month for a calendar
year string A Year in YYYY
week string A Week of the year in WWYY format
week_start integer Which day the week starts on 0=Sunday, 1=Monday
num_resources integer Additional resources/rooms to block out with this booking

The cURL below is an example that will return back all available slots for a given service, start date and an end date.

curl -X GET -H "App-Id: {app-id}" -H "App-Key: {app-key}" -H "Content-Type: application/json" 
  -H "Cache-Control: no-cache"
"https://{host}.bookingbug.com/api/v1/company_id/day_data?service_id=xxx&date=2016-13-12&edate=2016-20-12"
{
  "_embedded": {
    "day_data": [
      {
        "_embedded": {
          "day_data": []
        },
        "days": [
          {
            "spaces": 78,
            "date": "2017-01-16"
          },
          {
            "spaces": 102,
            "date": "2017-01-17"
          },
          {
            "spaces": 102,
            "date": "2017-01-18"
          },
          ...
                  ],
        "service_id": 104747,
        "name": "Microchipping",
        "_links": {
          "self": {
            "href": "https://uk.bookingbug.com/api/v1/50666/day_data?service_id=104747"
          }
        }
      },
      ...
      }

Note: We recommend that you use shorter date range for better performance.

Time Data

Time Data end-point gets available time slots for events for a date. You can also combine the date with any of the listed parameters below to filter the results.

Parameters

Name Type Description
company_id string company ID
event_id integer The underlying Bookable 'event ID' - that descripbes this bookable service combination
service_id integer The ID of service - so you can find all time slots that match a specific service
resource_ids string The IDs of resources - so you can find all time slots that match specific resources (list should be separated by commas)
person_id integer The ID of person - so you can find all time slots that match a specific person
group_id integer The ID of a service group - so you can find all time slots that match a specific price group
location string Comma seperated address in the order of (AddressLine1, AddressLine2, Town, State/County, Postcode, Country)
date string The date in ISO-8601 (YYYY-MM-DD)
end_date string The date in ISO-8601 (YYYY-MM-DD) - optional
duration integer Duration of the appointment in minutes
num_resources integer Additional resources/rooms to block out with this booking

The cURL call below will list all available time slots for a particular date and for a particular staff (person). You can even pass in the service_id if you need the availbility for a particular service.

curl -X GET -H "App-Id: {app-id}" -H "App-Key: {app-key}" -H "Content-Type: application/json"
   -H "Cache-Control: no-cache"
"https://{host}.bookingbug.com/api/v1/company_id/time_data?date=YYYY-MM-DD&person_id=12345"
{
  "_embedded": {
    "events": [
      {
        "times": [
          {
            "time": 540,
            "avail": 1,
            "price": 3000,
            "datetime": "2017-01-16T09:00:00+00:00"
          },
          {
            "time": 550,
            "avail": 1,
            "price": 3000,
            "datetime": "2017-01-16T09:10:00+00:00"
          },
          {
            "time": 560,
            "avail": 1,
            "price": 3000,
            "datetime": "2017-01-16T09:20:00+00:00"
          },
          ...
        ],
        "name": "Emma",
        "date": "2017-01-16",
        "event_id": 1091849,
        "_links": {
          "self": {
            "href": "https://uk.bookingbug.com/api/v1/50666/time_data?event_id=1091849&date=2017-01-16&single=true&num_resources=1&time_zone=Europe%2FLondon"
          }
        }
      },
      ...
      }

Note: We recommend that you use shorter date range for better performance.