Genesys Cloud - Main

 View Only
Discussion Thread View
  • 1.  How to create POST data action for adding roles and division to users. API: /api/v2/authorization/subjects/{subjectId}/bulkadd

    Top 25 Contributor
    Posted 10 days ago
    Edited by Khurshid Ali 10 days ago

    Hello Community,

    How to create POST data action for adding roles and division to users. API: /api/v2/authorization/subjects/{subjectId}/bulkadd

    When I run it through developer center, it works fine. But when I try to create a data action, it always fails. 

    I have tried multiple different ways to pass the input, like first input as array for grants, then the strings > objects> strings, etc

    But all in vain. Can someone please help me with this?

    This will be used on a digital bot to create user profile with respective roles and division.


    #ArchitectureandDesign
    #ConversationalAI(Bots,AgentAssist,etc.)
    #Integrations

    ------------------------------
    Khurshid Ali,
    Consultant / Developer / Tech Lead,
    NCR Voyix,
    khurshid.ali@ncrvoyix.com,
    New Delhi,
    India
    ------------------------------



  • 2.  RE: How to create POST data action for adding roles and division to users. API: /api/v2/authorization/subjects/{subjectId}/bulkadd

    Posted 9 days ago

    Hi Khurshid,

    You can put your inputs in to the same object on the input contract. No need to have multiple objects.

    Then your Request URL and Request Body should grab those inputs. Your request body gets the subjectId...and subjectType if needed.
    /api/v2/authorization/subjects/${input.subjectId}/bulkadd?subjectType=${input.subjectType}

    And your request body you can copy from the API Explorer but based on that I guess would look something like this:
    {"grants":[{"roleId":"${input.roleId}","divisionId":"${input.divisionId}"}]}

    Hope that works for you.

    Thanks,
    Marian



    ------------------------------
    Marian OConnell
    GEMA Consulting Ireland Limited
    ------------------------------



  • 3.  RE: How to create POST data action for adding roles and division to users. API: /api/v2/authorization/subjects/{subjectId}/bulkadd

    Top 25 Contributor
    Posted 9 days ago
    Edited by Khurshid Ali 9 days ago

    Thanks for your response Marian.

    That helped. I had one extra space before /API which worked after removal after following your guidelines.

    How can we add multiple roles in the data action for the same subject with same division?

    For e.g. Subject need to have Employee, User, Supervisor, etc roles with same or more than 2 divisions as well.

    IT works, If I give single role and single division that works, but if I have more than 1 role/division, how should I work on that?

    Scenario: 

    I am collecting current user roles and trying to add new user with same roles as existing user. Existing user can have more than 4-5 roles. How do I add all those roles/division with this API?

    It's possible through developer center:



Need Help finding something?

Check out the Genesys Knowledge Network - your all-in-one access point for Genesys resources