CRM Card Response Parse Error

Hello,

My CRM Card is making a request to my application. In the “monitor logs,” I’m getting the following error:

com.fasterxml.jackson.databind.exc.ValueInstantiationException: Cannot construct instance of `com.hubspot.linkedsalesobjects.base.models.objects.ObjectIntegratorView`, problem: propertyValues value
 at [Source: (com.hubspot.java.io.ChunkedByteArrayOutputStream$ChunkedByteArrayInputStream); line: 1, column: 380] (through reference chain: com.hubspot.linkedsalesobjects.base.models.objects.IntegratorViewResult$Json["results"]->java.util.ArrayList[0])

I’m not sure what to make of this error. When I hit the API endpoint myself, I’m getting the following response:

{
 "results": [
 {
 "objectId": "xxx",
 "id": "uuid",
 "title": "Swig",
 "link": "<hidden link>",
 "status": "ON_TIME",
 "startDate": "2023-04-21T00:00:00.000Z",
 "endDate": "2023-04-21T00:00:00.000Z",
 }
 ]
}

The objectId, id, and link properties have been replaced for privacy purposes. I’m not sure what I’m missing. Any help to at least understand the error message would be appreciated.

Hello @kwright2
From the sample JSON response you provided, it seems that there is a trailing comma after the “endDate” property. Remove the comma to make the JSON valid

{
 "results": [
 {
 "objectId": "xxx",
 "id": "uuid",
 "title": "Swig",
 "link": "<hidden link>",
 "status": "ON_TIME",
 "startDate": "2023-04-21T00:00:00.000Z",
 "endDate": "2023-04-21T00:00:00.000Z"
 }
 ]
}

After making this correction, try parsing the response again and see if the error persist

Hey @himanshurauthan , thanks for the reply. That was my mistake in copying and pasting the JSON. I removed some of the fields for privacy and forgot to remove that comma. Hitting the API endpoint returns a valid JSON.

Does the error message mean that the JSON is invalid?

Turns out the issue was that one of the fields is null. HubSpot doesn’t accept a null value. My personal request to the HubSpot team is to return a better error for this scenario. It’s common and would be extremely useful.