Genesys Cloud - Main

 View Only


Discussion Thread View
  • 1.  How to validate (logical decision) if the user has a 'supervisor role' using API?

    Posted 13 days ago

    Hello Community,

    I am new and learning Genesys cloud and data actions on a fast pace as per the requirements.

    I want to validate on my digital bot flow if the user is a supervisor, if yes, take one action if not, take another action.

    have explored these APIs:
    GET /api/v2/authorization/subjects/{subjectId}: Returns a listing of roles and permissions for a user.
    GET /api/v2/users/{subjectId}/roles: Returns a listing of roles and permissions for a user.GET

    both gives me a list of users or roles.

    How do I either filter specific role to a user or specific user to a role? I believe either would work for me.

    Thanks.


    #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 validate (logical decision) if the user has a 'supervisor role' using API?

    Top 25 Contributor
    Posted 13 days ago
    One option is to use:
    Expand authorization
    Then, where 123-456-789 is the user id, it would look like:
    In your data action response template, you want an array, with a path like:
    $.entities[0].authorization.roles[*].name
    And then in your flow, do findfirst(Task.ReturnedArray, "Your Supervisor Role Name") >= 0
    if -1 then not found, if 0 or more than they have the role


    ------------------------------
    Anton Vroon
    ------------------------------



  • 3.  RE: How to validate (logical decision) if the user has a 'supervisor role' using API?

    Posted 10 days ago

    Hello @Anton Vroon, Thanks for your input.

    Sorry to ask this. can you please share a screenshot of the data action how to put this in the response and call flow.



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



  • 4.  RE: How to validate (logical decision) if the user has a 'supervisor role' using API?
    Best Answer

    Top 25 Contributor
    Posted 10 days ago

    Sure, through this together pretty quickly, so could probably be done better.

    Contracts:

    Configuration

    Output example:

    In the flow, remember to set default value for the boolean to false, check for empty list etc

    That Boolean Assignment



    ------------------------------
    Anton Vroon
    ------------------------------



  • 5.  RE: How to validate (logical decision) if the user has a 'supervisor role' using API?

    Posted 9 days ago

    Much appreciate your help.

    The decision (findfirst) thing worked for my initial API: /api/v2/authorization/subjects/${input.subjectId}

    Community is a rich knowledge builder with people like you.

    Keep rocking!



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



Need Help finding something?

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