Legacy Dev Forum Posts

 View Only

Sign Up

Updating the users division through python scripts

  • 1.  Updating the users division through python scripts

    Posted 06-05-2025 19:21

    Komali_Sidagam | 2021-01-19 19:25:40 UTC | #1

    Hi,

    I'm new to API s, Could someone help me with Getting the user details and changing the Division and Roles of a particular user using python script.

    I am able to connect to Genesys through API and need little input further to get user details and change the Divisions.

    Thanks in Advance.


    anon70697523 | 2021-01-19 21:21:32 UTC | #2

    Hello Komali,

    You can use these user apis linking below for the use-case.

    Getting user information: https://developer.mypurecloud.com/api/rest/v2/users/#get-api-v2-users--userId- Assigning role to a user: https://developer.mypurecloud.com/api/rest/v2/users/#put-api-v2-users--userId--roles Adding divisions to roles: https://developer.mypurecloud.com/api/rest/v2/users/#post-api-v2-authorization-subjects--subjectId--divisions--divisionId--roles--roleId-

    I hope this is helpful to you.

    Thanks and Regards, Mrunal


    Komali_Sidagam | 2021-01-20 17:08:23 UTC | #3

    Hi Mrunal,

    Thank you for the links, those are helpful.


    Komali_Sidagam | 2021-01-25 11:36:28 UTC | #4

    Hi Murnal,

    Is there any way for updating User divisions using user_id directly.


    Komali_Sidagam | 2021-01-26 09:29:02 UTC | #5

    For updating users division, i am passing as below, it is throwing error. body = [PureCloudPlatformClientV2.list[str]()] # list[str] | Object Id List

    body = [PureCloudPlatformClientV2.list['bd1583a0-4ded-4415-837a-7346376784ec']()]

    AttributeError: module 'PureCloudPlatformClientV2' has no attribute 'list'

    If im passing without list, it is throwing syntax error. Could someone please help. I tried all possible ways, its not working.


    system | 2021-02-26 09:29:07 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: 9748