Jeremy_MONZO | 2023-05-03 16:17:06 UTC | #1
Hello,
I'm looking the best way to retrieve a specific activity code in a WFM published schedule for a entire management unit. After search, 2 API seems retrieve data I need, I mean detail from agent schedule : GET /api/v2/workforcemanagement/managementunits/{managementUnitId}/weeks/{weekId}/schedules/{scheduleId} Note : This API retrieves all the agents from a management unit with details (activitycode, duration,...) in the published schedule but it is deprecated...
or
POST /api/v2/workforcemanagement/managementunits/{managementUnitId}/agentschedules/search Note : I can use also this one put when I fill a userid, I cannot retrieve the detail of the schedule below the output :
{ "status": "Complete", "operationId": "c0fc2d5d-2822-458c-8ec8-0cfe6944054b", "result": { "agentSchedules": [ { "user": { "id": "50305dde-0fe1-4e4a-a2e1-82968bde5fc2", "selfUri": "/api/v2/users/50305dde-0fe1-4e4a-a2e1-82968bde5fc2" }, "shifts": [], "fullDayTimeOffMarkers": [] } ], "businessUnitTimeZone": "Europe/Paris", "publishedSchedules": [ { "id": "3557826d-6028-478a-bcbc-35a2da6a8228", "weekDate": "2023-04-03", "weekCount": 4, "selfUri": "/api/v2/workforcemanagement/businessunits/ef2c8674-7730-4735-a018-0c7d80d96dd1/weeks/2023-04-03/schedules/3557826d-6028-478a-bcbc-35a2da6a8228" } ] } }
So there are 2 API but one is deprecated and the other one has no details.
Is there a way to retrieve the same infromation from the API get but not deprecated? Why the second API (POST) return no result?
thanks jeremy
brian.trezise | 2023-05-04 13:27:00 UTC | #2
The first route that you linked only provides the metadata about the schedule. There is a second route for actually getting the data, here: POST /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekId}/schedules/{scheduleId}/agentschedules/query Search results may come via notification on this topic: v2.workforcemanagement.users.{id}.schedules.query
The second route you listed is indeed deprecated and should not be used by new applications. Instead you should use this route to search for schedules on specific users within a business unit: POST /api/v2/workforcemanagement/businessunits/{businessUnitId}/agentschedules/search Large results may come via notification on this topic: v2.workforcemanagement.users.{id}.schedules.search
Jeremy_MONZO | 2023-05-04 15:21:54 UTC | #3
Hi Brian,
thanks for your feedback.
POST /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekId}/schedules/{scheduleId}/agentschedules/query Result : Ok for this I get the result expected and detail for all agent schedule
POST /api/v2/workforcemanagement/businessunits/{businessUnitId}/agentschedules/search Result : Ok, I has forgotten to fill a valid userid, now I get result.
thanks jeremy
system | 2023-06-04 15:22:02 UTC | #4
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: 19725