APIs & Integrations

gfors
Member

Deserialization error

SOLVE

I was told to post here to hopefully get an answer from support.  Hubspot gives me the infamous "Response deserialization error" without actually telling me why.

 

Hopefully someone can tell me why?

Here is a redacted json blob:

 

{
"results": [
{
"id": "3563b48d-582b-4cc7-b82d-287f93829b35",
"title": "Some title",
"authorId": 222,
"authorName": "bobby mcbob",
"accountId": 1111,
"accountName": "Foo Bob",
"noteType": "admin",
"noteContentType": "text\/plain",
"note": "malesuada dapibus nec viverra",
"created": "2017-07-07T19:15:27+00:00",
"tags": [],
"accountAccessible": false,
"appId": null,
"appName": null,
"starred": false,
"updated": "2017-07-07T19:15:27+00:00",
"updateAuthorId": null,
"updateAuthorName": null,
"associations": null,
"isPartial": false
},
{
"id": "3563b48d-582b-4cc7-b82d-287f93829b35",
"title": "Some title",
"authorId": 222,
"authorName": "bobby mcbob",
"accountId": 1111,
"accountName": "Foo Bob",
"noteType": "admin",
"noteContentType": "text\/plain",
"note": "malesuada dapibus nec viverra",
"created": "2017-07-07T19:15:27+00:00",
"tags": [],
"accountAccessible": false,
"appId": null,
"appName": null,
"starred": false,
"updated": "2017-07-07T19:15:27+00:00",
"updateAuthorId": null,
"updateAuthorName": null,
"associations": null,
"isPartial": false
}
]
}

 my propertiesmy properties

0 Upvotes
1 Accepted solution
gfors
Solution
Member

Deserialization error

SOLVE

Okay, finally found the issue.  Apparently objectId has to be an integer.

Last bit I'm trying to fix is the datetime field, but at least that does not keep the note from displaying. It just says "Invalid property".

View solution in original post

15 Replies 15
WendyGoh
HubSpot Employee
HubSpot Employee

Deserialization error

SOLVE

Hey @gfors,

 

One thing that jumps out to me is that you're using id instead of objectId. As stated on this documentation, the objectId is the unique ID for the crm object and it is a required property.

 

As such, could you try changing id to objectId and see if it works?

0 Upvotes
gfors
Member

Deserialization error

SOLVE

Added that, still no luck. Sure would be nice if the monitor returned a usable error response. Something missing?  Something misformatted?

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Deserialization error

SOLVE

Hey @gfors,

 

Thanks for the feedback! I agree that there's opportunity for us to return a more targeted error message.

 

Digging further into this error, I'm assuming that it is for app 222414? If so, when I attempt to reach the GET url (the data fetch url) - mgmt.dev.xxx.com/xxx/xxxx, I'm seeing a 401 error. In this case, could your team ensure that HubSpot is able to reach the url so that we are able to populate the returned sales object?

0 Upvotes
gfors
Member

Deserialization error

SOLVE

Yes, that's the app. Your monitor UI shows 200s.  It's not a public api so we are validating the signature from HS

0 Upvotes
gfors
Member

Deserialization error

SOLVE

Any news on this? Can I get this pushed to dev support?

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

Deserialization error

SOLVE

Hey @gfors,

 

I'm the dev support in HubSpot and I'd be happy to look further into this for you.

 

Upon digging, I was able to narrow down the issue in which I believe is the null value. 

 

I change the null value to "" like this:

 

{objectId: 1,
    "title": "Some title",
    "authorId": 222,
    "authorName": "bobby mcbob",
    "accountId": 1111,
    "accountName": "Foo Bob",
    "noteType": "admin",
    "noteContentType": "text\/plain",
    "note": "malesuada dapibus nec viverra",
    "created": "2017-07-07T19:15:27+00:00",
    "tags": [],
    "accountAccessible": false,
    "appId": "",
    "appName": "",
    "starred": false,
    "updated": "2017-07-07T19:15:27+00:00",
    "updateAuthorId": "",
    "updateAuthorName": "",
    "associations": "",
    "isPartial": false};

and this shows up just fine on my crm card. 

 

Could you try and see if this works for you?

0 Upvotes
gfors
Member

Deserialization error

SOLVE

I've overhauled the endpoint so results now contains just an array of:

        {
            "title": "Migration Config for something something",
            "authorName": "foo.bob",
            "noteType": "admin",
            "note": "\nmalesuada dapibus nec viverra",
            "created": "2017-07-07T19:15:27+00:00",
            "objectId": "3563b48d-582b-4cc7-b82d-287f93829b35"
        },
...

Made sure everything is a string (no nulls).  Still failing after I deployed.

0 Upvotes
gfors
Solution
Member

Deserialization error

SOLVE

Okay, finally found the issue.  Apparently objectId has to be an integer.

Last bit I'm trying to fix is the datetime field, but at least that does not keep the note from displaying. It just says "Invalid property".

gfors
Member

Deserialization error

SOLVE

Well, I can't seem to find the magical format expected by HS for date times, so I'm just going to change the card property to a string. :sigh:

0 Upvotes
gfors
Member

Deserialization error

SOLVE

Deployed my working-in-staging code to production.

Duplicated hubspot app & card.

Linked new app to production hubspot.

 

"Response deserialization error" :cryingblood:

 

I give up...for now.

0 Upvotes
soul_in_code
Participant

Deserialization error

SOLVE

there could be some other issue which you may have missed.

 

0 Upvotes
gfors
Member

Deserialization error

SOLVE

Well, without help from someone who can actually check a real response against the system, it's just me throwing darts blindfolded.

0 Upvotes
gfors
Member

Deserialization error

SOLVE

Wait... does objectId have to be the related object's id? That seems silly since the api call is filtering by that... why would it be needed in the response? I was just inserting incrementing integers and it seems to work.

0 Upvotes
soul_in_code
Participant

Deserialization error

SOLVE

cool, glad I helped you out.

 

0 Upvotes
soul_in_code
Participant

Deserialization error

SOLVE

Are you sure that you are passing in the correct object ID?

What I think is the objectID should always be recordID of the record and it should be integer instead of some random unique string.

Something like this should work, I guess.

 {
            "title": "Migration Config for something something",
            "authorName": "foo.bob",
            "noteType": "admin",
            "note": "\nmalesuada dapibus nec viverra",
            "created": "2017-07-07T19:15:27+00:00",
            "objectId": 35463
        },
0 Upvotes