Retrieve Specifc activity code in WFM schedule

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

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

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

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.