# Can not deserialize?

**URL:** <https://community.hubspot.com/t/can-not-deserialize/11780>\
**Category:** APIs & Integrations\
**Tags:** developer-tools\
**Created:** [February 5, 2018, 11:17am UTC](https://community.hubspot.com/t/can-not-deserialize/11780 "2018-02-05T11:17:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [February 5, 2018, 11:17am UTC](https://community.hubspot.com/t/can-not-deserialize/11780/1 "2018-02-05T11:17:54Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [February 6, 2018, 11:24pm UTC](https://community.hubspot.com/t/can-not-deserialize/11780/2 "2018-02-06T23:24:32Z")

</div>

HI [@aliknox](https://community.hubspot.com/u/aliknox),

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

![]() [developers.hubspot.com](https://developers.hubspot.com/docs/methods/engagements/create_engagement)

### [Create an Engagement | Engagements API](https://developers.hubspot.com/docs/methods/engagements/create_engagement)

POST /engagements/v1/engagements - Create an engagement via the HubSpot API.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [February 7, 2018, 5:18pm UTC](https://community.hubspot.com/t/can-not-deserialize/11780/3 "2018-02-07T17:18:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Derek\_Gervais](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/derek_gervais/32/17429_2.png) [@Derek\_Gervais](https://community.hubspot.com/u/Derek_Gervais)\
**Post date:** [February 8, 2018, 7:58pm UTC](https://community.hubspot.com/t/can-not-deserialize/11780/4 "2018-02-08T19:58:51Z")

</div>

Hi [@aliknox](https://community.hubspot.com/u/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?

 ![](https://d2qpr2jzcazej7.cloudfront.net/original/3X/2/3/23ea0ff39f94745d32876853337d2fc1c4039be4.png) [knowledge.hubspot.com](https://knowledge.hubspot.com/articles/kcs_article/contacts/how-to-change-which-activities-show-in-the-timeline)

 ![29ad476bde5f5b0596e6d93e215ec3bb1ad46200.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/2/29ad476bde5f5b0596e6d93e215ec3bb1ad46200.png)

### [How can I change which activities show in the timeline?](https://knowledge.hubspot.com/articles/kcs_article/contacts/how-to-change-which-activities-show-in-the-timeline)

Navigate to a contact, company, or deal record \> click the filter timeline dropdown \> check the boxes beside the information you want to include.
