Can not deserialize?


#1

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”}
]}


#2

HI @aliknox,

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


#3

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


#4

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?