Availability
These are the endpoints that are available under the /availability path, which show what hours your business has available to take new appointments.
Endpoint | Description |
---|---|
GET /availability/{YYYY}/{MM}/{staffId}/{locationId}/{reasonId}?duration={reason.visitMinutes} | Returns an object with properties that can be used to determine what days in the specified month a staff person has availability to fit an appointment with specified staffId, locationId, and reasonId, and with the duration passed as a parameter. This API call only provides the dates that offer open timeslots, and does not accurate calculation for each slot. Use the GET /availability/{YYYY}/{MM}/{DD}/{staffId}/{locationId}/{reasonId} call to provide information about the details for that day. Can be used with reasonTypes of both SERVICE and CLASS. |
GET /availability/{YYYY}/{MM}/{DD}/{staffId}/{locationId}/{reasonId}?duration={reason.visitMinutes} | Returns an array of timeslot objects that display the times during the chosen day that the specified staff person has available to take an appointment for specified service at specified location. Can be used with reasonType of SERVICE. A separate endpoint should be used when determining timeslots for classes, since classes allow multiple customers to book for the same time slot. Please read our classschedule API documentation here. |
GET /availability/location/{locationId}/service/{reasonId} | Returns the dates of availability for all staff for the specified location and service in array format. Requires parameters startDate and endDate (described in table below) |
Data points passed on in the request URL portion of the API call that are used to filter the data being requested.
Parameter | Type | Endpoints to be used with | Description |
---|---|---|---|
duration | integer | GET /availability/{YYYY}/{MM}/{staffId}/{locationId}/{reasonId}, GET /availability/{YYYY}/{MM}/{DD}/{staffId}/{locationId}/{reasonId} | Is set to the duration of the reason that you are looking to get the availability for. Typically this is the reason’s visitMinutes property but if the reason is a multi-duration service that has a durationList it could be any of the durations in the durationList. The data that is sent back from the availability GET calls when the duration parameter is filled in is filtered to make sure the appointment slots could accommodate this duration. |
resourceId | integer | GET /availability/{YYYY}/{MM}/{staffId}/{locationId}/{reasonId}, GET /availability/{YYYY}/{MM}/{DD}/{staffId}/{locationId}/{reasonId} | Is set to the resourceId you want to use for this appointment. The response in the GET call will be used to make sure that the days and timeslots sent back are when the resource is free and available for the appointment. |
startDate | string | GET /availability/location/{locationId}/service/{reasonId} | This parameter is required on this endpoint. Should be set to the start date of the range of dates that you want availability to return for. Must be passed as YYYY-MM-DD. |
endDate | string | GET /availability/location/{locationId}/service/{reasonId} | This parameter is required on this endpoint. Should be set to the end date of the range of dates that you want availability to return for. Must be passed as YYYY-MM-DD. |
availability/{YYYY}/{MM}/{staffId}/{locationId}/{reasonId}?duration={reason.visitMinutes}
Property name | Type | Description |
---|---|---|
businessId | integer | Provides unique numeric ID of the business offering availability. |
currentMonth | integer | Provides current month as calculated by milliseconds elapsed since January 1, 1970 00:00:00 UTC form. |
endDate | object | Displays an object containing details about the end date of this period of availability. Definitions of the properties within this object are defined in the table below. |
filledDays | array | Displays an array of of dates that no longer have open slots available. Definitions of properties within an object on this array are defined in the table below. |
locationList | string | Displays a list of the locations that have availability. |
month | integer | Displays a one or two digit number that indicates the month of availability. |
openDays | array | Displays an array of the dates which still have open slots available and filledPercent below 100. Definitions of the properties within an object on this array are defined in the table below. |
staffList | string | Displays a list of staff members that have availability. |
startDate | object | Displays an object containing details about the start date of this period of availability. Definitions of the properties within this object are defined in the table below. |
vacationDays | array | Displays an array of dates set aside for staff time off. Definitions of the properties within an object on this array are defined in the table below. |
year | integer | Displays the year of the specified availability. |
Property name | Type | Description |
---|---|---|
date | integer | Displays the date of the specified day in milliseconds elapsed since January 1, 1970 00:00:00 UTC form. |
dateId | integer | Provides unique numeric ID for the specified date. |
day | integer | Displays as day of the month of the specified date. |
dayOfWeek | integer | Displays as day of the week of the specified day (where 0=Sunday, 1=Monday, ..., 6=Saturday). |
month | integer | Displays as the month of the specified day. |
openSlotCount | integer | Provides the number of open slots of availability for the specified day. |
year | integer | Displays as the year of the specified day. |
availability/{YYYY}/{MM}/{DD}/{staffId}/{locationId}/{reasonId}?duration={reason.visitMinutes}
Property name | Type | Description |
---|---|---|
clientEndDate | string | Displays as the date that the specified session ends for clients displayed as YYYY-MM-DD, excludes any buffer. |
clientEndTime | integer | Displays as the military time that the specified session ends for clients, excludes any buffer. |
clientStartDate | string | Displays as the date that the specified session begins for clients displayed as YYYY-MM-DD, excludes any buffer. |
clientStartTime | integer | Displays as the military time that the specified session begins for clients, excludes any buffer. |
endTime | integer | Displays as the military time that the specified session ends, excludes any buffer. |
staffEndDate | string | Displays as the date that the specified session ends for staff displayed as YYYY-MM-DD, includes any buffer. |
staffEndDateTimeUTC | integer | Displays as date & time that the specified session ends for staff in milliseconds elapsed since January 1 1970 UTC format, includes any buffer. |
staffEndTime | integer | Displays as the military time that the specified session ends for staff, includes any buffer. |
staffStartDate | string | Displays as the date that the specified session begins for staff displayed as YYYY-MM-DD, includes any buffer. |
staffStartDateTimeUTC | integer | Displays as date & time that the specified session begins for staff in milliseconds elapsed since January 1 1970 UTC format, includes any buffer. |
staffStartTime | integer | Displays as the military time that the specified session begins for staff, includes any buffer. |
startTime | integer | Displays as the military time that the specified session begins, excludes any buffer. |
timeString | string | Provides a string display of the start and end times of the specified session, using AM/PM format. |
units | array | Ties the staff, location, reason, and resource to the availability slot. Definitions of the properties within an object on this array are defined in the table below. |
Property name | Type | Description |
---|---|---|
bundleResourceIdList | array | Provides unique numeric ID of any resources connected to the specified session of availability in array format. |
locationId | integer | Provides unique numeric ID of the location connected to the specified session of availability. |
professionalId | integer | Provides unique numeric ID of the staff connected to the specified session of availability. |
reasonId | integer | Provides unique numeric ID of the service connected to the specified session of availability. |
resourceId | integer | Provides unique numeric ID of any resource connected to the specified session of availability. |
roundRobin | boolean | Indicates whether or not staff gets assigned to the specified session of availability via round robin. |
tandemStaffIdList | array | Provides unique numeric ID of any tandem staff connected to the specified session of availability in array format. |