Legacy Dev Forum Posts

 View Only

Sign Up

I'm trying to use a post function, but this is not working

  • 1.  I'm trying to use a post function, but this is not working

    Posted 06-05-2025 18:09

    JulianAlejandroVil | 2023-09-06 13:54:19 UTC | #1

    I've been using the API for quite sometime and it has been working perfectly, but I'm working with the Workforce Management API and found the following problem. This is the code i've been using (the auth part is deleted)

    import PureCloudPlatformClientV2
    import pandas
    apiclient = #Deleted not to show the secret ID
    WFM = PureCloudPlatformClientV2.WorkforceManagementApi(apiclient)
    WFM.post_workforcemanagement_adherence_historical_bulk({
    "items": [
        {
            "managementUnitId": "68c9c998-3f40-42d2-90a0-2d749886b9df",
            "startDate": "2023-09-05T00:00:00.000Z",
            "endDate": "2023-09-06T00:00:00.000Z",
            "userIds": ["96d4bfc4-f3a1-49e9-849c-02c291e04bcc","32358977-d7e6-48ea-a0bf-499964295550"],
            "includeExceptions": True,
            "includeActuals": True
        }
    ],
    "timeZone": "Europe/Madrid"
    })

    I get this error "TypeError: WorkforceManagementApi.postworkforcemanagementadherencehistoricalbulk() takes 1 positional argument but 2 were given" yet i've always used the query that the developer API explorer provides with no issue. Could you please help me?

    Thanks in advance!


    tim.smith | 2023-09-06 14:09:48 UTC | #2

    Please refer to the SDK documentation. You must use the documented types with the SDK: https://developer.genesys.cloud/devapps/sdk/docexplorer/purecloudpython/WorkforceManagementApi#post_workforcemanagement_adherence_historical_bulk


    system | 2023-10-07 14:10:02 UTC | #3

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