asikarwar | 2021-07-23 13:53:43 UTC | #1
Hello,
Python script using package PureCloudPlatformClientV2 using_PureCloudPlatformClientV2.yaml|attachment (1.3 KB)
Python script having payload and auth request header usingheaderrequest.yaml|attachment (948 Bytes)
Both file has scripts querying the same data. using_PureCloudPlatformClientV2.yaml|attachment returns Count: 0 where usingheaderrequest.yaml|attachment returns correct count
Not sure what I am missing?
Thanks Ashish
asikarwar | 2021-07-23 14:11:39 UTC | #2
Following is the output of script using_PureCloudPlatformClientV2
{'results': [{'data': [{'metric': 'oWaiting', 'observations': None, 'qualifier': None, 'stats': {'count': 0, 'countnegative': None, 'countpositive': 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'}}], 'systemtoorganization_mappings': None}
Process finished with exit code 0
And following output is from usingheaderrequest
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" } } ] }
tim.smith | 2021-07-23 14:12:06 UTC | #3
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.
asikarwar | 2021-07-23 14:20:11 UTC | #4
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
Jerome.Saint-Marc | 2021-07-23 15:25:16 UTC | #5
Hello,
I doubt the output you have included above correspond to the files you have uploaded (the usingPureCloudPlatformClientV2.yaml and the usingheader_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 usingheaderrequest.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 usingheaderrequest 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_clientcredentialstoken (as my Genesys Cloud org is in europe/dublin):
region = PureCloudPlatformClientV2.PureCloudRegionHosts.euwest1 PureCloudPlatformClientV2.configuration.host = region.getapihost()
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,
asikarwar | 2021-07-23 15:39:18 UTC | #6
Actually you are right I forgot to uncomment the following line
myFilter._predicates = [queueIdPredicate, mediaTypePredicate]
But the output is the same
asikarwar | 2021-07-23 15:40:33 UTC | #7
ignore this please
asikarwar | 2021-07-23 15:40:48 UTC | #8
I should focus more
Jerome.Saint-Marc | 2021-07-23 15:41:39 UTC | #9
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.
asikarwar | 2021-07-23 15:41:51 UTC | #10
I am seeing this {'results': None, 'systemtoorganization_mappings': None}
asikarwar | 2021-07-23 15:42:39 UTC | #11
Jerome.Saint-Marc, post:9, topic:11549, full:true
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 corrected to oWaiting still 0 but in developers tool it shows 1
asikarwar | 2021-07-23 15:43:43 UTC | #12
C:\PycharmProjects\Statistics\Scripts\python.exe C:/PycharmProjects/Statistics/genesys2.py {'results': [{'data': [{'metric': 'oWaiting', 'observations': None, 'qualifier': None, 'stats': {'count': 0, 'countnegative': None, 'countpositive': 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'}}], 'systemtoorganizationmappings': None}
Process finished with exit code 0
asikarwar | 2021-07-23 15:44:14 UTC | #13
asikarwar, post:11, topic:11549
I corrected to oWaiting still 0 but in developers tool it shows 1
I mean to write voice but typed oWaiting
asikarwar | 2021-07-23 15:45:10 UTC | #14
Here is the right one
Jerome.Saint-Marc | 2021-07-23 15:45:11 UTC | #15
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,
asikarwar | 2021-07-23 15:45:31 UTC | #16
Sure thank you!
system | 2021-08-23 15:45:34 UTC | #17
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 11549