Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Get Agent Roles

    Posted 12 hours ago

    HI

    How would I get a list of agents who have logged on in the last 3 months, their roles and possibly talk/hold time for the previous 3 months.

    Many thanks


    #PlatformAPI

    ------------------------------
    Philip Thys
    3rd Line Engineering Specialist
    ------------------------------


  • 2.  RE: Get Agent Roles

    Posted 8 hours ago

    Hi Philip, 

    You can automate this using Genesys Cloud APIs with a two-step process, at the moment there is not a consolidated UI view to give you what you would be looking for.

    First, retrieve the performance data by making a POST call to /api/v2/analytics/users/details/jobs. The query returns user activity data including talk time, hold time and other performance metrics along with user IDs. After submitting the job, you'll poll the job status endpoint and then retrieve the results once the job completes. The results will be paginated, so you may need to iterate through multiple pages using cursors. You could also manually export some of this information from the Agent Performance view in the UI if you prefer a hybrid approach.

    Second, get the user and role information by calling GET /api/v2/users to retrieve your list of users. This should give you basic user information including names and emails. To get role assignments, you'll need to query the authorization endpoints for each user to see which roles they have assigned or alternatively use the expand parameter on the GET /api/v2/users call as outlined here - https://community.genesys.com/discussion/get-list-of-assigned-roles-for-all-users#bm954742cd-d4d9-4daa-b7ab-019ce279b5d8. The API returns user IDs which you can use as the common key to join this data with your performance metrics.

    Once you have both datasets, combine them programmatically using the user ID as your join key. The result is a complete view showing which agents were active in the last 3 months, their roles and their talk and hold time metrics.

    This approach requires someone comfortable with REST APIs and data manipulation but once built it can be automated to run on a regular schedule, making it ideal if you need this report frequently.



    ------------------------------
    Josh Coyle
    Senior Professional Services Consultant
    ------------------------------



  • 3.  RE: Get Agent Roles

    Posted 5 hours ago

    General


    Thanks Josh

    Long time no speak

     

    The get users stops responding – any ideas please?

     

    Philip Thys
    3rd Line Voice Engineering Specialist
    Enterprise Managed Services, Enterprise

    T: +44 3316240050
    M: +44 7545 130286

     

     

    Enterprise: a new BT that really means business

     


    General






  • 4.  RE: Get Agent Roles

    Posted 2 hours ago

    Indeed it has been a while Phil.

    I'm not too sure which Get Users stops responding from your above however if it's GET /api/v2/users then it is likely hanging because it's trying to return too much data at once. That endpoint is paginated, so for larger orgs you need to loop through pages rather than do one big pull. Testing something like "pageSize=100&pageNumber=1" first and then build upon this with the expansions you require. 



    ------------------------------
    Josh Coyle
    Senior Professional Services Consultant
    ------------------------------