Legacy Dev Forum Posts

 View Only

Sign Up

Retrieve all agent schedules

  • 1.  Retrieve all agent schedules

    Posted 06-05-2025 18:27

    ChrisEllis | 2023-08-09 12:57:48 UTC | #1

    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?


    Eos_Rios | 2023-08-09 13:29:20 UTC | #2

    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


    ChrisEllis | 2023-08-09 15:15:45 UTC | #3

    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.


    Eos_Rios | 2023-08-09 16:24:41 UTC | #4

    ChrisEllis, post:3, topic:21416
    Is that expected behaviour?

    So I've been told.


    brian.trezise | 2023-08-10 13:34:50 UTC | #5

    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.


    system | 2023-09-10 13:35:38 UTC | #6

    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: 21416