Create Note And Associated To Contact

curl --location --request POST ‘https://api.hubspot.com/crm/v3/objects/notes’ \

--header ‘Authorization: Bearer COHmlpjlMBIT_geTU8Bi-_IcAED89x8A4MewARjrq7cLIMmc1RcopvZWMhSz3L0aUHzYsFszfd7_A-HOoI5oSDo7AHVtx_8HAAD8__f_4P_8zjyGAABg_iY0PQwg-Jz_D_7D__85AAD4hef____w__MLAACA__8DAMPlAQJCFAedJXWSPzz65htKoI6WpII3qVyDSgNuYTFSAFoA’ \

--header ‘Content-Type: application/json’ \

--header ‘Cookie: __cf_bm=NaE_vS7mKBdsTMkdrUESMfDrEGhE0xG4nE_Qn6spr4c-1676429160-0-ATu+12jIPyF/xG2HnomtAXIc633jntjuFQDyUAdnkYA+3y78WcrJykuRihpNwyuoKOmDeb6y97l/Si3hRdqgwW8=; __cfruid=b53e01ceed7b98532d9a5dde0ce7a6b465931c25-1676429749’ \

--data-raw '{

“properties”: {

“hs_timestamp”: “2023-02-14T16:41:59.155Z”,

“hs_note_body”: “Spoke with decision maker Carla. Attached the proposal and draft of contract.”,

“hubspot_owner_id”: 326581017

},

“associations”: [

{

“to”: {

“id”: 51

},

“types”: [

{

“associationCategory”: “HUBSPOT_DEFINED”,

“associationTypeId”: 20132323223

} ]

}

]

}’

but I am getting the following error and I dont know how to fixed

{

“status”: “error”,

“message”: “Invalid input JSON on line 15, column 43: Numeric value (20132323223) out of range of int (-2147483648 - 2147483647)”,

“correlationId”: “23185474-6577-420f-8b74-6426470836fc”

the associationTypeId

Hi, @LOsorio25 :waving_hand: It looks like you have an incorrect association typeId. It should be a much shorter value — 202, for example. Retrieve association types.

The HubSpot defined Note > Contact typeId is 202. You can use this endpoint to find the type Ids for any Object > Object.

GET /crm/v4/associations/{fromObjectType}/{toObjectType}/labels

Example from Postman:

Request

GET {{API URL}}/crm/v4/associations/notes/contacts/labels

Response

{
 "results": [
 {
 "category": "HUBSPOT_DEFINED",
 "typeId": 202,
 "label": null
 }
 ]
}

Have fun building! — Jaycee

Thank you, but this number 202 can be hardcode it ? Is this the same number
over all accounts on hubspot ?