Legacy Dev Forum Posts

 View Only

Sign Up

PostAnalyticsUsersDetailsQuery

  • 1.  PostAnalyticsUsersDetailsQuery

    Posted 06-05-2025 18:05

    sajidali | 2017-06-07 08:55:44 UTC | #1

    I am trying to get the user details using "PostAnalyticsUsersDetailsQuery" query/method. I have two different questions regarding the interval parameter for the query.

    1. When i specify the interval length as 15 minutes, i get multiple users with the details. For example the below query returns the states for multiple users(4)

    var apiInstance = new AnalyticsApi(); var body = new UserDetailsQuery(); body.Interval = "2017-06-05T08:00:00/2017-06-05T08:15:00"; AnalyticsUserDetailsQueryResponse result = apiInstance.PostAnalyticsUsersDetailsQuery(body);

    However if i change the interval body.Interval = "2017-06-05T08:00:00/2017-06-05T09:00:00";, from 15 minutes to 1 hour, it returns states for less users(2). So i am not sure why 15 min interval gives me more users with states compare to 1 hour?

    2.How to get the user details for all the users within last few hours? Is it even possible with this query?


    anon47305574 | 2017-06-08 15:32:35 UTC | #2

    Without seeing the specifics of your query/response, have you checked if there are additional pages of data? This is a paged resource given the indeterminate size of the response. This page shows an example with paging included in the query https://developer.mypurecloud.com/api/rest/v2/analytics/user_detail.html


    sajidali | 2017-06-09 12:42:14 UTC | #3

    Thanks Mike, thats correct. I have handled the paging and seems OK now.

    Another thing which i need clarification is that i need the agent adherence information and i was recommended to use "PostAnalyticsUsersDetailsQuery" Now this query returns two kinds of details. -PrimaryPresence -for example: Offline, AVailable,Busy etc -RoutingStatus -for example: OffQueue, Interacting etc <img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/8fdd9b75edf2630e4ef79f2fe0e2333bc7ae8143.png" width="546" height="179">

    Which of those statuses are used for adherence information? and what is the difference between them?

    Thanks.


    Behymer_Joe | 2017-06-09 16:44:28 UTC | #4

    Hello @sajidali!

    My name is Joe Behymer and I'm on the development team that owns the PureCloud Adherence functionality. I'd be happy to help you figure this out.

    If you just want to know whether agents are currently adherent to their WFM schedule then we have an API you can use for that today: https://developer.mypurecloud.com/api/rest/v2/workforcemanagement/index.html#getWorkforcemanagementAdherence

    Whether an agent is in adherence depends on their current scheduled activity, presence, routing status, and out of office flag. For details on the formula we use to determine adherence you can see this page: https://help.mypurecloud.com/articles/real-time-adherence-overview/

    We are currently working on a feature/API that will allow you to get a historical view of agent adherence that is scheduled to ship in the next month. If that's what you need then I can come back and update you on this thread when that is released.


    sajidali | 2017-06-12 10:13:02 UTC | #5

    Hi @Behymer_Joe Thank you for the update. So at the moment "postAnalyticsUsersDetailsQuery" does not provide historical adherence data for agents?

    I start using "/api/v2/analytics/users/aggregates/query" to fetch the agent adherence information but it is only available in 30 min interval where as i need 15 min interval. Then someone at PureCloud mentioned to use ”/api/v2/analytics/users/details/query” to read the adherence data aggregate it on 15 minutes. I was told that this data is available as long as customer wants it.

    So based on this, i am bit confused regarding which API should i use?

    For this new API/Feature, will it be possible to aggregate the historical adherence data on 15 mins interval? If yes, then that is what exactly we need. If not, then i need to understand which API/function best serves our purpose.


    anon47305574 | 2017-06-14 14:40:54 UTC | #6

    The distinction is that the analytics resources you are currently using detail what statuses (presence and/or routing status) the user was in and when. Adherence is a separate concept layered on top of that (and therefore available in a separate API resource) where you have a notion of what statuses a user should be in (e.g. a schedule of statuses) and you are contrasting it with what status they were actually in.


    sajidali | 2017-06-16 09:40:46 UTC | #7

    Thanks @anon47305574 but i am bit confused, did you answer to my original question or the one i replied to @Behymer_Joe ? I need the adherence information of agents with their actual statuses, is that available in "PostAnalyticsUsersDetailsQuery" query? And if yes, should i use "PrimaryPresense" or "RoutingStatus"?


    anon47305574 | 2017-06-16 13:15:33 UTC | #8

    No problem, and my answer was directed at you @sajidali . I was just trying to highlight the distinction in what the definition of the data is at each of the API endpoints. Adherence is a comparison of a user's schedule to a user's status and that is not included in the analytics user details API endpoint. The analytics endpoint only returned user status (in the form of presence and routing status). If you are maintaining agent schedules separately outside of the product and want to define/compute adherence on your own, then you could use the data from the analytics endpoints to derive it, however, adherence is not something directly modeled/included in the analytics resources.


    sajidali | 2017-06-19 11:43:54 UTC | #9

    Thanks @anon47305574 I am using the analytics end-point and i have already fetched the states. We have a separate WFM systen where the schedule of agent is defined. However, what i am still not sure, what is the difference between Routing and primary states in regard to "PostAnalyticsUsersDetailsQuery".


    tim.smith | 2017-06-19 21:12:06 UTC | #10

    A user always has both a presence and routing status. When the user is ineligible for ACD conversations, their presence can be anything and their routing status will be OFF_QUEUE. If the user is in some stage of handling ACD conversations, their presence will be Available and the routing status will be anything other than OFF_QUEUE.

    See the article Understanding Presence for additional information.


    sajidali | 2017-06-20 12:19:15 UTC | #11

    Thanks for the update @tim.smith


    sajidali | 2017-06-28 09:00:38 UTC | #12

    Hi Tim, I am working with the fetched data for adherence purpose. Now based on information available on this forum and your comments, i am calculating four different parameters.

    1. Available duration
    2. Total work duration
    3. Pause duration
    4. Wait duration.

    This is how i am doing the calculation: Available WHEN statustype='Routing' and status IN ('Idle','Interacting','Communicating') then enddate-startdate Total work WHEN status NOT IN ('Offline')then enddate-startdate Pause duration WHEN (statustype<>'Routing' or status NOT IN ('Idle','Interacting','Communicating')) AND status NOT IN ('Offline') then enddate-startdate Wait duration WHEN statustype='Routing' and status IN ('IDLE') then enddate-start_date

    Would that made any sense?


    tim.smith | 2017-06-28 13:21:31 UTC | #13

    That seems reasonable.


    Drew_Banin | 2017-07-11 17:22:26 UTC | #14

    Hey @Behymer_Joe -- any word on when the historical agent adherence endpoint will be released?

    Thanks! -Drew


    Behymer_Joe | 2017-07-25 19:19:48 UTC | #15

    @Drew_Banin - the historical adherence UI is being released at 9AM EST tomorrow and the the API will follow sometime next week.


    system | 2017-08-28 19:34:56 UTC | #16


    This post was migrated from the old Developer Forum.

    ref: 1379