Hello everyone.
I'm trying to practice using the PureCloudPlatformClientV2 module with python trying to use a post api
In my example I commented the first line "body" because I read or understood reading other cases that I could use a "json/dictionary" instead of the QueueObservationQuery and I am new with this module I don't know how to use the QueueObservationQuery to create a good json yet.
I am using this code:
create an instance of the API class
api_instance = PureCloudPlatformClientV2.RoutingApi();
#body = PureCloudPlatformClientV2.QueueObservationQuery() # QueueObservationQuery | query
body = {"interval": "2024-02-12/2024-02-13",
"timeZone": "GMT",
"filter": {"type": "or",
"predicates": [{"type": "dimension",
"dimension": "queueId",
"operator": "matches",
"value": "12345678-1234-1234-1234-123456789101"
}]
},
"metrics": ["nOffered"]
}
try:
# Query for queue observations
api_response = api_instance.post_analytics_queues_observations_query(body)
When the code is executed the response is the next:
HTTP response body: {"message":"Value [nOffered] is not valid for field type [QueueObservationMetric]. Allowable values are: oActiveUsers, oAlerting, oInteracting, oMemberUsers, oOffQueueUsers, oOnQueueUsers, oUserPresences, oUserRoutingStatuses, oWaiting","code":"invalid.value","status":400,"contextId":"3ea1a73c-c83f-4bf8-afdb-3081fa58be64","details":[],"errors":[]}
Seems that the json structure it's not ok but if i used the same json with this other example the response it's ok with status code 200 and i can read the json successfully
response_api = f"https://api.{ENVIRONMENT}/api/v2/analytics/conversations/aggregates/query"
body = {"interval": "2024-02-12/2024-02-13",
"timeZone": "GMT",
"filter": {"type": "or",
"predicates": [{ "type": "dimension",
"dimension": "queueId",
"operator": "matches",
"value": "12345678-1234-1234-1234-123456789101"
}]
},
"metrics": ["nOffered"]
}
so, if the both jsons have the same structure, I can“t understand why PureCloudPlatformClientV2 does not work fine
Could you help me?
Thank you so much for your time