How to Associat contacts with notes use API

I want to Associat contacts with notes use API.

I see [this document](Accounts Dashboard | HubSpot) and try Accociate a note with another object part.

But always “status”: “error” .

error content is here

“errors”: [
{
“subCategory”: “crm.associations.INVALID_ASSOCIATION_TYPE”,
“message”: “1 is not a valid association type between notes and contacts”,

what is associationType ?

I try to put 1 to 28 number (associationType).

all error.

could you tell me how to Associat contacts with notes use API.

Hello @kazufumi I would like to share this developer doc here with more information on how to associate this engagement (This engagement developer doc may also help)

@kaleemmolani @KyleParker any recommendations to @kazufumi?

Kindly,

Pam

Thank you share document. Is this latest documet?

I saw these documents(Accounts Dashboard | HubSpot)

and(Accounts Dashboard | HubSpot)

Is this wrog steps

1. import Contacts through API

2. import Notes through API

3. Associate 1 and 2

1.Create Contacts

Responst like this

{
“id”: “500”,
“properties”: {
“company”: “Biglytics”,
“createdate”: “2019-10-30T03:30:17.883Z”,
“email”: “bcooper@biglytics.net”,
“firstname”: “Bryan”,
“lastmodifieddate”: “2019-12-07T16:50:06.678Z”,
“lastname”: “Cooper”,
“phone”: “(877) 929-0687”,
“website”: “biglytics.net”
},
“createdAt”: “2019-10-30T03:30:17.883Z”,
“updatedAt”: “2019-12-07T16:50:06.678Z”,
“archived”: false
}

2.Create Notes

Response like this

{
“id”: “600”,
“properties”: {
“createdate”: “2019-10-30T03:30:17.883Z”,
“hs_lastmodifieddate”: “2019-12-07T16:50:06.678Z”,
“hs_note_body”: “Spoke with decision maker john”,
“hs_timestamp”: “2019-10-30T03:30:17.883Z”,
“hubspot_owner_id”: “11349275740”
},
“createdAt”: “2019-10-30T03:30:17.883Z”,
“updatedAt”: “2019-12-07T16:50:06.678Z”,
“archived”: false
}

3.Associate

contactID: 500

toObjectType: notes

toObjectId: 600

associationType: 1 ~ 28 // type all of them

@kazufumi

Query this endpoint to get the association id

https://api.hubapi.com/crm/v3/associations/notes/contacts/types

For me, it returns this

{
 "results": [
 {
 "id": "202",
 "name": "note_to_contact"
 }
 ]
}

thank you @dennisedson and @PamCotton

I success to associate notes to contact!

curl --request PUT \--url 'https://api.hubspot.com/crm/v3/objects/notes/1*********0/associations/contact/***/202?hapikey=API_KEY'

Do you know how to associate contact to note

I mean like this

curl --request PUT \--url 'https://api.hubspot.com/crm/v3/objects/contact/***/associations/notes/1*********0/202?hapikey=API_KEY'

Is this possible ??

Error occured at the moment

{"status":"error","message":"There was a problem with the request.","correlationId":"3e753cca-dff4-4c28-ac7d-5d01012479c7"}

sorry I attempt

curl --request GET \--url 'https://api.hubapi.com/crm/v3/associations/contacts/notes/types?hapikey=API_KEY'

return

{"results":[{"id":"201","name":"contact_to_note"}]}

So problem is solved!

Thanks