Hi,
Working with the Python SDK, I am having issue with the function get_calls()
Using the Code example:
PureCloudPlatformApiSdk.configuration.access_token = g.session.access_token PureCloudPlatformApiSdk.configuration.host = 'https://api.mypurecloud.ie'
api = PureCloudPlatformApiSdk.ConversationsApi() result = api.get_calls()
If there is no call in the User queue it works as expected:
Output of result:
{'entities': [],
'first_uri': '/api/v2/conversations/calls?pageSize=0&pageNumber=1',
'last_uri': '/api/v2/conversations/calls?pageSize=0&pageNumber=1',
'next_uri': None,
'page_count': 0,
'page_number': 1,
'page_size': 0,
'previous_uri': None,
'self_uri': '/api/v2/conversations/calls?pageSize=0&pageNumber=1',
'total': 0}
Same result as with PostMan doing a direct request, so I believe my code is working.
Now when there is an Alerting Dialer Preview call in the user Queue; I get the following Stack error:
File "/home/ec2-user/PureCloudLight/pc/lib/python2.7/site-packages/PureCloudPlatformApiSdk/models/call_conversation.py", line 181, in recording_state .format(allowed_values) ValueError: Invalid value for `recording_state`, must be one of ['NONE', 'ACTIVE', 'PAUSED']
I can see that the recording_state in postman is "none", is it an issue with the value being case sensitive in python ?
"pageSize": 1,
"pageNumber": 1,
"total": 1,
"entities": [
{
"id": "930f809b-f6b4-4d72-828a-8f126690617d",
"participants": [],
"otherMediaUris": [
"/api/v2/conversations/callbacks/930f809b-f6b4-4d72-828a-8f126690617d"
],
"recordingState": "none",
"selfUri": "/api/v2/conversations/calls/930f809b-f6b4-4d72-828a-8f126690617d"
}
],
"selfUri": "/api/v2/conversations/calls?pageSize=1&pageNumber=1",
"firstUri": "/api/v2/conversations/calls?pageSize=1&pageNumber=1",
"lastUri": "/api/v2/conversations/calls?pageSize=1&pageNumber=1",
"pageCount": 1
}
Is it a known issue with this SDK ? I believe for now the only workaround is to make the API request directly.
Thanks,
Sebastien