Versions Compared

Key

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

Anchor
topOfPage
topOfPage
The Class Schedule API is used to access, create, and modify the class sessions on your business' account. The Class Schedule API is connected to the Locations and Staff APIs, in that class schedules can be optionally filtered depending on which staff and/or location was chosen for them. These also make up a separate set of endpoints from the Services API, since TimeTap treats class time slots differently than service time slots, as unlike in the case of services multiple customers can book a single class. 


Info
titleOn this page

Table of Contents





Class Schedule API Endpoints


These are the endpoints that are available under the /classschedule path, which shows any schedules you have set up for the class sessions you offer.

Endpoint

Description

GET /classschedule/staff/{staffId}

Returns all classSchedule objects for specified staff member in array format.

GET /classschedule/location/{locationId}Returns all classSchedule objects for specified location in array format.
GET /classschedule/class/{classId}

Returns all classSchedule objects for specified class in array form. 

These first three endpoints all return the same responses, just sort the data differently before they return.

GET /classschedule/list/{status}/{staffIdList}

Returns all classSchedule objects modified by the parameters included in the call in array format. 

Acceptable status names: Open, Closed, Cancelled.

GET /classschedule/{classscheduleId}Returns a classSchedule object for specified class schedule.
GET /classschedule/{YYYY}/{MM}/{DD}/{staffId}/{locationId}/{reasonId}

Returns an array of classSchedule objects that have availability during specified day, month, and year for the specified staff, location, and reason.

POST /classschedule

Edits a single classSchedule object. This is the method used to change a class session's status from Open to Closed or Cancelled.

Request body/payload: Pass a classSchedule object with the classScheduleId included.

For these calls, you need to pass a classSchedule object with all required fields and any fields you want to update filled in in the body of the payload. We have an example of a classSchedule object in the responses section below and have indicated the required fields in the object values table at the bottom of this page.

PUT /classschedule

Creates a new classSchedule object on an account.

Request body/payload: Pass a classSchedule object with all required objects defined.

For these calls, you need to pass a classSchedule object with all required fields and any fields you want to set filled in in the body of the payload. We have an example of a classSchedule object in the responses section below and have indicated the required fields in the object values table at the bottom of this page.

POST /classschedule/{classscheduleId}/moveTo/{toClassScheduleId}Moves a list of appointmentIds calendarIds from one class schedule to another.





Class Schedule API Parameters

Data points passed on in the request URL portion of the API call that are used to filter the data being requested. To aid with page load time, we have included pageNumber and pageSize parameters for server side pagination. 

Parameters

TypeEndpoints to be used with

Description

startDatestringGET /classschedule/listShould be set as start date of class schedules to be returned, formatted as YYYY-MM-DD. 
endDatestringGET /classschedule/listShould be set as end date of class schedules to be returned, formatted as YYYY-MM-DD. 
pageNumberintegerGET /classschedule

Works with the pageSize parameter to determine how data gets returned following a GET call. The pageNumber value represents the number of pages on which the class sessions that get returned appear.

pageSizeintegerGET /classschedule

Works with the pageNumber parameter to determine how data gets returned following a GET call. The pageSize value represents the number of class sessions appearing on each page of class sessions that gets returned.

locationIdListinteger arrayGET /classschedule/list

Comma-separated list of locationIds connected to the class sessions you want returned. If you pass this value as null, class sessions for all locations will get returned.

reasonIdListinteger arrayGET /classschedule/listComma-separated list of reasonIds connected to the class sessions you want returned. Must be reasons of reasonType=CLASS. 
locationGroupIdListinteger arrayGET /classschedule/list, GET /classschedule/{YYYY}/{MM}/{DD}/{staffId}/{locationId}/{reasonId}Comma-separated list of locationGroupIds connected to the class sessions you want returned. If you pass this value as null, class sessions for all location groups will get returned. If you do not have any location groups on your account, there is no need to pass this parameter. 
statusListstring arrayGET /classscheduleComma-separated list of statuses of the class schedules you want returned. Has acceptable values of Open, Closed, and Cancelled. 
sendConfirmationToClientbooleanPOST /classscheduleIf set to true, an email will automatically be sent to all clients scheduled for the class session being edited.
sendConfirmationToStaffbooleanPOST /classscheduleIf set to true, an email will automatically be sent to all staff scheduled for the class session being edited.
bufferAfterintegerPUT /classschedule, POST /classschedule/verifyResourceShould be set as how much of a buffer you choose to add after each class session if you have multiple sessions between the startTime and endTime.
cloneintegerPUT /classschedule, POST /classschedule/verifyResourceIf you choose to add multiple class sessions between the startTime and endTime this will register as 1. Otherwise it is 0. 
durationintegerPUT /classschedule, POST /classschedule/verifyResourceShould be set as the number of minutes taken by the class session that is being edited or created. 
includeClosedbooleanGET /classschedule/{YYYY}/{MM}/{DD}/{staffId}/{locationId}/{reasonId}Flag for whether or not closed class sessions will return following the GET call.
clientIdintegerGET /classschedule/{YYYY}/{MM}/{DD}/{staffId}/{locationId}/{reasonId}Should be set as the unique numeric ID for client connected to class sessions to return following the GET call.
waitListModestring

appointmentIdsintegerPOST /classschedule/{classscheduleId}/moveTo/{toClassScheduleId}Should be set as a list of appointmentIds to be moved between class schedules.





Class Schedule API Request Body/Payloads

The objects below represent the minimum viable objects to pass that are needed to create or update a classSchedule object. Check whether or not a property can be written to by looking at the Object Values table below to see if the property is writable.

Code Block
languagejs
titlePOST /classschedule
linenumberstrue
collapsetrue
{
    "active": true,
    "additionalStaffIdList": null,
    "blockStaffIdList": [],
    "blockedStaffList": [],
    "businessId": 43111,
    "cancelReason": "",
    "cb": true,
    "changeReason": null,
    "classScheduleId": 34432802,
    "color": null,
    "coordinatorStaff": {Staff object for coordinator staff of class schedule - see Staff API page},
    "courseSession": null,
    "currentCapacity": 0,
    "date": "2019-02-07",
    "dateId": null,
    "endTime": 1200,
    "fields": [{Fields object for scheduler fields of class schedule - see Scheduler Fields API page}],
    "hideGuestOption": null,
    "location": {Location object for location of class schedule},
    "locationGroup": null,
    "locationSuperGroup": null,
    "maxCapacity": 8,
    "reason": {reasonId: 434637, professionalId: null, businessId: 43111, visitMinutes: 180,…},
    "recurringScheduleId": 519273,
    "resource": {Resource object for object of class schedule - see Resources API page},
    "roomNumber": "B-13",
    "selected": false,
    "showOpenSlots": true,
    "staff": {professionalId: 298660, fullName: "Coco moe", userName: "COCOMOE",…},
    "startTime": 900,
    "status": "Cancelled",
    "timeInClientTz": null,
    "timeInStaffTz": null
}


Code Block
languagejs
titlePUT /classschedule
linenumberstrue
collapsetrue
{
    "active": true,
    "coordinatorStaff": {Staff object for coordinator staff of class schedule - see Staff API page},
    "currentCapacity": 0,
    "date": "2019-02-19",
    "endTime": "1100",
    "fields": [{Fields object for scheduler field of class schedule - see Scheduler Fields API page}]
    "hideGuestOption": true,
    "location": {Location object for location of class schedule - see Locations API page},
    "locationGroup": null,
    "locationSuperGroup": null,
    "maxCapacity": "4",
    "multipleSessionBuffer": 0,
    "reason": {Reason object for reason of class schedule - see Services API page},
    "resource": {Resource object for resource of class schedule - see Resources API page},
    "staff": {Staff object for staff of class schedule - see Staff API page},
    "startTime": "0800"
}





Class Schedule API Responses


Code Block
languagejs
titleGET /classschedule/staff/{stafffId}
linenumberstrue
collapsetrue
[{
    "active": true,
    "additionalStaffIdList": [77961, 81988],
    "blockedStaffIdList": [77961, 81988],
    "blockedStaffList": [
        "active": true,
        "businessId": 43111,
        "description": null,
        "email": null,
        "fullName": "Dr. J",
        "imageUrl": null,
        "internalDisplayName": "Dr. J",
        "internalName": null,
        "parentBusinessId": null,
        "professionalId": 81988,
        "userName": "DRJ54"
],
    "cancelReason": null,
    "changeReason": null,
    "classScheduleId": 33588204,
    "color": null,
    "coordinatorStaff": null,
    "courseSession": null,
    "currentCapacity": 0,
    "date": "2018-06-25",
    "endTime": 930,
    "fields": [{Fields object for scheduler field of class schedule - see Scheduler Fields API page}],
    "hideGuestOption": null,
    "location": {Location object for location of class schedule - see Locations API page},
    "locationGroup": null,
    "locationSuperGroup": null,
    "maxCapacity": 10,
    "reason": {Reason object for service of class schedule - see Services API page},
    "recurringScheduleId": null,
    "resource": null,
    "roomNumber": "1",
    "showOpenSlots": true,
    "staff": {Staff object for staff of class schedule - see Staff API page},
    "startTime": 900,
    "status": "Open",
}]


Code Block
languagejs
titleGET /classschedule/location/{locationId}
linenumberstrue
collapsetrue
[{
    "active": true,
    "additionalStaffIdList": null,
    "blockedStaffIdList": [],
    "blockedStaffList": [],
    "cancelReason": null,
    "changeReason": null,
    "classScheduleId": 33588204,
    "color": null,
    "coordinatorStaff": null,
    "courseSession": null,
    "currentCapacity": 0,
    "date": "2018-06-25",
    "dateId": null,
    "endTime": 930,
    "fields": [{Fields object for scheduler field of class schedule - see Scheduler Fields API page}],
    "hideGuestOption": null,
    "location": {Location object for location of class schedule - see Locations API page},
    "locationGroup": null,
    "locationSuperGroup": null,
    "maxCapacity": 10,
    "reason": {Reason object for services of class schedule - see Services API page},
    "recurringScheduleId": null,
    "resource": null,
    "roomNumber": "1",
    "showOpenSlots": true,
    "staff": {Staff object for staff of class schedule - see Staff API page},
    "startTime": 900,
    "status": "Open",
}]


Code Block
languagejs
titleGET /classschedule/class/{classId}
linenumberstrue
collapsetrue
[{
    "active": true,
    "additionalStaffIdList": null,
    "blockedStaffIdList": [],
    "blockedStaffList": [],
    "cancelReason": null,
    "changeReason": null,
    "classScheduleId": 33594740,
    "color": null,
    "coordinatorStaff": null,
    "courseSession": null,
    "currentCapacity": 0,
    "date": "2018-11-07",
    "endTime": 1430,
    "fields": [{Fields object for scheduler field of class schedule - see Scheduler Fields API page}],
    "hideGuestOption": null,
    "location": {Location object for location of class schedule - see Locations API page},
    "locationGroup": null,
    "locationSuperGroup": null,
    "maxCapacity": 10,
    "reason": {Reason object for service of class schedule - see Services API page},
    "recurringScheduleId": null,
    "resource": {Resource object for resource of class schedule - see Resources API page},
    "roomNumber": "1",
    "showOpenSlots": true,
    "staff": {Staff object for staff of class schedule - see Staff API page},
    "startTime": 1410,
    "status": "Open",
}]


Code Block
languagejs
titleGET /classschedule/list/{status}/{staffIdList}
linenumberstrue
collapsetrue
[{
    "active": true,
    "additionalStaffIdList": null,
    "blockedStaffIdList": [],
    "blockedStaffList": [],
    "cancelReason": null,
    "changeReason": null,
    "classScheduleId": 33594740,
    "color": null,
    "coordinatorStaff": null,
    "courseSession": null,
    "currentCapacity": 0,
    "date": "2018-11-07",
    "endTime": 1430,
    "fields": [{Fields object for scheduler field of class schedule - see Scheduler Fields API page}],
    "hideGuestOption": null,
    "location": {Location object for location of class schedule - see Locations API page},
    "locationGroup": null,
    "locationSuperGroup": null,
    "maxCapacity": 12,
    "reason": {Reason object for service of class schedule - see Services API page},
    "recurringScheduleId": null,
    "resource": null,
    "roomNumber": "1",
    "showOpenSlots": true,
    "staff": {Staff object for staff of class schedule - see Staff API page},
    "startTime": 1410,
    "status": "Open",
}]


Code Block
languagejs
titleGET /classschedule/{classScheduleId}
linenumberstrue
collapsetrue
{
    "active": true,
    "additionalStaffIdList": null,
    "blockedStaffIdList": [],
    "blockedStaffList": [],
    "cancelReason": null,
    "changeReason": null,
    "classScheduleId": 33594703,
    "color": null,
    "coordinatorStaff": null,
    "courseSession": null,
    "currentCapacity": 0,
    "date": "2019-01-02",
    "endTime": 1400,
    "fields": [{Fields object for scheduler field of class schedule - see Scheduler Fields API page}],
    "hideGuestOption": null,
    "location": {Location object for location of class schedule - see Locations API page},
    "locationGroup": null,
    "locationSuperGroup": null,
    "maxCapacity": 25,
    "reason": {Reason object for service of class schedule - see Services API page},
    "recurringScheduleId": null,
    "resource": null,
    "roomNumber": null,
    "showOpenSlots": true,
    "staff": {Staff object for staff of class schedule - see Staff API page},
    "startTime": 1100,
    "status": "Open",
}


Code Block
languagejs
titleGET /classschedule/{YYYY}/{MM}/{DD}/{staffId}/{locationId}/{reasonId}
linenumberstrue
collapsetrue
[{
    "active": true,
    "additionalStaffIdList": null,
    "blockedStaffIdList": [],
    "blockedStaffList": null,
    "businessId": 43111,
    "cancelReason": null,
    "changeReason": null,
    "classScheduleId": 33609577,
    "color": null,
    "coordinatorStaff": {Staff object for coordinator staff of class schedule - see Staff API},
    "courseSession": null,
    "currentCapacity": 0,
    "date": "2018-09-12",
    "dateId": null,
    "endTime": 1630,
    "fields": null,
    "hideGuestOption": null,
    "location": {Location object for location of class schedule - see Locations API page},
    "locationGroup": null,
    "locationSuperGroup": null,
    "maxCapacity": 15,
    "reason": {Reason object for services of class schedule - see Services API page},
    "recurringScheduleId": 471284,
    "resource": null,
    "roomNumber": "1",
    "selected": false,
    "showOpenSlots": true,
    "staff": {Staff object for staff of class schedule - see Staff API page},
    "startTime": 900,
    "status": "Open",
    "timeInClientTz": null,
    "timeInStaffTz": null
}]


Code Block
languagejs
titlePOST /classschedule
linenumberstrue
collapsetrue
{
    "active": true,
    "additionalStaffIdList": null,
    "blockedStaffIdList": [],
    "blockedStaffList": [],
    "businessId": 43111,
    "cancelReason": null,
    "cb": true,
    "changeReason": "",
    "classScheduleId": 33593416,
    "color": null,
    "coordinatorStaff": {Staff object for coordinator staff of class schedule - see Staff API page},
    "courseSession": null,
    "currentCapacity": 1,
    "date": "2018-07-06",
    "endTime": 1420,
    "fields": [{Fields object for scheduler field of class schedule - see Scheduler Fields API page},],
    "hideGuestOption": null,
    "location": {Location object for location of class schedule - see Locations API page},
    "locationGroup": null,
    "locationSuperGroup": null,
    "maxCapacity": 9,
    "reason": {Reason object for service of class schedule - see Services API page},
    "recurringScheduleId": 465806,
    "resource": null,
    "roomNumber": "201",
    "showOpenSlots": true,
    "staff": {Staff object for staff of class schedule - see Staff API page},
    "startTime": 1400,
    "status": "Open",
}





Class Schedule Object Values


Property nameTypeRequiredWritableDescription
activebooleanYes
Indicates whether or not the class should return in any GET calls.
additionalStaffIdListarray
YesDisplays staffIds for any additional staff members you add to the class so they cannot otherwise be booked for this time slot. 
blockStaffIdListarray
YesDisplays staffIds for any additional staff members you have added so they cannot be otherwise booked for this time slot. Whatever IDs are added to the additionalStaffIdList are automatically also added to the blockStaffIdList. The blockStaffIdList is used to automatically block off staff across child accounts in our enterprise set up model.
blockedStaffListarray
YesDisplays full staff objects for any additional staff members you have added in the blockStaffIdList or additionalStaffIdList.
businessIdintegerYes
Provides unique numeric ID of the business offering specified class schedule.
cancelReasonstring
YesDisplays any reason given for cancelling a class session.
changeReasonstring
YesDisplays any reason given for changing a class session.

classScheduleId

integer

Yes, on POST calls

Provides unique numeric ID for specified class schedule. 

color

string


Yes

Displays any color chosen to override class sessions on the backoffice calendar.

coordinatorStaffobject
YesDisplays staff object for the staff member that is listed as coordinator staff for this class. The coordinator staff's schedule is not blocked like the schedules for staff members in the additionalStaffIdList are. For more info, see Staff API page.
courseSessionobject

If the classSchedule is assigned to a reason that is reasonType=COURSE instead of reasonType=CLASS, then the courseSession object is filled in with the session of the course set that the classSchedule represents.
currentCapacityinteger
YesDisplays current number of client slots filled for specified class.
datestringYes
Displays as string representation of the date the class session is taking place. Written as YYYY-MM-DD. 
endTimeintegerYesYesProvides the time specified class ends displayed in military format. 
fieldsarray
YesDisplays an array of any custom field objects you have added during the class schedule setup.
hideGuestOptionboolean
YesIf under Settings > Client Information you have the "Additional Guests in Class Bookings" allowed, but for this specific classSchedule you do not want that option to show, set this to FALSE.
locationobjectYesYes

Displays the location object assigned to the specified class session - for more info, see Locations API page.

locationGroupobject
YesIf you assign the class session to a specific location group, then this would be the object of that location group - for more info, see Groups API page.

locationSuperGroup

object
YesIf you assign the class session to a specific location super group, then this would be the object of that location super group.
maxCapacityintegerYes
Displays the maximum number of slots open for specified class session.
reasonobjectYes
Displays the reason object for a service connected to the specified class schedule - for more info, see Services API page.

recurringScheduleId

integer



If the class session is an instance of a recurring class schedule, this field will contain the unique ID for that recurring class schedule.

resourceobject
YesDisplays the resource object assigned to the specific class - for more info, see Resources API page.
roomNumberstring
YesIf there is a specific room or place at the location where the class is held, this field will contain that value.

showOpenSlots

boolean


Yes

Indicates whether or not customers who are booking will be able to see how many open slots are left in the class on the scheduler.

staffobjectYesYesDisplays the staff object for a staff member connected to specified class schedule - for more info, see Staff API page. 
startTimeintegerYesYesProvides the time specified class session starts displayed in military format. 
statusstring
YesDisplays the status of class session. Possible values include Open, Closed, or Cancelled.