Legacy Dev Forum Posts

 View Only

Sign Up

  • 1.  To read all queues

    Posted 06-05-2025 18:04

    sajidali | 2016-11-08 14:28:48 UTC | #1

    I am trying to read all the queues using PostQueuesObservationsQuery. This is how i am calling the api

    List<AnalyticsQueryClause> listanalyticsQueyClause=new List<AnalyticsQueryClause>();

    var anaQueryClause=new AnalyticsQueryClause( AnalyticsQueryClause.TypeEnum.Or, new List<AnalyticsQueryPredicate>() { new AnalyticsQueryPredicate() { Type = AnalyticsQueryPredicate.TypeEnum.Dimension, Dimension = AnalyticsQueryPredicate.DimensionEnum.Queueid

    } });

    listanalyticsQueyClause.Add(anaQueryClause); List<AnalyticsQueryPredicate> listanalyticsQueryPredicate=new List<AnalyticsQueryPredicate>(); var analyticsQueryPredicate=new AnalyticsQueryPredicate(Dimension: AnalyticsQueryPredicate.DimensionEnum.Queueid); var analyticsQFilter = new AnalyticsQueryFilter(AnalyticsQueryFilter.TypeEnum.Or,listanalyticsQueyClause,listanalyticsQueryPredicate); var obsQuery = new ObservationQuery(analyticsQFilter); QualifierMappingObservationQueryResponse resultQueues = apiInstance.PostQueuesObservationsQuery(obsQuery);

    The result is empty, so my question is what are the mandatory fileds to specify in obsQuery; as used above.


    tim.smith | 2016-11-08 14:32:20 UTC | #2

    Here's the docs on observations queries: https://developer.mypurecloud.com/api/rest/v2/analytics/user_observation.html

    You should be specifying the user ID; queue IDs aren't valid for user observation queries.


    sajidali | 2016-11-08 14:54:53 UTC | #3

    Hi Tim,

    I am trying to read PostQueuesObservation and not the users.

    https://developer.mypurecloud.com/api/rest/client-libraries/csharp/latest/AnalyticsApi.html#postqueuesobservationsquery


    tim.smith | 2016-11-08 15:07:49 UTC | #4

    Sorry, I misread the code. Queue observations should be the same, but with a queue ID instead of a user ID. I would suggest trying the query in the Developer Tools Analytics Query Builder to verify the data you get for a given query and then build that query with the .NET SDK. Here's a queue observation query that worked for me:

    {
     "filter": {
      "type": "or",
      "predicates": [
       {
        "type": "dimension",
        "dimension": "queueId",
        "operator": "matches",
        "value": "636f60d4-04d9-4715-9350-7125b9b553db"
       }
      ]
     }
    }

    sajidali | 2016-11-08 15:21:19 UTC | #5

    Thanks Tim. In that case i have a follow up question, what if i am interested in all the queues in the system?

    Also when i am trying to use query builder, i can not enter the value. <img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/e37896678931baee1cb568a3494127e2bb4dd19f.png" width="595" height="500">


    tim.smith | 2016-11-08 15:30:49 UTC | #6

    sajidali, post:5, topic:594
    what if i am interested in all the queues in the system?

    Add the queues you want as predicates in an OR clause:

    <img src="//inin-prod-use1-developerforum.s3.amazonaws.com/original/1X/5c29dc50b16027d7f783462ba37bb8905605afd7.png" width="218" height="500">


    KevinGlinski | 2016-11-08 15:29:58 UTC | #7

    the value not being there is a bug, i'm looking into it. There is an issue with metrics too.


    system | 2017-08-28 19:28:32 UTC | #8


    This post was migrated from the old Developer Forum.

    ref: 594