Legacy Dev Forum Posts

 View Only

Sign Up

Exception from Java SDK deserializing response

  • 1.  Exception from Java SDK deserializing response

    Posted 06-05-2025 18:10

    mpreston | 2016-07-21 19:59:30 UTC | #1

    I am calling OutboundApi.postContactlistsContactlistIdContacts to add an entry to an existing contactlist. The call is working, as it does successfully add the new entry, but I get the exception below that I interpret as the Java SDK failing to deserialize the response from the API. I am using the new SDK that was just posted to Maven central. (version 0.1.0.0)

    com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of com.mypurecloud.sdk.model.DialerContactEntityListing out of START_ARRAY token at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@1b22d095; line: 1, column: 1] at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:216) ~[jackson-databind-2.7.0.jar:2.7.0] at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:873) ~[jackson-databind-2.7.0.jar:2.7.0] at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:869) ~[jackson-databind-2.7.0.jar:2.7.0] at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromArray(BeanDeserializerBase.java:1293) ~[jackson-databind-2.7.0.jar:2.7.0] at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:159) ~[jackson-databind-2.7.0.jar:2.7.0] at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:135) ~[jackson-databind-2.7.0.jar:2.7.0] at com.fasterxml.jackson.databind.ObjectReader._bind(ObjectReader.java:1534) ~[jackson-databind-2.7.0.jar:2.7.0] at com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:944) ~[jackson-databind-2.7.0.jar:2.7.0] at com.fasterxml.jackson.jaxrs.base.ProviderBase.readFrom(ProviderBase.java:811) ~[jackson-jaxrs-base-2.7.0.jar:2.7.0] at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:634) ~[jersey-client-1.19.1.jar:1.19.1] ... 52 common frames omitted


    tim.smith | 2016-07-21 20:15:36 UTC | #2

    This appears to be the same issue as https://developer.mypurecloud.com/forum/t/getting-an-error-when-attempting-to-load-records-to-a-contact-list/104

    tim.smith, post:6, topic:104, full:true
    The resource POST /api/v2/outbound/contactlists/{contactListId}/contacts specifies a single contact as the response in swagger, but the API actually returns a collection of contacts. This breaks the SDKs because they cannot parse the response (actual: collection vs. expected: json object). I've logged API-1705 to fix the API contract and regenerate the SDKs once the fix is in prod.

    API-1705 has been completed and is showing in the swagger definition in prod (as of sometime between when I published 0.1.0.0 yesterday evening and now). I've rebuilt and published the Java SDK and it should be on maven central soon (just waiting for sonatype to sync). The documentation on the dev center won't be updated until the next time the site has a push to prod, but the javadocs published with the SDK will be correct (the response type is a DialerContactEntityListing instead of DialerContact now).


    Felice_Vittoria | 2016-07-21 21:10:16 UTC | #3

    Tim, do you now if the fix made it to the C# SDK as well?


    tim.smith | 2016-07-21 22:05:06 UTC | #4

    I just built the .NET SDK. It has been released to nuget and will be available as soon as nuget indexes it. The new version is 0.65.0.319.


    tim.smith | 2016-07-22 15:02:50 UTC | #5

    I apologize for the confusion. API-1705 was resolved, but the issue was not fixed correctly and the documented type still does not match the actual return type. I have reopened the issue and clarified the issue further.


    system | 2017-08-28 19:25:26 UTC | #6


    This post was migrated from the old Developer Forum.

    ref: 157