# Cannot deserialize value of type \`java.lang.String\` from Object value (token \`JsonToken.START\_OBJECT

**URL:** <https://community.hubspot.com/t/cannot-deserialize-value-of-type-java-lang-string-from-object-value-token-jsontoken-start-object/74520>\
**Category:** APIs & Integrations\
**Tags:** developer-tools, starter\
**Created:** [February 6, 2023, 5:35am UTC](https://community.hubspot.com/t/cannot-deserialize-value-of-type-java-lang-string-from-object-value-token-jsontoken-start-object/74520 "2023-02-06T05:35:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![carter\_deacon](https://avatars.discourse-cdn.com/v4/letter/c/9fc29f/32.png) [@carter\_deacon](https://community.hubspot.com/u/carter_deacon)\
**Post date:** [February 6, 2023, 5:35am UTC](https://community.hubspot.com/t/cannot-deserialize-value-of-type-java-lang-string-from-object-value-token-jsontoken-start-object/74520/1 "2023-02-06T05:35:01Z")

</div>

Hey guys,

I am trying to create a note with an association and continually getting this error “Cannot deserialize value of type `java.lang.String` from Object value (token `JsonToken.START_OBJECT`)”.

The properties for the request are as follows:

const properties = {  
‘hs\_timestamp’: date.toISOString(),  
‘hs\_note\_body’: sms\_text +, // Placeholder vlue (string “TESTING”)  
‘hubspot\_owner\_id’: “170790786”,  
‘associations’: {  
‘to’: {  
‘id’: userRecord // Placeholder (user ID: 234XXXX)  
},  
“types”: [{  
“associationCategory”: “HUBSPOT\_DEFINED”,  
“associationTypeId”: 202  
}]  
}  
};

Does anyone have any thoguhts on the best way to isolate this further? Seems to be having issues with the values being in an array but that content is copied directly from the example POST request [here](https://developers.hubspot.com/docs/api/crm/notes). any help is greatly appreciated!

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [February 6, 2023, 8:32pm UTC](https://community.hubspot.com/t/cannot-deserialize-value-of-type-java-lang-string-from-object-value-token-jsontoken-start-object/74520/2 "2023-02-06T20:32:27Z")

</div>

Hi, [@carter\_deacon](https://community.hubspot.com/t5/user/viewprofilepage/user-id/516521) 👋 Dealing with this one can be frustration as the error is a bit vague. Does it occur if you make a test using the endpoint example listed on the page itself? Sometimes, in my own use, if I can verify it works to use the on-page example and in Postman, it helps rule out some common troubleshooting suggestions the community may have.

Best,

Jaycee

---

<div class="post-metadata">

**Author:** ![carter\_deacon](https://avatars.discourse-cdn.com/v4/letter/c/9fc29f/32.png) [@carter\_deacon](https://community.hubspot.com/u/carter_deacon)\
**Post date:** [February 6, 2023, 10:24pm UTC](https://community.hubspot.com/t/cannot-deserialize-value-of-type-java-lang-string-from-object-value-token-jsontoken-start-object/74520/3 "2023-02-06T22:24:09Z")

</div>

Hey [@Jaycee\_Lewis](https://community.hubspot.com/t5/user/viewprofilepage/user-id/127074) thanks for your response!

I ended up getting this to work by creating the note with no association and **then** adding a PUT request to update the records with associations rather than trying to create the note and assocation all at once - [Associations V3](https://developers.hubspot.com/docs/api/crm/associations/v3) seemed to get me over the line.

An extra step but it does the job so it’s fine by me!

Cheers,

Carter

---

<div class="post-metadata">

**Author:** ![Jaycee\_Lewis](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/jaycee_lewis/32/61352_2.png) [@Jaycee\_Lewis](https://community.hubspot.com/u/Jaycee_Lewis)\
**Post date:** [February 6, 2023, 10:25pm UTC](https://community.hubspot.com/t/cannot-deserialize-value-of-type-java-lang-string-from-object-value-token-jsontoken-start-object/74520/4 "2023-02-06T22:25:19Z")

</div>

Thanks for letting us know 🙌 I typically do it in two calls as well. Have a great day! — Jaycee
