APIs & Integrations

aliknox
Member

Can not deserialize?

SOLVE

I get the following error when I post the create engagement.

Can not deserialize instance of com.hubspot.engagements.base.detail.views.EngagementView out of START_ARRAY token"

Is it the square bracket that appears after the JSON is encoded.

{“engagement”:
[{“property”:“active”,“value”:“True”},
{“property”:“ownerId”,“value”:“31308819”},
{“property”:“type”,“value”:“NOTE”},
{“property”:“timestamp”,“value”:1517829083}],
“associations”:
[{“property”:“contactIds”,“value”:“2”},
{“property”:“companyIds”,“value”:“686724768”}],
“metadata”:
[{“property”:“body”,“value”:“Import Record Test”}
]}

0 Upvotes
1 Accepted solution
Derek_Gervais
Solution
HubSpot Alumni
HubSpot Alumni

Can not deserialize?

SOLVE

HI @aliknox,

That’s not the proper format for the engagement JSON; there’s an example in the developer doc below:

View solution in original post

0 Upvotes
3 Replies 3
Derek_Gervais
HubSpot Alumni
HubSpot Alumni

Can not deserialize?

SOLVE

Hi @aliknox,

If an engagement has an object ID in it’s associations, then it should appear on the object’s timeline. Are you missing engagements in the timeline? Can you double check the timeline filters at the top right and make sure your engagement type is selected as visible?

0 Upvotes
aliknox
Member

Can not deserialize?

SOLVE

Hi Derek,

Thanks for your help, it seemed to be something to do with the array conversion between PHP and Javascript.

Just a quick question, the records are now appearing and I can bring them out through the Get Engagement API. Do you know if I need to add the record to a timeline. All the associations are correct so I’m assuming I need to add something else.

Can you point me in the right direction.

Thanks,

Ali

0 Upvotes
Derek_Gervais
Solution
HubSpot Alumni
HubSpot Alumni

Can not deserialize?

SOLVE

HI @aliknox,

That’s not the proper format for the engagement JSON; there’s an example in the developer doc below:

0 Upvotes