Legacy Dev Forum Posts

 View Only

Sign Up

Expand option in Schedules API

  • 1.  Expand option in Schedules API

    Posted 06-05-2025 18:27

    Sathishkumar_J | 2023-08-04 11:36:08 UTC | #1

    Team, I am trying to extract Schedule Ids along with associated agent ids, I tried using expand option available for this API. But it is not fetching any results.

    I am using expand options as -- expand = 'managementUnits.agents'

    Can you please assist?

    API - /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekid}/schedules

    Using Python SDK


    -- create an instance of the API class

    api_instance = PureCloudPlatformClientV2.WorkforceManagementApi();

    -- Get Schedule Ids for Bu

    businessunitid = ['xyz123-234i23'] # example BU id week_id = '2023-07-23' expand = 'managementUnits.agents'

    try: apiresponse = apiinstance.getworkforcemanagementbusinessunitweekschedules(businessunitid, week_id, expand=expand) except:



    Eos_Rios | 2023-08-04 16:18:02 UTC | #2

    You're conflating two separate APIs. You have to call

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

    first, to get the metadata (no expands there), THEN loop through the results calling the very similarly named

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

    with that expands using the schedule ids from the 1st result as the last parameter in the 2nd version.


    Sathishkumar_J | 2023-08-04 16:38:04 UTC | #3

    Thanks a lot, this one works.

    Regards, Sathish


    system | 2023-09-04 16:38:18 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: 21316