Christopher_Greene | 2021-03-11 14:49:08 UTC | #1
Hi, REF: /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekId}/schedules/{scheduleId}
For this API call, please share how one acquires the weekID and the scheduleID.
Thank you, Chris
John_Carnell | 2021-03-11 15:03:40 UTC | #2
Hi Christoper,
The weekend is the first day of scheduled week in yyyy-MM-dd format. Dates are represented as an ISO-8601 string. For example: yyyy-MM-dd.
To look up schedule ID you can use the
`GET /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekId}/schedules` endpoint. This will return a list of all of the schedules for the week. The id field is the schedule id.
Thanks, John Carnell Manager, Developer Engagement
Christopher_Greene | 2021-03-11 15:31:42 UTC | #3
Hi John, Are you saying that the weekID is provided by me in the API URI with, for example, 2021-03-06? the 6th being a Saturday. I'm not quite clear on how the weekID is derived.
John_Carnell | 2021-03-11 15:34:27 UTC | #4
Hi Christopher,
The weekId is not a generated value. Instead, the weekId based off of the first day of the week following the IS-8601 format. Most of our ids are generated GUIDs. This one is not, it merely follows the date format of the week you are trying to retrieve for.
Hope that helps.
Thanks, John Carnell Manager - Developer Engagement
Christopher_Greene | 2021-03-11 15:42:59 UTC | #5
So, in Postman, I created this API call: /api/v2/workforcemanagement/businessunits/{business ID}/weeks/2021-03-07/schedules
I provided the literal Business ID where you see {business ID}. I provided the actual date of March 7, 2021. My results was : { "entities": [] }
Is this a legit payload? Did I provide the date correctly? Thank you, C
John_Carnell | 2021-03-11 15:45:55 UTC | #6
Hi Christopher,
That should be correct. Are you typing in the label of the business unit or the GUID?
Thanks, John
Christopher_Greene | 2021-03-11 15:54:20 UTC | #7
I put in the Business Unit ID. But, I replaced the Sunday date of 7 with the Saturday date of 6, and struck gold!
So, in the following excerpt from the Payload: { "entities": [ { "id": "6cdc4d74-99b1-42dd-b03d-243e9c02c6d0",
"weekDate": "2021-03-06",
The ID above must be the schedule ID. Thank you for your help. Chris
John_Carnell | 2021-03-11 16:11:03 UTC | #8
Hi Chris,
No worries. Glad I could help. I was just about to reach out to the WEM team and ask them what they consider start of week.
Thanks, John Carnell Manager, Developer Engagement
system | 2021-04-11 16:20:09 UTC | #9
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 10244