Retrieve all agent schedules

Hello,

We are trying to find a way to retrieve all published schedules for agents. I've been trying the endpoint:
/api/v2/workforcemanagement/businessunits/{businessUnitId}/agentschedules/search
This doesn't seem to return any schedules unless userIds are provided although userId is not marked as required, is this expected behaviour?

If so is there a way to retrive all published schedules (can be by businessUnitId or otherwise) without having to generate all userIds to provide in the request body first?

call

GET /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekId}/schedules

first, to get the metadata for all schedules for all BU's then loop through the results calling the very similarly named

GET /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekId}/schedules/{scheduleId}

and/or
POST /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekId}/schedules/{scheduleId}/agentschedules/query

2 Likes

Thanks, we've got it working this way but are facing this issue:

Say we have a 6 week schedule starting on 2023-07-23, the first call to:
https://developer.genesys.cloud/devapps/api-explorer-standalone#get-api-v2-workforcemanagement-businessunits--businessUnitId--weeks--weekId--schedules
Will work for 5 weeks from the 23rd, but the next 2 calls will fail if not called with the weekId that the schedule starts on. Is that expected behaviour? Just trying to understand how it works.

So I've been told.

A clarification: The week ID is part of a composite ID of the schedule itself, it's not a variable. It's necessary for the back end to look up the schedule you're requesting; if you specify a week ID other than the start date of the schedule you want then the back end will return a 404 Not Found because the composite ID you specified does not exist.

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