Legacy Dev Forum Posts

 View Only

Sign Up

Workforce Management Schedule Permission Issue

  • 1.  Workforce Management Schedule Permission Issue

    Posted 06-05-2025 18:25

    bahmed | 2023-03-24 18:33:43 UTC | #1

    Hello,

    I'm trying to get the schedule information from the API using Python but receiving permission issue.

    Code: requestheaders = { "Authorization": f"Bearer {genesystoken}", "Content-Type": "application/json", }

    api_host = "https://api.cac1.pure.cloud"

    apiresponse = requests.get(apihost + f"/api/v2/workforcemanagement/businessunits/{businessunitid}/weeks/{weekid}/schedules/{scheduleid}", headers=request_headers)

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

    Response Status: 403

    Response Text: {"message":"Unable to perform the requested action. You must have at least one of the following permissions assigned: [wfm:schedule:view:c5c782a3-5b89-495c-beda-867cde2ed1ee, wfm:publishedSchedule:view:c5c782a3-5b89-495c-beda-867cde2ed1ee]","code":"missing.any.permissions","status":403,"contextId":"36ab9802-17e4-4859-84b4-71d1d71713a9","details":[],"errors":[]}

    I'm only facing this issue when accessing data using Python. Used Genesys Cloud UI and API Explorer (https://developer.genesys.cloud/devapps/api-explorer) and it's returning data properly. How come I don't have permission error through UI and API Explorer? I don't understand this behaviour.


    tim.smith | 2023-03-28 19:09:17 UTC | #2

    It's unclear how you're authorizing the python SDK, but if you're using client credentials, that probably explains it. Your user and client credentials have no relation to one another, so the resolution would be to grant the oauth client the same permissions as your user.

    bahmed, post:1, topic:19108
    [wfm:schedule:view:c5c782a3-5b89-495c-beda-867cde2ed1ee, wfm:publishedSchedule:view:c5c782a3-5b89-495c-beda-867cde2ed1ee]

    I believe these GUIDs are divisions, meaning the auth token used in the request lacks the permission to the requested object's division.

    Edit: realized that you're not using the SDK. It's here if you want to: https://developer.genesys.cloud/devapps/sdk/docexplorer/purecloudpython/


    brian.trezise | 2023-03-28 19:09:17 UTC | #3

    Can confirm the GUIDs in the permission strings are divisions


    system | 2023-04-28 13:47:47 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: 19108