Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 68 Next »

Since the Working Hours API page is very complex and can be a bit confusing, we are including a few examples to illustrate how data gets passed in a few different scenarios to help you get a better handle on how to alter the working hours of service availability offered by your employees and your locations.


Example 1: How to create workingHours that start today and extend indefinitely for a staff person at one location

Say you have a new employee, Jonny Amante, who will be moving into your main office location in mid-August and you want to set up working hours of service availability for him on Mondays from noon until 1 pm starting on August 17 and make that slot of availability never end. Here is what you should do -

First we will show the request payload of the POST call that is made to create the new Working Hours of service availability at the specified location.

POST /workingHours/save/staff/81155?resume=0&preview=false&splitDate=undefined period object:
{
    "endDate": null,
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "lastWeek": false,
    "mon: true,
    "objects": [{
        "days": [{
            "checked": true,
            "times": [{
                "active": true,
                "endTime": 1300,
                "endTimeObj": "2018-08-17 13:00:00",
                "id": 0,
                "resumeDayTimeAfterBreakStarts": false,
                "roomNumber": null,
                "startTime": 1200,
                "startTimeAfterEndTime": false,
                "startTimeObj": "2018-08-17 12:00:00",
                "workScheduleId": null
            }],
            "workday": 1
        }],
        "locationId": 81428,
        "locationName": "Main office",
        "objecttype": "PROFESSIONAL",
        "professionalId": 77961,
        "professionalName": "Johnny Amante",
        "reasonId": null,
        "reasonName": null,
        "resourceId": null,
        "resourceName": null
    }],
    "recurring": false,
    "repeatInterval": null,
    "repeatSchedule": null,
    "sat": false,
    "secondWeek": false,
    "startDate": "2018-08-17",
    "startDateDate": 1534464000000,
    "sun": false,
    "thirdWeek": false,
    "thu": false,
    "tue": false,
    "wed": false
}]

After you create the new period of service availability, all subsequent GET /workingHours calls will return the following period object.

GET /workingHours period object:
[{
    "endDate": null,
    "endDateDate": null,
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "lastWeek": false,
    "mon": false,
    "objects": [{
        "days": [{
            "checked": false,
            "times": [{
                "active": true,
                "endTime": 1300,
                "endTimeObj": "2018-08-17 13:00:00",
                "roomNumber": null,
                "startTime": 1200,
                "startTimeObj": "2018-08-17 12:00:00",
                "workScheduleId": 1413631
            }],
            "workday": 1
        }],
        "locationId": 81428,
        "locationName": "Main office",
        "objecttype": "PROFESSIONAL",
        "professionalId": 77961,
        "professionalName": "Johnny Amante",
        "reasonId": null,
        "reasonName": null,
        "resourceId": null,
        "resourceName": null
    }],
    "recurring": false,
    "repeatInterval": null,
    "repeatSchedule": null,
    "sat": false,
    "secondWeek": false,
    "startDate": "2018-08-17",
    "startDateDate": 1534464000000,
    "sun": false,
    "thirdWeek": false,
    "thu": false,
    "tue": false,
    "wed": false
}]

Example 2: How to edit workingHours for a staff person at one location by editing the start time of a single day

Say your employee Major Hay has service availability at your second office every weekday during the date period of September 5 until September 19 of 2018 from 9 am until 11 am, but he discovers that his partner will be out of town during this time period so he will have to take his daughter to preschool at 9 am on these days. So to accommodate him you want to move the beginning of his availability back half an hour. Here is what you would do -

First we will show the initial period object as returned in the GET call.

GET /workingHours period object:
[{
    "endDate": "2018-09-19",
    "endDateDate": 1537315200000,
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "lastWeek": false,
    "mon": false,
    "objects": [{
        "days": [{
            "checked": false,
            "times": [{
                "active": true,
                "endTime": 1100,
                "endTimeObj": "2018-09-05 11:00:00",
                "roomNumber": null,
                "startTime": 900,
                "startTimeObj": "2018-09-05 09:00:00",
                "workScheduleId": 1418311
            }],
            "workday": 3
        }],
        "locationId": 81125,
        "locationName": "Second Office",
        "objecttype": "PROFESSIONAL",
        "professionalId": 82275,
        "professionalName": "Major Hay",
        "reasonId": null,
        "reasonName": null,
        "resourceId": null,
        "resourceName": null
    }],
    "recurring": false,
    "repeatInterval": null,
    "repeatSchedule": null,
    "sat": false,
    "secondWeek": false,
    "startDate": "2018-09-05",
    "startDateDate": 1536105600000,
    "sun": false,
    "thirdWeek": false,
    "thu": false,
    "tue": false,
    "wed": false
}]

Next we show the request payload of the POST call that is made to update the starting time.

POST /workingHours/save/staff/82275?resume=0&preview=false&splitDate=undefined period object:
[{
    "endDate": "2018-09-19",
    "endDateDate": 1537315200000,
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "inEditableRange": false,
    "lastWeek": false,
    "lessThanOneWeek": false,
    "mon": false,
    "objects": [{
        "days": [{
            "checked": false,
            "editable": true,
            "inEditableRange": true,
            "resumeDayTimeAfterBreakStarts": false,
            "saving": true,
            "startTimeAfterEndTime": false,
            "times": [{
                "active": true,
                "endTime": 1100,
                "endTimeObj": "2018-06-05T15:00:38.627Z",
                "id": 0,
                "resumeDayTimeAfterBreakStarts": false,
                "roomNumber": null,
                "startTime": 930,
                "startTimeAfterEndTime": false,
                "startTimeObj": "2018-06-05T13:30:00.000Z",
                "workScheduleId": 1413811
            }],
            "workday": 3,
        }],
        "locationId": 81125,
        "locationName": "Second Office",
        "objecttype": "PROFESSIONAL",
        "professionalId": 82275,
        "professionalName": "Major Hay",
        "reasonId": null,
        "reasonName": null,
        "resourceId": null,
        "resourceName": null
    }],
    "originalEndDate": "2018-09-19"
    "originalStartDate": "2018-09-05"
    "recurring": false,
    "repeatInterval": null,
    "repeatSchedule": null,
    "sat": false,
    "secondWeek": false,
    "startDate": "2018-09-05",
    "startDateDate": 1536105600000,
    "sun": false,
    "thirdWeek": false,
    "thu": false,
    "tue": false,
    "updating: true,"
    "validDOTW": [],
    "wed": false
}]

And finally we show the period object that gets returned on all subsequent GET calls.

GET /workingHours period object:
[{
    "endDate": "2018-09-19",
    "endDateDate": 1537315200000,
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "lastWeek": false,
    "mon": false,
    "objects": [{
        "days": [{
            "checked": false,
            "times": [{
                "active": true,
                "endTime": 1100,
                "endTimeObj": "2018-09-05 11:00:00",
                "roomNumber": null,
                "startTime": 930,
                "startTimeObj": "2018-09-05 09:30:00",
                "workScheduleId": 1413811
            }],
            "workday": 3
        }],
        "locationId": 81125,
        "locationName": "Second Office",
        "objecttype": "PROFESSIONAL",
        "professionalId": 82275,
        "professionalName": "Major Hay",
        "reasonId": null,
        "reasonName": null,
        "resourceId": null,
        "resourceName": null
    }],
    "recurring": false,
    "repeatInterval": null,
    "repeatSchedule": null,
    "sat": false,
    "secondWeek": false,
    "startDate": "2018-09-05",
    "startDateDate": 1536105600000,
    "sun": false,
    "thirdWeek": false,
    "thu": false,
    "tue": false,
    "wed": false
}]

Example 3:
How to clone a range of service availability for a staff person at one location to a new period of dates

Say your employee Titus Bigly has service availability from July 1 until July 8 in the mornings from 9 until 11, but you have had more people sign up for that time than he can accommodate, so you want to extend his service availability until September 9 (you had a whole bunch of people sign up!). You don't want to extend the working hours he has already set up to avoid confusing the people who signed up for the first week, so you decide to just clone the hours of availability to a new date range. Here is what you would do:

First we will show the initial period object as returned in the GET call.

GET /workingHours period object:
[{
    "endDate": "2018-07-08",
    "endDateDate": 1531008000000,
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "lastWeek": false,
    "mon": false,
    "objects": [{
        "days": [{
            "checked": false,
            "times": [{
                "active": true,
                "endTime": 1100,
                "endTimeObj": "2018-07-01 13:00:00",
                "roomNumber": null,
                "startTime": 900,
                "startTimeObj": "2018-07-01 12:00:00",
                "workScheduleId": 1390854
            }],
            "workday": 1
        }],
        "locationId": 81125,
        "locationName": "Second Office",
        "objecttype": "PROFESSIONAL",
        "professionalId": 81651,
        "professionalName": "Titus Bigly",
        "reasonId": null,
        "reasonName": null,
        "resourceId": null,
        "resourceName": null
    }],
    "recurring": false,
    "repeatInterval": null,
    "repeatSchedule": null,
    "sat": false,
    "secondWeek": false,
    "startDate": "2018-07-01",
    "startDateDate": 1530403200000,
    "sun": false,
    "thirdWeek": false,
    "thu": false,
    "tue": false,
    "wed": false
}]

Next we show the request payload of the POST call that is made to clone this service availability.

POST /workingHours/save/staff/81651?resume=0&preview=false&splitDate=undefined period object:
[{
    "endDate": "2018-09-09",
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "lastWeek": false,
    "mon": false,
    "objects": [{
        "days": [{
            "checked": true,
            "times": [{
                "active": true,
                "endTime": 1300,
                "endTimeObj": "2018-07-01 13:00:00",
                "id": 0,
                "resumeDayTimeAfterBreakStarts": false,
                "roomNumber": null,
                "startTime": 1200,
                "startTimeAfterEndTime": false,
                "startTimeObj": "2018-07-01 12:00:00",
                "workScheduleId": null
            }],
            "workday": 1
        }],
        "locationId": 81125,
        "locationName": "Second Office",
        "objecttype": "PROFESSIONAL",
        "professionalId": 81651,
        "professionalName": "Titus Bigly",
        "reasonId": null,
        "reasonName": null,
        "resourceId": null,
        "resourceName": null
    }],
    "recurring": false,
    "repeatInterval": null,
    "repeatSchedule": null,
    "sat": false,
    "secondWeek": false,
    "startDate": "2018-07-09",
    "sun": false,
    "thirdWeek": false,
    "thu": false,
    "tue": false,
    "wed": false
}]

Finally we show the period object that gets returned on all subsequent GET calls.

GET /workingHours period object:
[{    
    "endDate": "2018-09-09",
    "endDateDate": 1536451200000,
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "lastWeek": false,
    "mon": false,
    "objects": [{
        "days": [{
            "checked": false,
            "times": [{
                "active": true,
                "endTime": 1100,
                "endTimeObj": "2018-07-09 13:00:00",
                "roomNumber": null,
                "startTime": 900,
                "startTimeObj": "2018-07-09 12:00:00",
                "workScheduleId": 1415156
            }],
            "workday": 1,
        }],
        "locationId": 81125,
        "locationName": "Second Office",
        "objecttype": "PROFESSIONAL",
        "professionalId": 81651,
        "professionalName": "Titus Bigly",
        "reasonId": null,
        "reasonName": null,
        "resourceId": null,
        "resourceName": null
    }],
    "recurring": false,
    "repeatInterval": null,
    "repeatSchedule": null,
    "sat": false,
    "secondWeek": false,
    "startDate": "2018-07-09",
    "startDateDate": 1531094400000,
    "sun": false,
    "thirdWeek": false,
    "thu": false,
    "tue": false,
    "wed": false
}]

Example 4:
How to add a location to an existing period object of service availability for a staff person

Say your employee Titus Bigly has service availability set up in Office 1 from noon until 1 pm on Wednesday, June 27, and you get him to agree to offer additional availability at your part-time office later in the afternoon on the same day from 3 until 4:30 pm. Here is what you would do:

First we will show the initial period object as returned in the GET call.

GET /workingHours period object:
[{
    "endDate": "2018-06-27",
    "endDateDate": 1530057600000,
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "lastWeek": false,
    "mon": false,
    "objects": [{
        "days": [{
            "checked": false,
            "times": [{
                "active": true,
                "endTime": 1300,
                "endTimeObj": "2018-06-27 13:00:00",
                "roomNumber": null,
                "startTime": 1200,
                "startTimeObj": "2018-06-27 12:00:00",
                "workScheduleId": 1425077
            }],
            "workday": 3
        }],
        "locationId": 87877,
        "locationName": "Office 1",
        "objecttype": "PROFESSIONAL",
        "professionalId": 81651,
        "professionalName": "Titus Bigly",
        "reasonId": null,
        "reasonName": null,
        "resourceId": null,
        "resourceName": null
    }],
    "recurring": false,
    "repeatInterval": null,
    "repeatSchedule": null,
    "sat": false,
    "secondWeek": false,
    "startDate": "2018-06-27",
    "startDateDate": 1530057600000,
    "sun": false,
    "thirdWeek": false,
    "thu": false,
    "tue": false,
    "wed": false
}]

Next we show the request payload of the POST call that is made to update the working hours of service availability.

POST /workingHours/save/staff/81651?resume=0&preview=false&splitDate=undefined period object:
[{
    "endDate": "2018-06-27",
    "endDateDate": 1530057600000,
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "inEditableRange": false,
    "lastWeek": false,
    "lessThanOneWeek": true,
    "mon": false,
    "objects": [{
        "days": [{
            "checked": false,
            "inEditableRange": false,
            "times": [{
                "active": true,
                "endTime": 1300,
                "endTimeObj": "2018-06-27 13:00:00",
                "roomNumber": null,
                "startTime": 1200,
                "startTimeObj": "2018-06-27 12:00:00",
                "workScheduleId": 1425077
            }],
            "workday": 3
        }],
        "locationId": 87877,
        "locationName": "Office 1",
        "objecttype": "PROFESSIONAL",
        "professionalId": 81651,
        "professionalName": "Titus Bigly",
        "reasonId": null,
        "reasonName": null,
        "resourceId": null,
        "resourceName": null
    }],
    "recurring": false,
    "repeatInterval": null,
    "repeatSchedule": null,
    "resumeDayTimeAfterBreakStarts": false,
    "sat": false,
    "secondWeek": false,
    "startDate": "2018-06-27",
    "startDateDate": 1530057600000,
    "startTimeAfterEndTime": false,
    "sun": false,
    "thirdWeek": false,
    "thu": false,
    "tue": false,
    "validDOTW": [3],
    "wed": false
}]

Finally we show the period object that gets returned on all subsequent GET calls.

GET /workingHours period object:
[{
    "endDate": "2018-06-27",
    "endDateDate": 1530057600000,
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "lastWeek": false,
    "mon": false,
    "objects": [{
        "days": [{
            "checked": false,
            "times": [{
                "active": true,
                "endTime": 1630,
                "endTimeObj": "2018-06-27 16:30:00",
                "roomNumber": null,
                "startTime": 1500,
                "startTimeObj": "2018-06-27 15:00:00",
                "workScheduleId": 1425109
            }],
            "workday": 3
        }],
        "locationId": 81181,
        "locationName": "Beach Office",
        "objecttype": "PROFESSIONAL",
        "professionalId": 81651,
        "professionalName": "Titus Bigly",
        "reasonId": null,
        "reasonName": null,
        "resourceId": null,
        "resourceName": null
    }],
    "recurring": false,
    "repeatInterval": null,
    "repeatSchedule": null,
    "sat": false,
    "secondWeek": false,
    "startDate": "2018-06-27",
    "startDateDate": 1530057600000,
    "sun": false,
    "thirdWeek": false,
    "thu": false,
    "tue": false,
    "wed": false
}]

Example 5:
How to split a date range of service availability into two smaller ranges

Say your employee Mr. Biscuits is running a tutoring program in your downtown office, which is adjacent to the middle school. He has service availability set up on Mondays, Wednesdays, and Fridays from 4 until 5 pm for the entire school year (August 20 until May 17) so the kids can walk over right after school. However, you want to split his availability down the middle to account for the two separate semesters. Here is what you would do:

First we show the initial period object as returned in the GET call.

GET /workingHours period object:
[{
    "endDate": "2019-05-17",
    "endDateDate": 1558051200000,
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "lastWeek": false,
    "mon": false,
    "objects": [{
        "days": [{
            "checked": false,
            "times": [{
                "active": true,
                "endTime": 1700,
                "endTimeObj": "2018-08-20 17:00:00",
                "roomNumber": null,
                "startTime": 1600,
                "startTimeObj": "2018-08-20 16:00:00",
                "workScheduleId": 1420755
            }],
            "workday": 1
        }],
        "locationId": 81353,
        "locationName": "Downtown Office",
        "objecttype": "PROFESSIONAL",
        "professionalId": 80891,
        "professionalName": "Mr. Biscuits",
        "reasonId": null,
        "reasonName": null,
        "resourceId": null,
        "resourceName": null
    }],
    "recurring": false,
    "repeatInterval": null,
    "repeatSchedule": null,
    "sat": false,
    "secondWeek": false,
    "startDate": "2018-08-20",
    "startDateDate": 1534723200000,
    "sun": false,
    "thirdWeek": false,
    "thu": false,
    "tue": false,
    "wed": false
}]

Next we show the request payload of the POST call made to split up the date range.

POST /workingHours/save/staff/80891?resume=undefined&preview=false&splitDate=2019-01-01 period object:
[{
    "endDate": "2019-05-17",
    "endDateDate": 1558051200000,
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "inEditableRange": true,
    "lastWeek": false,
    "lessThanOneWeek": false
    "mon": false,
    "objects": [{
        "days": [{
            "checked": false,
            "inEditableRange": false,
            "times": [{
                "active": true,
                "endTime": 1700,
                "endTimeObj": "2018-08-20 17:00:00",
                "roomNumber": null,
                "startTime": 1600,
                "startTimeObj": "2018-08-20 16:00:00",
                "workScheduleId": 1420754
            }],
            "workday": 1
        }],
        "locationId": 81353,
        "locationName": "Downtown Office",
        "objecttype": "PROFESSIONAL",
        "professionalId": 80891,
        "professionalName": "Mr. Biscuits",
        "reasonId": null,
        "reasonName": null,
        "resourceId": null,
        "resourceName": null
    }],
    "recurring": false,
    "repeatInterval": null,
    "repeatSchedule": null,
    "sat": false,
    "secondWeek": false,
    "startDate": "2018-08-20",
    "startDateDate": 1534723200000,
    "sun": false,
    "thirdWeek": false,
    "thu": false,
    "tue": false,
    "validDOTW": [],
    "wed": false
}]

Finally we show the two new period objects that get returned on all subsequent GET calls.

GET /workingHours period object:
[{
    "endDate": "2018-12-31",
    "endDateDate": 1546214400000,
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "lastWeek": false,
    "mon": false,
    "objects": [{
        "days": [{
            "checked": false,
            "times": [{
                "active": true,
                "endTime": 1700,
                "endTimeObj": "2018-08-20 17:00:00",
                "roomNumber": null,
                "startTime": 1600,
                "startTimeObj": "2018-08-20 16:00:00",
                "workScheduleId": 1420758
            }],
            "workday": 1
        }],
        "locationId": 81353,
        "locationName": "Downtown Office",
        "objecttype": "PROFESSIONAL",
        "professionalId": 80891,
        "professionalName": "Mr. Biscuits",
        "reasonId": null,
        "reasonName": null,
        "resourceId": null,
        "resourceName": null
    }],
    "recurring": false,
    "repeatInterval": null,
    "repeatSchedule": null,
    "sat": false,
    "secondWeek": false,
    "startDate": "2018-08-20",
    "startDateDate": 1534723200000,
    "sun": false,
    "thirdWeek": false,
    "thu": false,
    "tue": false,
    "wed": false
},
{
    "endDate": "2019-05-17",
    "endDateDate": 1546300800000,
    "firstWeek": false,
    "fourthWeek": false,
    "fri": false,
    "lastWeek": false,
    "mon": false,
    "objects": [{
        "days": [{
            checked: false,
            times: [{
                active: true,
                endTime: 1700,
                endTimeObj: "2018-08-20 17:00:00",
                startTime: 1600,
                startTimeObj: "2018-08-20 16:00:00",
                workScheduleId: 1420762
            }],
            workday: 1
        }],
        locationId: 81353,
        locationName: "Downtown Office",
        objecttype: "PROFESSIONAL",
        professionalId: 80891,
        professionalName: "Mr. Biscuits",
        reasonId: null,
        reasonName: null,
        resourceId: null,
        resourceName: null
    }],
    recurring: false,
    repeatInterval: null,
    repeatSchedule: null,
    sat: false,
    secondWeek: false,
    startDate: "2019-01-01",
    startDateDate: 1546300800000,
    sun: false,
    thirdWeek: false,
    thu: false,
    tue: false,
    wed: false
}]

Example 6:
How to add a staff member to the service availability for a location

Say your employee Master J has service availability at your beach office from 10 am until noon on Thursday, June 14. You want to add your employee Dr. J to the service availability, but you want to make him available in the evenings for those customers who cannot make it to the morning session. Here is what you would do:

First we show the initial period object as returned in the GET call.

GET /workingHours period object:
[{
    endDate: "2018-06-14",
    endDateDate: 1528934400000,
    firstWeek: false,
    fourthWeek: false,
    fri: false,
    lastWeek: false,
    mon: false,
    objects: [{
        days: [{
            checked: false,
            times: [{
                active: true,
                endTime: 1200,
                endTimeObj: "2018-06-14 12:00:00",
                startTime: 1000,
                startTimeObj: "2018-06-14 10:00:00",
                workScheduleId: 1389497
            }]
            workday: 4
        }]
        locationId: 81129,
        locationName: "Beach Office",
        objecttype: "PROFESSIONAL",
        professionalId: 82275,
        professionalName: "Master J",
        reasonId: null,
        reasonName: null,
        resourceId: null,
        resourceName: null
    }]
    recurring: false,
    repeatInterval: null,
    repeatSchedule: null,
    sat: false,
    secondWeek: false,
    startDate: "2018-06-14",
    startDateDate: 1528934400000,
    sun: false,
    thirdWeek: false,
    thu: false,
    tue: false,
    wed: false
}]

Next we show the request payload of the POST call that is made to add the staff member.

POST /workingHours/save/location/81129?resume=0&preview=false&splitDate=undefined period object:
[{
    endDate: "2018-06-14",
    endDateDate: 1528934400000,
    firstWeek: false,
    fourthWeek: false,
    fri: false,
    inEditableRange: false,
    lastWeek: false,
    lessThanOneWeek: true,
    mon: false,
    objects: [{
        days: [{
            checked: false,
            times: [{
                active: true,
                endTime: 1200,
                endTimeObj: "2018-06-14 12:00:00",
                startTime: 1000,
                startTimeObj: "2018-06-14 10:00:00",
                workScheduleId: 1389497
            }]
            workday: 4
        }]
        locationId: 81129,
        locationName: "Beach Office",
        objecttype: "PROFESSIONAL",
        professionalId: 82275,
        professionalName: "Master J",
        reasonId: null,
        reasonName: null,
        resourceId: null,
        resourceName: null
    },
{
        days: [{
            checked: false,
            times: [{
                active: true,
                endTime: 1900,
                endTimeObj: "2018-06-14 19:00:00",
                startTime: 1800,
                startTimeObj: "2018-06-14 18:00:00",
            }]
            workday: 4
        }]
        locationId: 81129,
        locationName: "Beach Office",
        objecttype: "PROFESSIONAL",
        professionalId: 81988,
        professionalName: "Dr. J",
        reasonId: null,
        reasonName: null,
        resourceId: null,
        resourceName: null
    }]
    recurring: false,
    repeatInterval: null,
    repeatSchedule: null,
    resumeBreakTimeAfterBreakStarts: false,
    sat: false,
    secondWeek: false,
    startDate: "2018-06-14",
    startDateDate: 1528934400000,
    startTimeAfterEndTime: false,
    sun: false,
    thirdWeek: false,
    thu: false,
    tue: false,
    wed: false
}]

Finally we show the period object that gets returned on all subsequent GET calls.

GET /workingHours period object:
[{
    endDate: "2018-06-14",
    endDateDate: 1528934400000,
    firstWeek: false,
    fourthWeek: false,
    fri: false,
    lastWeek: false,
    mon: false,
    objects: [{
        days: [{
            checked: false,
            times: [{
                active: true,
                endTime: 1200,
                endTimeObj: "2018-06-14 12:00:00",
                startTime: 1000,
                startTimeObj: "2018-06-14 10:00:00",
                workScheduleId: 1389497
            }]
            workday: 4
        }]
        locationId: 81129,
        locationName: "Beach Office",
        objecttype: "PROFESSIONAL",
        professionalId: 82275,
        professionalName: "Master J",
        reasonId: null,
        reasonName: null,
        resourceId: null,
        resourceName: null
    },
{
         days: [{
            checked: false,
            times: [{
                active: true,
                endTime: 1900,
                endTimeObj: "2018-06-14 19:00:00",
                startTime: 1800,
                startTimeObj: "2018-06-14 18:00:00",
                workScheduleId: 1416875
            }]
            workday: 4
        }]
        locationId: 81129,
        locationName: "Beach Office",
        objecttype: "PROFESSIONAL",
        professionalId: 81988,
        professionalName: "Dr. J",
        reasonId: null,
        reasonName: null,
        resourceId: null,
        resourceName: null
    }]
    recurring: false,
    repeatInterval: null,
    repeatSchedule: null,
    sat: false,
    secondWeek: false,
    startDate: "2018-06-14",
    startDateDate: 1528934400000,
    sun: false,
    thirdWeek: false,
    thu: false,
    tue: false,
    wed: false
}]

Example 7:
How to remove the working hours of service availability for one staff person at one location from one date

Say your employee Mr. Biscuits has had service availability set up at your Beach Office from Tuesday, June 19 until Thursday, June 21 from 1 until 2 pm for about a month, but the week before he discovers that he has been chosen for jury duty on Wednesday the 20. So he wants to delete his working hours on that day but still keep his availability on the 19 and 21. Here is what he would do. 

First we will show the initial period object as returned in the GET call.

GET /workingHours period object:
[{
    endDate: "2018-06-21",
    endDateDate: 1529539200000,
    firstWeek: false,
    fourthWeek: false,
    fri: false,
    lastWeek: false,
    mon: false,
    objects: [{
        days: [{
            checked: false,
            times: [{
                active: true,
                endTime: 1400,
                endTimeObj: "2018-06-19 14:00:00",
                startTime: 1300,
                startTimeObj: "2018-06-19 13:00:00",
                workScheduleId: 1429327
            }]
            workday: 2
        },
{
        days: [{
            checked: false,
            times: [{
                active: true,
                endTime: 1400,
                endTimeObj: "2018-06-20 14:00:00",
                startTime: 1300,
                startTimeObj: "2018-06-20 13:00:00",
                workScheduleId: 1429328
            }]
            workday: 3
        },
{
        days: [{
            checked: false,
            times: [{
                active: true,
                endTime: 1400,
                endTimeObj: "2018-06-21 14:00:00",
                startTime: 1000,
                startTimeObj: "2018-06-21 13:00:00",
                workScheduleId: 1429329
            }]
            workday: 4
        }]
        locationId: 81129,
        locationName: "Beach Office",
        objecttype: "PROFESSIONAL",
        professionalId: 82275,
        professionalName: "Mr. Biscuits",
        reasonId: null,
        reasonName: null,
        resourceId: null,
        resourceName: null
    }]
    recurring: false,
    repeatInterval: null,
    repeatSchedule: null,
    sat: false,
    secondWeek: false,
    startDate: "2018-06-19",
    startDateDate: 1529366400000,
    sun: false,
    thirdWeek: false,
    thu: false,
    tue: false,
    wed: false
}]

Next we show the request payload of the POST call that is made to delete this availability.

POST /workingHours/delete period object:
[{
    endDate: "2018-06-21",
    endDateDate: 1529539200000,
    firstWeek: false,
    fourthWeek: false,
    fri: false,
    lastWeek: false,
    lessThanOneWeek: true
    mon: false,
    objects: [{
        days: [{
            checked: false,
            inEditableRange: false
            times: [],
            workday: 2
        },
{
        days: [{
            checked: false,
            inEditableRange: false
            times: [{
                active: true,
                endTime: 1400,
                endTimeObj: "2018-06-19 14:00:00",
                startTime: 1300,
                startTimeObj: "2018-06-19 13:00:00",
                workScheduleId: 1429328
            }]
            workday: 3
        },
{
        days: [{
            checked: false,
            inEditableRange: false
            times: [],
            workday: 4
        }]
        locationId: 81181,
        locationName: "Beach Office",
        objecttype: "PROFESSIONAL",
        professionalId: 80891,
        professionalName: "Mr. Biscuits",
        reasonId: null,
        reasonName: null,
        resourceId: null,
        resourceName: null,
        validDayCounter: 3
    }]
    recurring: false,
    repeatInterval: null,
    repeatSchedule: null,
    sat: false,
    secondWeek: false,
    startDate: "2018-06-19",
    startDateDate: 1529366400000,
    sun: false,
    thirdWeek: false,
    thu: false,
    tue: false,
    validDOTW: [2, 3, 4],
    wed: false
}]

Finally we show the period object that get returned on all subsequent GET calls.

GET /workingHours period object:
[{
    endDate: "2018-06-21",
    endDateDate: 1529539200000,
    firstWeek: false,
    fourthWeek: false,
    fri: false,
    lastWeek: false,
    mon: false,
    objects: [{
        days: [{
            checked: false,
            times: [{
                active: true,
                endTime: 1400,
                endTimeObj: "2018-06-19 14:00:00",
                startTime: 1300,
                startTimeObj: "2018-06-19 13:00:00",
                workScheduleId: 1429327
            }]
            workday: 2
        },
{
        days: [{
            checked: false,
            times: [{
                active: true,
                endTime: 1400,
                endTimeObj: "2018-06-21 14:00:00",
                startTime: 1000,
                startTimeObj: "2018-06-21 13:00:00",
                workScheduleId: 1429329
            }]
            workday: 4
        }]
        locationId: 81129,
        locationName: "Beach Office",
        objecttype: "PROFESSIONAL",
        professionalId: 82275,
        professionalName: "Mr. Biscuits",
        reasonId: null,
        reasonName: null,
        resourceId: null,
        resourceName: null
    }]
    recurring: false,
    repeatInterval: null,
    repeatSchedule: null,
    sat: false,
    secondWeek: false,
    startDate: "2018-06-19",
    startDateDate: 1529366400000,
    sun: false,
    thirdWeek: false,
    thu: false,
    tue: false,
    wed: false
}]
  • No labels

0 Comments

You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.