APIs & Integrations

AChakravarthy0
Member

Notes API Creating Notes but not associating it to a Contact

I am trying to create a note and associate with a contact. I am able to execute the request successfully but i do not see the notes associated with the contact in the UI:

I do a POST request to https://api.hubspot.com/crm/v3/objects/notes

 

with the following request body:

// Example request body
{
"properties": {
"hs_timestamp": "2023-09-22T03:30:17.883Z",
"hs_note_body": "Test Note"
},
"associations": [
{
"to": {
"id": 1060101
},
"types": [
{
"associationCategory": "HUBSPOT_DEFINED",
"associationTypeId": 202
} ]
}]
}
 
 
 
I get back a 201 response:
{
"id": "40452090768",
"properties": {
"hs_body_preview": "Test Note",
"hs_body_preview_html": "<html>\n <head></head>\n <body>\n Test Note\n </body>\n</html>",
"hs_body_preview_is_truncated": "false",
"hs_createdate": "2023-09-26T22:23:55.902Z",
"hs_lastmodifieddate": "2023-09-26T22:23:55.902Z",
"hs_note_body": "Test Note",
"hs_object_id": "40452090768",
"hs_object_source": "INTEGRATION",
"hs_object_source_id": "2132579",
"hs_timestamp": "2023-09-22T03:30:17.883Z"
},
"createdAt": "2023-09-26T22:23:55.902Z",
"updatedAt": "2023-09-26T22:23:55.902Z",
"archived": false
}
 
However i do not see notes under the "Notes" tab or "Activity Timeline" tab
0 Upvotes
4 Replies 4
Mike_Eastwood
Key Advisor | Gold Partner
Key Advisor | Gold Partner

Notes API Creating Notes but not associating it to a Contact

Hi @AChakravarthy0 

 

The Associations API is very fussy with Association Types. Based on this list of Association Type ID values I would try 201 – Contact to note rather than 202 [edited to correct error] which is in your example.

 

Did that work?

Mike

 

Here to learn more about HubSpot and share my HubSpot Knowledge. I'm the founder of Webalite a HubSpot Partner Agency based in Wellington, New Zealand and the founder of Portal-iQ the world's first automated HubSpot Portal Audit that helps you work smarter with HubSpot.

 

 

0 Upvotes
AChakravarthy0
Member

Notes API Creating Notes but not associating it to a Contact

Hi, did you mean use 201 - Contact to Note?

I just did a PUT request on https://api.hubspot.com/crm/v3/objects/contact/1060101/associations/note/40452090768/201

I get the response as 

{
"id": "1060101",
"properties": {
"createdate": "2023-09-26T21:17:25.709Z",
"hs_object_id": "1060101",
"lastmodifieddate": "2023-09-26T23:29:38.119Z"
},
"createdAt": "2023-09-26T21:17:25.709Z",
"updatedAt": "2023-09-26T23:29:38.119Z",
"archived": false,
"associations": {
"notes": {
"results": [
{
"id": "40452090768",
"type": "contact_to_note"
}
]
}
}
}
 
But i still dont see the notes on the UI associated with the corresponding contact
0 Upvotes
Mike_Eastwood
Key Advisor | Gold Partner
Key Advisor | Gold Partner

Notes API Creating Notes but not associating it to a Contact

Hi @AChakravarthy0 

 

Your post says you are using v3 but it should be using v4 of the API.

 

https://api.hubspot.com/crm/v4/objects/contact/1060101/associations/note/40452090768/201 

 

Did that work?

Mike

 

p.s. I fixed the error in my reply, thanks

0 Upvotes
AChakravarthy0
Member

Notes API Creating Notes but not associating it to a Contact

I get a 404 Not found when i execute this

0 Upvotes