sromocki | 2016-08-03 16:19:40 UTC | #1
Hello API team,
I'm getting an exception when trying to retrieve a call via API.
CreateCallResponse result = apiInstance.postCalls(callRequest); callId = result.getId(); CallConversation result = apiInstance.getCallsCallId(callId);
Results in:
com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not construct instance of com.mypurecloud.sdk.model.CallMediaParticipant$StateEnum from String value 'connected': value not one of declared Enum instance names: [UPLOADING, CONTACTING, TERMINATED, OFFERING, NONE, CONNECTED, DISCONNECTED, TRANSMITTING, CONVERTING, DIALING, ALERTING]
Am I doing something wrong?
Sean
tim.smith | 2016-08-03 17:15:23 UTC | #2
sromocki, post:1, topic:225
Am I doing something wrong?
No. The API is documented as expecting CONNECTED, so that's what the SDK expects, but is actually sending connected so it fails to parse the enum. I'm working on a project to remove enums from all of the SDKs and replace with string values. Unfortunately, this will be broken until that effort is complete; it's one of my top priorities, but is quite a bit of work. For now, you'll have to work around it by making that request manually (with RestSharp) or modifying the enum values in the SDK's source code and building it yourself.
sromocki | 2016-08-03 17:26:59 UTC | #3
OK, no problem. I'll find a way to work around.
sromocki | 2016-08-03 18:07:19 UTC | #4
@tim.smith Do you have an ETA for when this will be fixed? Looks like it's affecting a number of conversation API endpoints.
tim.smith | 2016-08-03 19:02:49 UTC | #5
I don't have an ETA, but the .NET and Java SDKs are at the top of my list for this fix. As long as nothing else with higher priority comes up, I hope to have them released this week.
tim.smith | 2016-08-05 16:08:03 UTC | #6
tim.smith, post:1, topic:250, full:true
The handling of unknown enum values has been improved as of v0.19.0.64.
In previous versions, a serialization exception would be thrown if the API response contained a value for an enum property that was not a member of the enum type known to the SDK. It would also throw an exception if the string value did not exactly match the case of the documentation.
As of v0.19.0.64, a new member has been added to all enums and is named OutdatedSdkVersion. If your application ever encounters this enum member, it means that the server has sent a value that is not in your version of the SDK and that your application should be updated to the latest version of the SDK to handle the new value.
The fix for this will be available as soon as this version syncs to maven central.
system | 2017-08-28 19:25:55 UTC | #7
This post was migrated from the old Developer Forum.
ref: 225