vrvoice1 | 2016-08-01 11:07:40 UTC | #1
Hi, after an inbound queue call I want to collect a list of available wrapup codes. For that I'm using the following code: WrapupCode result = api.GetConversationIdParticipantsParticipantIdWrapupcodes(conversationId, participantId);
The result is this exception:
Cannot deserialize the current JSON array (e.g. [1,2,3]) into type 'ININ.PureCloudApi.Model.WrapupCode' because the type requires a JSON object (e.g. {"name":"value"}) to deserialize correctly. To fix this error either change the JSON to a JSON object (e.g. {"name":"value"}) or change the deserialized type to an array or a type that implements a collection interface (e.g. ICollection, IList) like List<T> that can be deserialized from a JSON array. JsonArrayAttribute can also be added to the type to force it to deserialize from a JSON array. Path '', line 1, position 1.
On the Postman result I can see, that it must be a list of warpup codes, but the Api Object WrapupCode represents only a single wrapup code.
Is there a Problem in the Api? I'm using the newest version 0.66.0.321
The problem also occurs in the method presensceApi.GetSystempresences()
Regards,
Sven
tim.smith | 2016-08-01 14:47:43 UTC | #2
These issues are due to a difference in the documented return type vs. actual return type from the API. I've created API-1784 to address GET /api/v2/conversations/{conversationId}/participants/{participantId}/wrapupcodes and API-1785 to address GET /api/v2/systempresences. The fix is pretty quick, but it will take a few days for the fix to surface in production and for the SDKs to be regenerated.
I don't think there's a workaround for the conversations resource except to make the request without using the SDK. The presences issue can be worked around by using GET /api/v2/presencedefinitions instead, which will return a list of both system presences and custom presences defined in your org.
system | 2017-08-28 19:25:42 UTC | #3
This post was migrated from the old Developer Forum.
ref: 193