Cannot deserialize value of type `java.lang.String` from Object value (token `JsonToken.START_OBJECT

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. any help is greatly appreciated!

Hi, @carter_deacon :waving_hand: 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

Hey @Jaycee_Lewis 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 seemed to get me over the line.

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

Cheers,

Carter

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