The Vacation API is used to access, create, and modify the periods of vacation taken on your business' account. The Vacation API is connected to the Locations API, as periods of vacation are used to close a location for a company-wide period of time off, whereas the Time Off API is used by staff to take time off at an individual level.


On this page




Vacation API Endpoints

These are the endpoints that are available under the /vacation path, which shows what hours your locations have been closed down for a vacation. 

Endpoint

Description

GET /vacation/{vacationId}Returns a JSON object for the specified vacation.
POST /vacation

Creates a new vacation object on an account.

Request body/payload: Must pass a vacation object.

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

PUT /vacation/{vacationId}

Updates an existing vacation object.

Request body/payload: Must pass a vacation object with the desired changes made.

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

DELETE /vacation/{vacationId}Removes a vacation object from view by setting its active property to false




Vacation API Parameters

There are no parameters included with vacation calls.




Vacation API Request Body/Payloads


The objects below represent the minimum viable objects to pass that are needed to create or update a vacation 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.

POST /vacation
{
    "businessId": "43111",
    "endDate": "2019-02-14",
    "endTime": "2400",
    "location": {Location object for location of vacation - for more info, see Locations API page},
    "reason": {Reason object for reason of vacation - for more info, see Services API page},
    "repeats": false,
    "staff": null,
    "startDate": "2019-02-14",
    "startTime": "0000",
    "status": "Open"
}
PUT /vacation
{
    "businessId": 43111,
    "color": null,
    "createdDate": "2019-02-11 22:00:52",
    "createdUser": "JoeSchmo",
    "description": null,
    "endDate": "2019-02-14",
    "endTime": 2400,
    "location": {Location object for location of vacation - for more info, see Locations API page},
    "modifiedDate": null,
    "modifiedUser": null,
    "reason": {Reason object for reason of vacation - for more info, see Services API page},
    "startDate": "2019-02-14",
    "startTime": 0,
    "status": "Open",
    "vacationId": 8134274
}




Vacation API Responses

GET /vacation/{vacationId}
{
    "businessId": 43111,
    "color": null,
    "createdDate": "2018-05-16 11:25:44",
    "createdUser": "JoeSchmo",
    "description": "Vacay",
    "endDate": "2018-08-20",
    "endTime": 2400,
    "location": {Location object for location of vacation-see locations API page},
    "reason": {Reason object for reason of vacation-see services API page},
    "staff": null,
    "startDate": "2018-08-06",
    "startTime": 0,
    "status": "Open",
    "vacationId": 8077468
}
POST /vacation
{
    "businessId": "43111",
    "createdDate": "2018-03-14 14:29:45",
    "createdUser": "JoeSchmo",
    "description": "Xmas vacay",
    "endDate": "2019-01-04",
    "endTime": 2400,
    "location": {Location object for location of vacation-see locations API},
    "reason": {Reason object for reason of vacation-see services API},
    "staff": {Staff object for staff of vacation-see staff API},
    "startDate": "2018-12-24",
    "startTime": 0,
    "status": "Open",
    "vacationId": 808042
}
PUT /vacation/{vacationId}
{
    "businessId": 43111,
    "color": "#4C8052",
    "createdDate": "2018-06-07 13:17:44",
    "createdUser": "JoeSchmo"
    "description": "Take some time to be with your families.",
    "endDate": "2018-08-27",
    "endTime": 2400,
    "location": {Location object for location of vacation-see locations API page},
    "modifiedDate": "2018-07-21 12:45:09",
    "modifiedUser": "JoeSchmo"
    "reason": {Reason object for reason of vacation-see services API page},
    "staff": null,
    "startDate": "2018-08-06",
    "startTime": 0,
    "status": "Open",
    "vacationId": 8077468
}




Vacation Object Values

Property nameTypeRequiredWritableDescription
businessIdintegerYes
Provides unique numeric ID of the business offering specified vacation. 
colorstring
YesDisplays any color chosen to override specified vacation on the backoffice calendar.
createdDatestring

Displays as date specified vacation was created as YYYY-MM-DD with time after.

createdUserstring

Displays the username of user who created specified vacation.
descriptionstring
YesDisplays any description that was added to specified vacation.
endDatestringYesYesProvides the date that specified vacation is set to end as YYYY-MM-DD.
endTimeintegerYesYesProvides the time that specified vacation is set to end displayed in military format. Automatically gets set to 2400. 
modifiedDatestring

Displays as date specified vacation was last modified as YYYY-MM-DD with time after.
modifiedUserstring

Displays the username of user who last modified specified vacation.
reasonobjectYesYesDisplays the reason object connected to specified vacation - for more info, see Services API page. 
staffobject
YesDisplays the staff object connected to specified vacation - for more info, see Staff API page. 
startDatestringYesYesProvides the date that specified vacation is set to begin as YYYY-MM-DD.
startTimeintegerYesYes

Provides the time that specified vacation is set to begin displayed in military format. Automatically gets set to 0000.

statusstringYesYesDisplays the status of specified vacation. Possible values include Open, Closed, or Cancelled.
vacationIdintegerYes, on PUT calls
Provides unique numeric ID of specified vacation.