Hello,
I'm trying to query the conversations details API using client credential auth in Python and also via Azure Data Factory (which is the end goal). Either way, I'm getting strange data returned by the API. I do get results but all conversations are highly incomplete. There's no acd, agent data. The only participant showing is 'external' in purpose. The results are returned properly when using the API Explorer on genesys website, so it looks like there's no issue with the data itself for the api and interval I'm querying.
This is what I get:
This is the code I use for client credential connection:
import base64, requests, os
CLIENT_ID = os.environ['GENESYS_CLOUD_CLIENT_ID']
CLIENT_SECRET = os.environ['GENESYS_CLOUD_CLIENT_SECRET']
ENVIRONMENT = os.environ['GENESYS_CLOUD_ENVIRONMENT'] # eg. mypurecloud.com
# Base64 encode the client ID and client secret
authorization = base64.b64encode(bytes(CLIENT_ID + ":" + CLIENT_SECRET, "ISO-8859-1")).decode("ascii")
# Get Access Token
request_headers = {
"Authorization": f"Basic {authorization}",
"Content-Type": "application/x-www-form-urlencoded"
}
request_body = {
"grant_type": "client_credentials"
}
response = requests.post(f"https://login.{ENVIRONMENT}/oauth/token", data=request_body, headers=request_headers)
response_json = response.json()
# Post Query Request
requestHeaders = {
"Authorization": f"{ response_json['token_type'] } { response_json['access_token']}",
'Content-Type': 'application/json'
}
query = {
"interval": "2022-06-07T21:00:00/2022-06-08T21:30:00",
}
response = requests.post('https://api.mypurecloud.com/api/v2/analytics/conversations/details/query', headers=requestHeaders, json=query)
response_json = response.json()
Not sure if it's something simple I'm missing (I'm new to this) or if it's rather something for customer care, but any advice is greatly appreciated.