Error getting analytics conversations details query

Hi everyone, i'm trying to retrieving information about my conversations in a range; I use the "postAnalytic Conversations Details Query(body)" but responses and error:

// Call conversation API, pass date inputted to extract conversationIds needed
try {
ConversationQuery body ;//new ConversationQuery().interval(_dates);
body = new ConversationQuery();
body.setInterval(_dates);
PagingSpec pagin= new PagingSpec();
pagin.setPageNumber(1);
pagin.setPageSize(10);
body.paging(pagin);

        System.out.println(body.toString());
      
        AnalyticsConversationQueryResponse result = _conversationsApi.postAnalyticsConversationsDetailsQuery(body);
        extractConversationDetails(result);
    } catch (Exception e) {
        System.err.println("Exception when calling ConversationsApi#postAnalyticsConversationsDetailsQuery");
        e.printStackTrace();
    }

Can you provide some information about the error?

ok, i'm new in the purecloud sdk so i'm trying the code to download records from a range. https://developer.mypurecloud.com/api/tutorials/recordings-downloader/index.html?language=java&step=2

i have exactly this code... but it don't work. I tried to run the post/analytics/details Query in the api developer tools and it bringme the correct response.

I need information about the error you're getting to be able to help you resolve it.

DownloadConversations****
class ConversationQuery {
interval: 2020-02-10T00:00:00/2020-02-11T00:00:00
conversationFilters: []
segmentFilters: []
evaluationFilters: []
mediaEndpointStatFilters: []
surveyFilters: []
order: null
orderBy: null
aggregations: []
paging: class PagingSpec {
pageSize: 10
pageNumber: 1
}
}
Exception when calling ConversationsApi#postAnalyticsConversationsDetailsQuery
com.mypurecloud.sdk.v2.ApiException: error
at com.mypurecloud.sdk.v2.ApiClient.interpretConnectorResponse(ApiClient.java:554)
at com.mypurecloud.sdk.v2.ApiClient.getAPIResponse(ApiClient.java:563)
at com.mypurecloud.sdk.v2.ApiClient.invoke(ApiClient.java:642)
at com.mypurecloud.sdk.v2.api.ConversationsApi.postAnalyticsConversationsDetailsQuery(ConversationsApi.java:7960)
at com.mypurecloud.sdk.v2.api.ConversationsApi.postAnalyticsConversationsDetailsQuery(ConversationsApi.java:7929)
at com.mycompany.testing.Main.downloadConversations(Main.java:102)
at com.mycompany.testing.Main.main(Main.java:213)
Exception catch!.

i'm printing the body reques, before the catch exception.

Hi,

Could you add this inside the catch block so we'd see the actual HTTP response from the server:
System.out.println(((ApiException)e).getRawBody());

Also add this at the top with the imports:
import com.mypurecloud.sdk.v2.ApiException;

I'll update the tutorial with those additions as well.

1 Like

Hi @anon28885283, i solved the problem; The problem was in the users permissions in my purecloud account.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.