Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Question about staffingrequirement api

    Posted 6 days ago

    Hello, I have a question about this API : 

    /api/v2/workforcemanagement/businessunits/{businessUnitId}/weeks/{weekDateId}/shorttermforecasts/{forecastId}/staffingrequirement

    with expand : effectiveStaffPerInterval

    When I retrieve the JSON for the requirements, the 'effectiveStaffPerInterval' data is always empty, even though I have an agent scheduled for the week in question.

    I expected to find the forecasts in the 'staffingRequirementPerInterval' array, and the staffing schedule in terms of workforce in 'effectiveStaffPerInterval' (so 1 on all interval).

    Can you explain what might be wrong with my understanding?

    Regards.


    #PlatformAPI
    #PlatformSDK

    ------------------------------
    Stéphane Labrune
    NA
    ------------------------------


  • 2.  RE: Question about staffingrequirement api

    Posted 5 days ago

    hi @Stéphane Labrune,

    I think the confusion may come from the meaning of effectiveStaffPerInterval.
     
    The staffingRequirementPerInterval section contains the staffing demand calculated from the forecast (required staff to meet the service objectives).
     
    However, effectiveStaffPerInterval does not simply reflect the existence of scheduled agents. It represents the effective staffing that WFM associates with the forecast and planning groups after schedule calculations have been performed. If the forecast is not linked to a schedule scenario that has been calculated/published, or if there is no staffing data available for the associated planning group, the array may be returned empty even when agents have shifts scheduled.
     
    A few things I would verify:
     
    The agent is scheduled in the same Business Unit and Planning Group used by the forecast.
    The schedule has been generated and published for the week in question.
    The forecast used in the API call is the same forecast associated with the schedule.
    The user/API client has permission to access both forecasting and scheduling data.
     
    As a test, compare the result with the staffing information shown in the WFM Staffing Requirements view. If the UI displays effective staffing but the API still returns an empty array, it may indicate a limitation or defect worth raising with Genesys support.

     



    ------------------------------
    Cesar Padilla
    INDRA COLOMBIA
    ------------------------------



  • 3.  RE: Question about staffingrequirement api

    Posted 5 days ago
      |   view attached

    Thank you for your reply. 

    Here's a screenshot of what I see in the UI.

    Based on the analysis of the API calls made by the UI, the response from the 'staffingRequirement' call only returns the staffingRequirementPerInterval section.

    The UI also calls the agentschedules/query API. I have the impression that the UI uses the result to calculate the 'scheduled' and the 'difference'."

    Call API by the IHM :

    https://api.mypurecloud.de/api/v2/workforcemanagement/businessunits/buid/weeks/weeid/shorttermforecasts/forecastid/staffingrequirement?expand=results.planningGroupStaffingRequirements.effectiveStaffPerInterval

    I think i unterstand my problem, the "scheduled" is based on bussinessUnit and managementUnit whereas "RequiredStaff" is based on businessUnit and PlanningGroup 



    ------------------------------
    Stéphane Labrune
    NA
    ------------------------------



  • 4.  RE: Question about staffingrequirement api

    Posted 4 days ago

    Hi @Stéphane Labrune,

    Yes, I think you've identified the key distinction.

    The Required Staff values returned by the staffingrequirement endpoint are calculated at the Planning Group level, because the forecast itself is associated with Planning Groups.

    On the other hand, the Scheduled values shown in the WFM UI are not necessarily coming directly from effectiveStaffPerInterval in that response. As you observed from the browser traces, the UI also queries agentschedules/query and appears to aggregate scheduled agents based on the Business Unit / Management Unit scheduling data.

    Because of that, there is not always a one-to-one relationship between:

    • staffingRequirementPerInterval (forecast demand by Planning Group)
    • scheduled agents (schedule data from Management Units and agent schedules)

    This would explain why you can see both Required and Scheduled values in the UI while the effectiveStaffPerInterval array is empty in the API response.

    My understanding is that effectiveStaffPerInterval is only populated when staffing data has been calculated and associated in a way that the staffing requirement service can consume. It should not be considered equivalent to "count of scheduled agents."

    Based on your findings, combining:

    • staffingrequirement for forecast demand
    • agentschedules/query for scheduled staffing

    seems to be the correct approach if you're trying to reproduce the Staffing Requirements view outside the UI.

    Thanks for sharing your investigation. That's a useful observation for anyone trying to reconcile the API output with what is displayed in the WFM interface.



    ------------------------------
    Cesar Padilla
    INDRA COLOMBIA
    ------------------------------