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.

People

The people API enables you to list, create, update and query the staff registered against your company. You must be authenticated as an administrator to perform the creation, update, find by reference and block time for person.

Create person

The API enables an admin to create a person. The following parameters listed below are supported.

Parameters

Name Type Description
name string Name of the staff
description string description
email string email address of the staff
phone_prefix string phone prefix e.g. 44
phone string phone number of the staff
ical_link string Calendar link
never_booked boolean mark staff as never being booked
notify boolean true/false - default is true
reference string external reference for staff
all_staff boolean True when creating an Admin that will be able to see other staff schedules, false otherwise
POST /api/v1/admin/{company_id}/people
curl -X POST -H "App-Id: {app-id}" -H "App-Key: {app-key}" -H "Auth-Token: {auth-token}" 
  -H "Content-Type: application/json" 
  -H "Cache-Control: no-cache"
  -d '{
    "name": "Test Staff",
    "description": "Test description"
    "email": "test@test.com",
    "phone_prefix": "44",
    "phone": "07912345678",
    "reference": "123400",
    "notify": false
  }'
"https://{host}.bookingbug.com/api/v1/admin/{company_id}/people"

Above is an example cURL call for creating a new person.

Update person

You can update information of a person. The parameters stated below are supported. You must be authenicated as an administrator to make this call.

Parameters

Name Type Description
name string Name of the staff
description string description
email string email address of the staff
phone_prefix string phone prefix e.g. 44
phone string phone number of the staff
ical_link string Calendar link
never_booked boolean mark staff as never being booked
reference string external reference for staff
client_queue_id integer Queue ID the staff belongs to - only if the queue feature is enabled
queuing_disabled boolean true/false - only if queue feature is enabled
PUT /api/v1/admin/{company_id}/people/{id}
curl -X PUT -H "App-Id: {app-id}" -H "App-Key: {app-key}" -H "Auth-Token: {auth-token}" 
  -H "Content-Type: application/json" 
  -H "Cache-Control: no-cache"
  -d '{
    "name": "Test Staff 1",
    "description": "Test description 1"
    "email": "test@test.com",
    "phone_prefix": "44",
    "phone": "07912345678",
    "reference": "123400"
  }'
"https://{host}.bookingbug.com/api/v1/admin/{company_id}/people/{id}"

List people

There are two different ways of listing people. The first method is using the admin end-point and the second method is using the public end-point. The admin method of listing will return more data compared to the public.

Parameters

Name Type Description
page integer 1
per_page integer 300
include_disabled boolean true/false - true by default
GET /api/v1/admin/{company_id}/people
GET /api/v1/{company_id}/people
curl -X GET -H "App-Id: {app-id}" -H "App-Key: {app-key}" -H "Auth-Token: {auth-token}" 
  -H "Content-Type: application/json" 
  -H "Cache-Control: no-cache"
"https://{host}.bookingbug.com/api/v1/admin/{company_id}/people?page=1&per_page=50&include_disabled=false"
{
    "total_entries": 2,
    "_embedded": {
        "people": [
            {
                "id": 15288,
                "name": "Staff One",
                "type": "person",
                "deleted": false,
                "disabled": false,
                "company_id": 37004,
                "order": 15288,
                "phone_prefix": "44",
                "_links": {
                    "self": {
                        "href": "https://host.bookingbug.com/api/v1/admin/37004/people/15288"
                    },
                    "items": {
                        "href": "https://host.bookingbug.com/api/v1/admin/37004/items?person_id=15288"
                    },
                    "images": {
                        "href": "https://host.bookingbug.com/api/v1/37004/media/person_images/15288"
                    },
                    "companies": [
                        {
                            "title": "Company Name",
                            "href": "https://host.bookingbug.com/api/v1/admin/37004/company"
                        }
                    ],
                    "edit": {
                        "href": "https://host.bookingbug.com/api/v1/admin/37004/people/15288/edit"
                    },
                    "attendance": {
                        "href": "https://host.bookingbug.com/api/v1/admin/37004/people/15288/attendance"
                    },
                    "block": {
                        "href": "https://host.bookingbug.com/api/v1/admin/37004/people/15288/block"
                    },
                    "cal": {
                        "href": "http://host.bookingbug.com/ical/person/15288?calid=4060413678"
                    },
                    "overlay_cal": {
                        "href": "https://host.bookingbug.com/api/v1/admin/37004/cal/5"
                    },
                    "schedule": {
                        "href": "https://host.bookingbug.com/api/v1/admin/37004/schedules/48315{?start_date,end_date}",
                        "templated": true
                    },
                    "enabled_services": [
                        {
                            "title": "Service One",
                            "href": "https://host.bookingbug.com/api/v1/admin/37004/services/48323"
                        },
                        {
                            "title": "Service Two",
                            "href": "https://host.bookingbug.com/api/v1/admin/37004/services/48324"
                        }
                    ],
                    "enabled_resources": []
                },
                "_embedded": {},
                "email": "staffone@test.com",
                "mobile": "",
                "queuing_disabled": true,
                "person_companies": [
                    37004
                ],
                "ical_link": ""
            },
            {
                "id": 15289,
                "name": "Staff Two",
                "type": "person",
                "deleted": false,
                "disabled": false,
                "company_id": 37004,
                "order": 15289,
                "phone_prefix": "44",
                "_links": {
                    "self": {
                        "href": "https://host.bookingbug.com/api/v1/admin/37004/people/15289"
                    },
                    "items": {
                        "href": "https://host.bookingbug.com/api/v1/admin/37004/items?person_id=15289"
                    },
                    "images": {
                        "href": "https://host.bookingbug.com/api/v1/37004/media/person_images/15289"
                    },
                    "companies": [
                        {
                            "title": "Company Name",
                            "href": "https://host.bookingbug.com/api/v1/admin/37004/company"
                        }
                    ],
                    "edit": {
                        "href": "https://host.bookingbug.com/api/v1/admin/37004/people/15289/edit"
                    },
                    "attendance": {
                        "href": "https://host.bookingbug.com/api/v1/admin/37004/people/15289/attendance"
                    },
                    "block": {
                        "href": "https://host.bookingbug.com/api/v1/admin/37004/people/15289/block"
                    },
                    "cal": {
                        "href": "http://host.bookingbug.com/ical/person/15289?calid=9739617323"
                    },
                    "overlay_cal": {
                        "href": "https://host.bookingbug.com/api/v1/admin/37004/cal/6"
                    },
                    "schedule": {
                        "href": "https://host.bookingbug.com/api/v1/admin/37004/schedules/48316{?start_date,end_date}",
                        "templated": true
                    },
                    "enabled_services": [
                        {
                            "title": "Service One",
                            "href": "https://host.bookingbug.com/api/v1/admin/37004/services/48323"
                        },
                        {
                            "title": "Service Two",
                            "href": "https://host.bookingbug.com/api/v1/admin/37004/services/48324"
                        }
                    ],
                    "enabled_resources": []
                },
                "_embedded": {},
                "email": "stafftwo@test.com",
                "mobile": "",
                "queuing_disabled": true,
                "person_companies": [
                    37004
                ],
                "ical_link": ""
            }
        ]
    },
    "_links": {
        "self": {
            "href": "https://host.bookingbug.com/api/v1/admin/37004/people?page=1&per_page=300"
        },
        "new": {
            "href": "https://host.bookingbug.com/api/v1/admin/37004/people/new{?signup}",
            "templated": true
        }
    }
}
{
    "total_entries": 2,
    "_embedded": {
        "people": [
            {
                "id": 15288,
                "name": "Staff One",
                "type": "person",
                "deleted": false,
                "disabled": false,
                "company_id": 37004,
                "order": 15288,
                "phone_prefix": "44",
                "_links": {
                    "self": {
                        "href": "https://host.bookingbug.com/api/v1/37004/people/15288"
                    },
                    "items": {
                        "href": "https://host.bookingbug.com/api/v1/37004/items?person_id=15288"
                    },
                    "images": {
                        "href": "https://host.bookingbug.com/api/v1/37004/media/person_images/15288"
                    }
                }
            },
            {
                "id": 15289,
                "name": "Staff Two",
                "type": "person",
                "deleted": false,
                "disabled": false,
                "company_id": 37004,
                "order": 15289,
                "phone_prefix": "44",
                "_links": {
                    "self": {
                        "href": "https://host.bookingbug.com/api/v1/37004/people/15289"
                    },
                    "items": {
                        "href": "https://host.bookingbug.com/api/v1/37004/items?person_id=15289"
                    },
                    "images": {
                        "href": "https://host.bookingbug.com/api/v1/37004/media/person_images/15289"
                    }
                }
            }
        ]
    },
    "_links": {
        "self": {
            "href": "https://host.bookingbug.com/api/v1/37004/people"
        }
    }
}

Above is an example admin cURL call for listing all the staff, 50 per page and only those which are active.

Read Person

The person read method enables you to view a particular staff's information. Once again there are two different ways, the admin and the public.

GET /api/v1/admin/{company_id}/people/{id}
GET /api/v1/{company_id}/people/{id}
curl -X GET -H "App-Id: {app-id}" -H "App-Key: {app-key}" -H "Auth-Token: {auth-token}" 
  -H "Content-Type: application/json" 
  -H "Cache-Control: no-cache"
"https://{host}.bookingbug.com/api/v1/admin/{company_id}/people/{id}"

Above is an example admin cURL call for viewing a person.

Find by reference

You can query the people end-point to find a particular staff with their reference. You must be authenticated as an administrator.

GET /api/v1/admin/{company_id}/people/find_by_ref/{reference}
curl -X GET -H "App-Id: {app-id}" -H "App-Key: {app-key}" -H "Auth-Token: {token-token}"
  -H "Content-Type: application/json" 
  -H "Cache-Control: no-cache"
"https://{host}.bookingbug.com/api/v1/admin/{company_id}/people/find_by_ref/{ref}"
{
    "id": 15288,
    "name": "Staff One",
    "type": "person",
    "deleted": false,
    "disabled": false,
    "company_id": 37004,
    "order": 15288,
    "phone_prefix": "44",
    "_links": {
        "self": {
            "href": "https://host.bookingbug.com/api/v1/admin/37004/people/15288"
        },
        "items": {
            "href": "https://host.bookingbug.com/api/v1/admin/37004/items?person_id=15288"
        },
        "images": {
            "href": "https://host.bookingbug.com/api/v1/37004/media/person_images/15288"
        },
        "companies": [
            {
                "title": "Company Name",
                "href": "https://host.bookingbug.com/api/v1/admin/37004/company"
            }
        ],
        "edit": {
            "href": "https://host.bookingbug.com/api/v1/admin/37004/people/15288/edit"
        },
        "attendance": {
            "href": "https://host.bookingbug.com/api/v1/admin/37004/people/15288/attendance"
        },
        "block": {
            "href": "https://host.bookingbug.com/api/v1/admin/37004/people/15288/block"
        },
        "cal": {
            "href": "http://host.bookingbug.com/ical/person/15288?calid=4060413678"
        },
        "overlay_cal": {
            "href": "https://host.bookingbug.com/api/v1/admin/37004/cal/5"
        },
        "schedule": {
            "href": "https://host.bookingbug.com/api/v1/admin/37004/schedules/48315{?start_date,end_date}",
            "templated": true
        },
        "enabled_services": [
            {
                "title": "Service One",
                "href": "https://host.bookingbug.com/api/v1/admin/37004/services/48323"
            },
            {
                "title": "Service Two",
                "href": "https://host.bookingbug.com/api/v1/admin/37004/services/48324"
            }
        ],
        "enabled_resources": []
    },
    "_embedded": {},
    "email": "staffone@test.com",
    "mobile": "",
    "queuing_disabled": true,
    "reference": "123456",
    "person_companies": [
        37004
    ],
    "ical_link": ""
}

Block time for person

You can block a time slot for a person in their calendar. The following parameters are required start_time and end_time.

PUT /api/v1/admin/{company_id}/people/{id}/block
curl -X GET -H "App-Id: {app-id}" -H "App-Key: {app-key}" -H "Auth-Token: {token-token}"
  -H "Content-Type: application/json" 
  -H "Cache-Control: no-cache"
  -d '{
      "start_time": "2017-09-07T11:00:00",
    "end_time": "2017-09-07T12:00:00"
  }'
"https://{host}.bookingbug.com/api/v1/admin/{company_id}/people/{id}/block"
{
    "id": 22,
    "datetime": "2017-09-07T12:00:00+01:00",
    "end_datetime": "2017-09-07T13:00:00+01:00",
    "full_describe": "Person - Staff One",
    "status": 3,
    "spaces_booked": 0,
    "spaces_reserved": 0,
    "spaces_blocked": 1,
    "num_spaces": 1,
    "spaces_wait": 0,
    "person_id": 15288,
    "duration": 60,
    "duration_span": 3600,
    "company_id": 37004,
    "_links": {
        "self": {
            "href": "https://host.bookingbug.com/api/v1/admin/37004/slots/22"
        },
        "person": {
            "href": "https://host.bookingbug.com/api/v1/admin/37004/people/15288"
        },
        "bookings": {
            "href": "https://host.bookingbug.com/api/v1/admin/37004/bookings?slot_id=22"
        },
        "booking_details": {
            "href": "https://host.bookingbug.com/api/v1/admin/37004/booking_details/?slot_id=22"
        }
    }
}

Above is an example admin cURL call blocking time for a given staff from 11am to 12pm on 7th September 2017.