Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Anchor
topOfPage
topOfPage
The Availability API is used to display a list of dates and times that are available for a service or class to be booked. The Availability API is separate from the Working Hours API, although the two are connected, as when a staff person POSTs their workingHours for a particular day he or she is setting up the hours available for work WITHOUT accounting for any other appointments or periods of time off. Availability reads from the workingHours data table to see what hours a person has vacant then subtracts their other time commitments to get the hours they have available, and then organizes those hours into timeslots depending on how long a service or class takes. Since availability lets your clients know when they can sign up for your business' appointments, it is crucial for you to familiarize yourself with how to access availability on your account.


Please note that this API should not be used for displaying a calendar, but only for booking an appointment. 


Info
titleOn this page

Table of Contents





Availability API Endpoints


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)





Availability API Parameters

Data points passed on in the request URL portion of the API call that are used to filter the data being requested. 

ParameterTypeEndpoints to be used withDescription
durationintegerGET /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.

resourceIdintegerGET /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.
startDatestringGET /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.
endDatestringGET /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 API Responses


Code Block
languagejs
titleGET /availability/{YYYY}/{MM}/{staffId}/{locationId}/{reasonId}:
linenumberstrue
collapsetrue
[{
    "businessId": 43111,
    "currentMonth": 1675209600000,
    "endDate": {
        "date": 1708041600000,
        "dateId": null,
        "day": 16,
        "dayOfWeek": 5,
        "month": 2,
        "openSlotCount": 0,
        "year": 2024
    },
    "filledDays": [],
    "locationList": null,
    "month": 2,
    "openDays": [{
       "date": 1676592000000,
       "dateId": null,
       "day": 17,
       "dayOfWeek": 5,
       "month": 2,
       "openSlotCount": 0,
       "year": 2023,
       }],
    "staffList": null,
    "startDate": {
        "date": 1676505600000,
        "dateId": null,
        "day": 16,
        "dayOfWeek": 4,
        "month": 2,
        "openSlotCount": 0,
        "year": 2023
    },
    vacationDays: [],
    year: 2023
}]


Code Block
languagejs
titleGET /availability/{YYYY}/{MM}/{DD}/{staffId}/{locationId}/{reasonId}:
linenumberstrue
collapsetrue
[{
  	"available": true, 	"deletedclientEndDate": false,
	"endDate": null,
	"endTime": 1700,
	"slotCount": 36,
	"slotMax": 36"2023-02-21",
    "clientEndTime": 1450,
    "staffEndTimeclientStartDate": 1700"2023-02-21",
    "staffStartTimeclientStartTime": 1400,
    "startTimeendTime": 14001450,
    	"timeStringstaffEndDate": "02:00 PM - 05:00 PM",
	"units": [{
		"locationId": 81181,
		"professionalId": 82275,
		"reasonId": 158196,
		"resourceId": 2556
	}]
}]
Code Block
languagejs
titleGET /availability/location/{locationId}/service/{reasonId}
linenumberstrue
collapsetrue
[{2023-02-21",
    "staffEndDateTimeUTC": 1677009000000,
    "staffEndTime": 1500,
    "staffStartDate": "2023-02-21",
    "staffStartDateTimeUTC": 1677006000000,
    "staffStartTime": 1400,
    "clusteredstartTime": false1400,
      "timeString": "date"14:00 "2018-12-11- 14:50 America/New_York (14:00 - 14:50 ET)",
    "timeSlotsunits": [{
        "availablebundleResourceIdList": true[2556],
        "clientTimelocationId": 1200282639,
        "deletedprofessionalId": false298660,
        "endDatereasonId": null159330,
        "endTimeresourceId": 130016450,
        "slotCountroundRobin": 12false,
        "slotMaxtandemStaffIdList": 12,null
    }]
}]


Code Block
languagejs
titleGET /availability/location/{locationId}/service/{reasonId}
linenumberstrue
collapsetrue
[{
    "staffEndTimeclustered": 1300false,   
     "staffStartTimedate": 1200,
 "2018-12-11",
      "startTimetimeSlots": 1200,[{
        "timeStringavailable": "12:00 PM - 1:00 PM" true
        "clientTime": 1200,
        "unitsdeleted": [{ 
   false,
        "professionalIdendDate": 41681null,
        "endTime": 1300,
        "locationIdslotCount": 2874512,
        "slotMax": 12,
        "reasonIdstaffEndTime": 937901300,
   
        "resourceIdstaffStartTime": null1200,
         }]"startTime": 1200,
    }],
}]
  • For the class schedule availability endpoint, please refer to the Class Schedule API page.

Availability Object Values

availability/{YYYY}/{MM}/{staffId}/{locationId}/{reasonId}?duration={reason.visitMinutes}

Property nameTypeDescription

businessId

integer

Provides unique numeric ID of the business offering availability. 

currentMonthintegerProvides 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
    "timeString": "12:00 PM - 1:00 PM",
        "units": [{ 
            "professionalId": 41681,
            "locationId": 28745,
            "reasonId": 93790,
            "resourceId": null
         }],
    }],
}]


  • For the class schedule availability endpoint, please refer to the Class Schedule API page.




Availability Object Values

availability/{YYYY}/{MM}/{staffId}/{locationId}/{reasonId}?duration={reason.visitMinutes}

of dates that no longer the locations the dates which still have open slots available and filledPercent below 100 
Property nameTypeDescription

businessId

integer

Provides unique numeric ID of the business offering availability. 

currentMonthintegerProvides 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. 

filledDaysarrayDisplays 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 100Definitions of the properties within an object on this array are defined in the table below. locationList

staffListstringDisplays a list of staff members that have availability. 

monthstartDate

integer

Displays a one or two digit number that indicates the month object

Displays an object containing details about the start date of this period of availability. openDaysDefinitions of the properties within this object are defined in the table below. 

vacationDaysarrayDisplays an array of dates set aside for staff time offDefinitions of the properties within an object on this array are defined in the table below.
staffListstringDisplays 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. 

vacationDaysarrayDisplays 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. 
yearintegerDisplays the year of the specified availability.
Property nameTypeDescriptiondateintegerDisplays the date of the specified day in milliseconds elapsed since January 1, 1970 00:00:00 UTC form. dateIdintegerProvides unique numeric ID for the specified date.dayintegerDisplays as day of the month of the specified date.dayOfWeekintegerDisplays as day of the week of the specified day (where 0=Sunday, 1=Monday, ..., 6=Saturday).monthintegerDisplays as the month of the specified day.openSlotCountintegerProvides the number of open slots of availability for the specified day.yearintegerDisplays as the year of the specified day. 

availability/{YYYY}/{MM}/{DD}/{staffId}/{locationId}/{reasonId}?duration={reason.visitMinutes}

Property nameTypeDescription

available

boolean

Indicates whether or not the specified session of availability is still available. 

deleted

boolean

Indicates whether or not the specified session has been deleted.

endDate

integer

Displays the date that the specified session is set to end.

endTime

integer

Displays as the military time that the specified session ends, not including any buffer. 

staffEndTime
 
yearintegerDisplays the year of the specified availability.


Property nameTypeDescription
dateintegerDisplays the date of the specified day in milliseconds elapsed since January 1, 1970 00:00:00 UTC form. 
dateIdintegerProvides unique numeric ID for the specified date.
dayintegerDisplays as day of the month of the specified date.
dayOfWeekintegerDisplays as day of the week of the specified day (where 0=Sunday, 1=Monday, ..., 6=Saturday).
monthintegerDisplays as the month of the specified day.
openSlotCountintegerProvides the number of open slots of availability for the specified day.
yearintegerDisplays as the year of the specified day. 

availability/{YYYY}/{MM}/{DD}/{staffId}/{locationId}/{reasonId}?duration={reason.visitMinutes}

Property nameTypeDescription
clientEndDatestringDisplays as the date that the specified session ends for clients displayed as YYYY-MM-DD, excludes any buffer. 
clientEndTimeintegerDisplays as the military time that the specified session ends for clients, excludes any buffer. 
clientStartDatestringDisplays as the date that the specified session begins for clients displayed as YYYY-MM-DD, excludes any buffer. 
clientStartTimeintegerDisplays 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. 

staffEndDatestringDisplays as the date that the specified session ends for staff displayed as YYYY-MM-DD, includes any buffer.
staffEndDateTimeUTCinteger

Displays as date & time that the specified session ends for staff in milliseconds elapsed since January 1 1970 UTC format, includes any buffer.

staffEndTimeintegerDisplays as the military time that the specified session ends for staff, includes any buffer. 
staffStartDatestringDisplays as the date that the specified session begins for staff displayed as YYYY-MM-DD, includes any buffer.
staffStartDateTimeUTCintegerDisplays as date & time that the specified session begins for staff in milliseconds elapsed since January 1 1970 UTC format, includes any buffer.
staffStartTimeintegerDisplays as the military time that the specified session ends begins for staff, includes any buffer. 
staffStartTimestartTimeintegerDisplays as the military time that the specified session begins for staff, includes 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 nameTypeDescription

in the table below.


Property nameTypeDescription
bundleResourceIdListarrayProvides unique numeric ID of any resources connected to the specified session of availability in array format.
locationIdintegerProvides unique numeric ID of the location connected to the specified session of availability.
professionalIdintegerProvides unique numeric ID of the staff connected to the specified session of availability. 
reasonIdintegerProvides unique numeric ID of the service connected to the specified session of availability.
resourceIdintegerProvides unique numeric ID of any resource connected to the specified session of availability.
roundRobinbooleanIndicates whether or not staff gets assigned to the specified session of availability via round robin.
tandemStaffIdListarrayProvides unique numeric ID of any tandem staff connected to the specified session of availability in array format.