An error happens when I use method to recover conversations from Analytics API

Hello, I have a problem because sometimes I receive this error from SDK:

Can not construct instance of java.util.Date from String value ("2017-07-04T14:20:10.694Z"): not a valid representation (error: For input string: "20172017E")
at [Source: java.io.StringReader@2fa299d0; line: 1, column: 97793] (through reference chain: com.mypurecloud.sdk.v2.model.AnalyticsConversationQueryResponse["conversations"]->java.util.ArrayList[48]->com.mypurecloud.sdk.v2.model.AnalyticsConversation["participants"]->java.util.ArrayList[3]->com.mypurecloud.sdk.v2.model.AnalyticsParticipant["sessions"]->java.util.ArrayList[0]->com.mypurecloud.sdk.v2.model.AnalyticsSession["segments"]->java.util.ArrayList[3]->com.mypurecloud.sdk.v2.model.AnalyticsConversationSegment["segmentEnd"])

when I execute method postAnalyticsConversationsDetailsQueryWithHttpInfo from AnalyticsApi in Java SDK.

The invocation is as below:

int pageNumber = 1;
String date = "2017-07-04";
ConversationQuery body = new ConversationQuery();
body.setInterval(date+"T00:00:00.000Z/"+date+"T23:59:59.000Z");
body.setOrder(com.mypurecloud.sdk.v2.model.ConversationQuery.OrderEnum.ASC);
body.setOrderBy(com.mypurecloud.sdk.v2.model.ConversationQuery.OrderByEnum.CONVERSATIONSTART);
PagingSpec pagingSpec = new PagingSpec();
pagingSpec.setPageNumber(pageNumber);
pagingSpec.setPageSize(100);
body.setPaging(pagingSpec);
ApiResponse conversations = new AnalyticsApi().postAnalyticsConversationsDetailsQueryWithHttpInfo(body);

It's also curious, because if I execute it at another time this error doesn't happen. I don't know why sometimes happens for the same query.

Thanks in advance

Hm, 20172017E isn't a valid date format. From the error, it looks like that's what analytics is sending back, which shouldn't be happening. Could you get the correlation ID header and the raw body from the response?

For the raw body of the response is impossible because the same request returns data and another times returns this error. For the moment, I only have registered 3 recurrent errors for this issue.

Any ideas what is happening and possible solutions? I understand that data is wrong from Purecloud platform.

Thanks in advance.

I set up a test and executed tens of thousands of analytics requests, but 100% were successful. There's not much I can do to investigate without a correlation ID since I can't reproduce the issue. If you can't get that, PureCloud Support may be able to dig a bit more than I can (they have support tools that I don't) and find the bad responses.

New ocurrence of this kind of error, in this case I used getConversationsCallWithHttpInfo method of ConversationsApi from Java SDK v2-7.1.2:

Can not construct instance of java.util.Date from String value ("2017-07-10T09:36:09.719Z"): not a valid representation (error: For input string: "")
at [Source: {"id":"19695bba-5ed1-456c-bb78-0dbfc6274587","participants":[{"id":"384c3daf-e5d7-49cf-929e-2862d46d6588","name":"011111111111","address":"tel:111111111111","startTime":"2017-07-10T09:22:47.075Z","connectedTime":"2017-07-10T09:22:47.186Z","endTime":"2017-07-10T09:36:09.716Z","purpose":"customer","state":"disconnected","direction":"inbound","disconnectType":"endpoint","held":false,"wrapupRequired":false,"queue":{"id":"956f5b1f-31f5-4e93-93fa-c74f13b17710","selfUri":"/api/v2/routing/queues/956f5b1f-31f5-4e93-93fa-c74f13b17710"},"attributes":{"ScreenPopId":"7615a450-f8f3-11e6-9d3e-759112962d63","label":""CS Direct"","ScreenPopName":"SCRIPT-IN-SALES"},"script":{"id":"7615a450-f8f3-11e6-9d3e-759112962d63","selfUri":"/api/v2/scripts/7615a450-f8f3-11e6-9d3e-759112962d63"},"provider":"Edge","muted":false,"confined":false,"recording":false,"recordingState":"none","ani":"tel:111111111111","dnis":"tel:+33111111111"},{"id":"a088462c-acb9-437f-a708-3e56acbc964e","name":"France","address":"sip:b932bd96-8fb9-455b-bd5f-7b7271424cdc@127.0.0.1;language=fr-CA;user=ivr","startTime":"2017-07-10T09:22:47.102Z","connectedTime":"2017-07-10T09:22:47.156Z","endTime":"2017-07-10T09:22:48.619Z","purpose":"ivr","state":"disconnected","direction":"inbound","disconnectType":"transfer","held":false,"wrapupRequired":false,"attributes":{},"provider":"Edge","peer":"a860955d-ee3d-4a66-81cc-e8d693d029e6","muted":false,"confined":false,"recording":false,"recordingState":"none","ani":"tel:033111111111","dnis":"sip:b932bd96-8fb9-455b-bd5f-7b7271424cdc@127.0.0.1;language=fr-CA;user=ivr"},{"id":"e6496b58-4871-48fe-b7cc-4d8d42d034bd","name":"QUEUE-CS-INBOUND","address":"sip:956f5b1f-31f5-4e93-93fa-c74f13b17710@127.0.0.1;language=fr-CA;src=https://edge-proxy.eu-west-1.mypurecloud.ie/connector/v1/organizations/9bb3b84d-47ed-4038-a5c7-0c8700b788bb/defaults/ivr/f35fbfe0-24fa-4abc-91a5-8c81bd5ec1cc/defaultentrypoint.vxml;user=acd","startTime":"2017-07-10T09:22:48.564Z","connectedTime":"2017-07-10T09:22:48.612Z","endTime":"2017-07-10T09:25:43.652Z","purpose":"acd","state":"disconnected","direction":"inbound","disconnectType":"transfer","held":false,"wrapupRequired":false,"queue":{"id":"956f5b1f-31f5-4e93-93fa-c74f13b17710","selfUri":"/api/v2/routing/queues/956f5b1f-31f5-4e93-93fa-c74f13b17710"},"attributes":{"ivr.Priority":"8","ivr.Skills":"bcf7b0f1-e595-4660-9afc-e64f74393b41"},"provider":"Edge","peer":"a860955d-ee3d-4a66-81cc-e8d693d029e6","muted":false,"confined":false,"recording":false,"recordingState":"none","ani":"tel:033620035107","dnis":"sip:956f5b1f-31f5-4e93-93fa-c74f13b17710@127.0.0.1;language=fr-CA;src=https://edge-proxy.eu-west-1.mypurecloud.ie/connector/v1/organizations/9bb3b84d-47ed-4038-a5c7-0c8700b788bb/defaults/ivr/f35fbfe0-24fa-4abc-91a5-8c81bd5ec1cc/defaultentrypoint.vxml;user=acd"},{"id":"9ef27660-acb6-4c17-8f16-05106ee4880d","address":"sip:C5YPPZ1.internal.lan_1@10.98.0.250","startTime":"2017-07-10T09:25:43.538Z","connectedTime":"2017-07-10T09:25:43.682Z","endTime":"2017-07-10T09:36:09.719Z","purpose":"agent","state":"disconnected","direction":"inbound","disconnectType":"peer","held":false,"wrapupRequired":true,"wrapupPrompt":"timeout","user":{"id":"6f35854b-9143-49cf-8b5d-7961d56934bd","selfUri":"/api/v2/users/6f35854b-9143-49cf-8b5d-7961d56934bd"},"queue":{"id":"956f5b1f-31f5-4e93-93fa-c74f13b17710","selfUri":"/api/v2/routing/queues/956f5b1f-31f5-4e93-93fa-c74f13b17710"},"attributes":{"InteractionID":"{{Scripter.Interaction ID}}","AgentName":" {{Scripter.Agent Name}}"},"wrapupTimeoutMs":15000,"provider":"Edge","wrapup":{"code":"ININ-WRAP-UP-TIMEOUT","tags":[],"durationSeconds":15,"endTime":"2017-07-10T09:36:24.972Z"},"peer":"a860955d-ee3d-4a66-81cc-e8d693d029e6","muted":false,"confined":false,"recording":false,"recordingState":"none","ani":"sip:033111111111@10.98.0.251;user=phone","dnis":"sip:C5YPPZ1.internal.lan_1@10.98.0.250"}],"otherMediaUris":[],"recordingState":"none","selfUri":"/api/v2/conversations/calls/19695bba-5ed1-456c-bb78-0dbfc6274587"}; line: 1, column: 2996] (through reference chain: com.mypurecloud.sdk.v2.model.CallConversation["participants"]->java.util.ArrayList[3]->com.mypurecloud.sdk.v2.model.CallMediaParticipant["endTime"])

If you can see, the error is for endTime attribute in CallMediaParticipant, it's curious because the previous error was also in a segmentEnd attribute of segment... Could it be that Purecloud doesn't set correctly datetime fields?

I see you're on a fairly old version. There was a fix in 9.1.1 (released May 25th) for an issue regarding multithreading collisions with datetime parsing. Try upgrading to the latest version (15.0.0) and let me know if you see this issue again.

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