Queues observations API different result between Python script and Developer tool

Hello,

Python script using package PureCloudPlatformClientV2
using_PureCloudPlatformClientV2.yaml (1.3 KB)

Python script having payload and auth request header
using_header_request.yaml (948 Bytes)

Both file has scripts querying the same data.
using_PureCloudPlatformClientV2.yaml returns Count: 0 where using_header_request.yaml returns correct count

Not sure what I am missing?

Thanks
Ashish

Following is the output of script using_PureCloudPlatformClientV2

{'results': [{'data': [{'metric': 'oWaiting',
'observations': None,
'qualifier': None,
'stats': {'count': 0,
'count_negative': None,
'count_positive': None,
'current': None,
'denominator': None,
'max': None,
'min': None,
'numerator': None,
'ratio': None,
'sum': None,
'target': None},
'truncated': None}],
'group': {'mediaType': 'callback',
'queueId': '0a85416a-bfc7-43a2-a1c2-84832dce53f0'}}],
'system_to_organization_mappings': None}

Process finished with exit code 0

And following output is from using_header_request

Got Observations
{
      "results": [
            {
                  "data": [
                        {
                              "metric": "oWaiting",
                              "stats": {
                                    "count": 0
                              }
                        }
                  ],
                  "group": {
                        "mediaType": "chat",
                        "queueId": "0a85416a-bfc7-43a2-a1c2-84832dce53f0"
                  }
            },
            {
                  "data": [
                        {
                              "metric": "oWaiting",
                              "stats": {
                                    "count": 0
                              }
                        }
                  ],
                  "group": {
                        "mediaType": "email",
                        "queueId": "0a85416a-bfc7-43a2-a1c2-84832dce53f0"
                  }
            },
            {
                  "data": [
                        {
                              "metric": "oWaiting",
                              "stats": {
                                    "count": 1
                              }
                        }
                  ],
                  "group": {
                        "mediaType": "voice",
                        "queueId": "0a85416a-bfc7-43a2-a1c2-84832dce53f0"
                  }
            },
            {
                  "data": [
                        {
                              "metric": "oWaiting",
                              "stats": {
                                    "count": 0
                              }
                        }
                  ],
                  "group": {
                        "mediaType": "message",
                        "queueId": "0a85416a-bfc7-43a2-a1c2-84832dce53f0"
                  }
            },
            {
                  "data": [
                        {
                              "metric": "oWaiting",
                              "stats": {
                                    "count": 0
                              }
                        }
                  ],
                  "group": {
                        "mediaType": "callback",
                        "queueId": "0a85416a-bfc7-43a2-a1c2-84832dce53f0"
                  }
            }
      ]
}

If your requests are exactly the same and made with credentials that possess the exact same permissions and scopes, they should return the same data. If there are any differences whatsoever, the results may be different because of them. If you're sure there are literally no differences whatsoever between the requests, please open a case with Genesys Cloud Care to investigate further; customer-specific data cannot be investigated on the forum.

Make sense, but should the output not inform us of this difference.
Can you please verify whether my script is correct (syntactically) predicate condition etc.
This will help in explaining the admin that it is really the access/permission level issue.
I am trying to understand how the query syntax work, comparing the output between query builder and my own python stand alone script was/is the only option.

Thanks
Ashish

Hello,

I doubt the output you have included above correspond to the files you have uploaded (the using_PureCloudPlatformClientV2.yaml and the using_header_request.yaml).

According to your code, the uploaded using_PureCloudPlatformClientV2.yaml is requesting the oWaiting metric (number of conversations in ACD Queue). And no filter on the mediaType (disabled in the code).

According to your code, the uploaded using_header_request.yaml is requesting the oOnQueueUsers metric (number of users on the ACD Queue - i.e On Queue presence state).

The response you are showing for using_PureCloudPlatformClientV2 shows oWaiting for the callback mediaType. So unless you have added a filter in your code, or unless you have extracted/copied a subset of your response, it doesn't match.

The response you are showing for using_header_request shows oWaiting for all media types. So unless you have modified the metric in your code (oOnQueueUsers), it doesn't match.

I have tried your code from using_PureCloudPlatformClientV2, adding before the get_client_credentials_token (as my Genesys Cloud org is in europe/dublin):

region = PureCloudPlatformClientV2.PureCloudRegionHosts.eu_west_1
PureCloudPlatformClientV2.configuration.host = region.get_api_host()

The OAuth Client (Client Credentials Grant) I have used has a role assigned, that only contains the analytics:queueObservation:view permission, on the Division(s) to which my ACD Queue(s) belong.

And the code works fine.

So you'll have to investigate on your side what you are doing wrong.
Or open a ticket with Genesys Cloud Care as we can't investigate customer data/environments on this forum.

Regards,

Actually you are right I forgot to uncomment the following line

#myFilter._predicates = [queueIdPredicate, mediaTypePredicate]

But the output is the same

ignore this please

I should focus more

According to your displayed response, you're doing a filter on callback mediaType (Callback conversations).
Your data output with conversations waiting in Queue was for voice media Type.

I am seeing this {'results': None, 'system_to_organization_mappings': None}

I corrected to oWaiting still 0 but in developers tool it shows 1

C:\PycharmProjects\Statistics\Scripts\python.exe C:/PycharmProjects/Statistics/genesys_2.py
{'results': [{'data': [{'metric': 'oWaiting',
'observations': None,
'qualifier': None,
'stats': {'count': 0,
'count_negative': None,
'count_positive': None,
'current': None,
'denominator': None,
'max': None,
'min': None,
'numerator': None,
'ratio': None,
'sum': None,
'target': None},
'truncated': None}],
'group': {'mediaType': 'voice',
'queueId': '0a85416a-bfc7-43a2-a1c2-84832dce53f0'}}],
'system_to_organization_mappings': None}

Process finished with exit code 0

I mean to write voice but typed oWaiting

Here is the right one

Then raise a ticket with Genesys Cloud Care. We can't investigate customer data on the forum.
They can access to logs (of your requests, etc etc)

Regards,

Sure thank you!

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.