Kashee | 2021-01-18 22:13:40 UTC | #1
The following code snippet used with SDK 112 in VS2017:
PureCloudRegionHosts region = PureCloudRegionHosts.eucentral1; Configuration.Default.ApiClient.setBasePath(region); AuthTokenInfo tokenInfo = Configuration.Default.ApiClient.PostToken(clientid, clientsecret);
var cApi = new ConversationsApi(); cApi.Configuration.AccessToken = tokenInfo.AccessToken; var conversations = cApi.GetConversationsCallsHistory(50,1,@"2021-01-01T13:10:00.000Z/2021-01-12T14:15:00.000Z");
ALWAYS returns an empty result set. Entities Count=0. No authorization/authentication issue.
Fiddler shows this: Request
GET h..ps://api.mypurecloud.de/api/v2/conversations/calls/history?pageSize=50&pageNumber=1&interval=2021-01-12T13%3a10%3a00.000Z%2f2021-01-12T14%3a15%3a00.000Z HTTP/1.1 Accept: application/json Authorization: Bearer (hidden token) purecloud-sdk: 112.0.0 User-Agent: RestSharp/106.3.1.0 Host: api.mypurecloud.de Accept-Encoding: gzip, deflate
Response
HTTP/1.1 200 OK Content-Type: application/json Content-Length: 284 Connection: keep-alive Date: Mon, 18 Jan 2021 17:44:06 GMT ININ-Correlation-Id: a794c02c-d615-4c22-8da5-d3a61a05d6cf inin-ratelimit-count: 1 inin-ratelimit-allowed: 180 inin-ratelimit-reset: 61 Strict-Transport-Security: max-age=600; includeSubDomains Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: 0 X-Cache: Miss from cloudfront Via: 1.1 bf5caee39117de5337c47c748b716e80.cloudfront.net (CloudFront) X-Amz-Cf-Pop: AMS1-C1 X-Amz-Cf-Id: XkPDaG8vFR-T6sKV2mkKeHZ7YuqQgD9_t9tOKLxveydg9mjJRRpAzA==
{"entities":[],"pageSize":0,"pageNumber":1,"total":0,"firstUri":"/api/v2/conversations/calls/history?pageSize=0&pageNumber=1","selfUri":"/api/v2/conversations/calls/history?pageSize=0&pageNumber=1","lastUri":"/api/v2/conversations/calls/history?pageSize=0&pageNumber=1","pageCount":0}
Same result when I call GetConversationsCallsHistory() w/o parameters (no interval etc.). Result is always empty. The exact same query with the exact same interval however, executed from within Genesys Cloud Developer Tools API Explorer in Chrome always returns all available conversations as expected!
What am I doing wrong :frowning: ?
anon11147534 | 2021-01-19 09:19:49 UTC | #2
Hi,
That API call will only retrieve the call history for the authenticated user. To get the call history for your organization you need POST /api/v2/analytics/conversations/details/query
Kashee | 2021-01-19 11:02:19 UTC | #3
Hi, Thanks for your reply. This works! I didn't know that the calls history only returns conversations for the authenticated user, since the API documentation does not say so explicitly.
anon11147534 | 2021-01-19 11:04:53 UTC | #4
Yes correct, the API documentation for that particular endpoint is misleading because of that omission. I'll see if the team will update the documentation.
Ragavi_Kanagalingam | 2021-01-25 18:42:00 UTC | #5
Hi,
We are trying to get all outbound calls made in given interval using GetCallHistory API. As stated above we are able to get response only for authenticated user. I tried using POST /api/v2/analytics/conversations/details/query API but I am getting only outbound ACD calls which are initiated from queue.
Is there a way to get Non ACD outbound calls using any API?
system | 2021-02-25 18:52:13 UTC | #6
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: 9728