Legacy Dev Forum Posts

 View Only

Sign Up

Get Conversations by communicationType throws Exception

  • 1.  Get Conversations by communicationType throws Exception

    Posted 06-05-2025 18:10

    mvishwanath | 2016-07-25 06:52:07 UTC | #1

    Code:

    Configuration.getDefaultApiClient().setAccessToken("YOURACCESSTOKEN"); ConversationsApi conversationsApi = new ConversationsApi(); try { System.out.println(conversationsApi.getConversations("email")); } catch (ApiException e) { e.printStackTrace(); }

    Here is the Exception when a conversation is connected: com.sun.jersey.api.client.ClientHandlerException: com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not construct instance of com.mypurecloud.sdk.model.Email$StateEnum from String value ("connected"): value not one of declared Enum instance names: [NONE, CONNECTED, DISCONNECTED, ALERTING]


    tim.smith | 2016-07-25 14:09:37 UTC | #2

    It appears that Java is requiring the enums to be case sensitive and the documentation that the SDK is generated from doesn't match what the API is sending. I currently have an ongoing project to remove all enums from the SDKs and replace with strings. There are several issues like this that are making enums problematic.

    As a temporary workaround, you can download the SDK source from github and modify the values as necessary and compile locally using mvn package in the build directory.


    mvishwanath | 2016-07-26 15:10:17 UTC | #3

    Thank you for the response. Looking forward for the new version.


    system | 2017-08-28 19:25:30 UTC | #4


    This post was migrated from the old Developer Forum.

    ref: 166