
Brandon Hoppe
I have a two schedules for a group. The Schedule A ends on Tuesday at 9am. The Schedule B begins on Tuesday at 9am.
When calling the API, I've set my startDate to "17/11/15 09:00:00 AM" and my endDate to "17/11/15 01:00:00 PM"
The API returns only Schedule A, which is incorrect. It should return Schedule B, because that is the one on duty during the specified time.
From my testing it appears that if I have two schedules on the same day, no matter what I set the time of day to, it only returns the first schedule of that day.
Am I missing something using the API? Why am I not getting the correct schedule?
0
Comments
Please sign in to leave a comment.
Hi Brandon,
Yea, I see the same thing. It looks like the startDate and endDate need to be in GMT. In my example, I set up a "Day" shift starting at 9 AM and a "Night" shift ending at 9 AM. I did the same startDate and endDate you have there and it returned the Night schedule. But I then used:
<sch:startDate>17/11/15 01:00:00 AM</sch:startDate>
<sch:endDate>17/11/15 05:00:00 AM</sch:endDate>
<sch:includeRecipientDetails>false</sch:includeRecipientDetails>
And it returned the Day shift as expected.
I think this is rather strange considering that all the times in the response payload are in the Group's timezone.
I mentioned in the other thread that we are working on a new REST API, so this should be more sensible in the future.
Let me know how that works for you.
Happy Saturday,
--- Travis
Thanks again Travis. Setting it to GMT time returns the expected results. It would definitely make more sense to use the Group's timezone.
I think the idea is to make it more consistent when making calls. I think all the SOAP operations use GMT for the inbound operations. It could be better called out in the docs though. I'll see if I can get techpubs to make a note.
I also poked through the new REST API for on demand and the current version I peeked at takes GMT, but in a standard format, so it is obvious you are sending via GMT.
I think the confusing part is in the FindWhoIsOnDuty documentation, it has this:
(note that all schedule times are based on the Group’s Time Zone)
So the assumption I was making was to pass in based on the Group's Time Zone. If the doc was updated to say pass in GMT time that would be enough.
Thanks,
Brandon
Thanks for bringing this up, Brandon. I've updated the documentation to indicate that startDate and endDate must be GMT.