APIs & Integrations

kazufumi
Participant

How to Associat contacts with notes use API

SOLVE

I want to Associat contacts with notes use API.

I see [this document](https://developers.hubspot.com/docs/api/crm/notes) 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.

0 Upvotes
2 Accepted solutions
dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

How to Associat contacts with notes use API

SOLVE

@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"
        }
    ]
}

 

View solution in original post

kazufumi
Solution
Participant

How to Associat contacts with notes use API

SOLVE

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

View solution in original post

0 Upvotes
6 Replies 6
kazufumi
Solution
Participant

How to Associat contacts with notes use API

SOLVE

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

0 Upvotes
PamCotton
Community Manager
Community Manager

How to Associat contacts with notes use API

SOLVE

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

Você sabia que a Comunidade está disponível em outros idiomas?
Participe de conversas regionais, alterando suas configurações de idioma !


Did you know that the Community is available in other languages?
Join regional conversations by changing your language settings !




kazufumi
Participant

How to Associat contacts with notes use API

SOLVE

Thank you share document. Is this latest documet?

 

I saw these documents(https://developers.hubspot.com/docs/api/crm/contacts)

and(https://developers.hubspot.com/docs/api/crm/notes)

 

Is this wrog steps

1. import Contacts through API

2. import Notes through API

3. Associate 1 and 2

0 Upvotes
kazufumi
Participant

How to Associat contacts with notes use API

SOLVE

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

0 Upvotes
dennisedson
Solution
HubSpot Product Team
HubSpot Product Team

How to Associat contacts with notes use API

SOLVE

@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"
        }
    ]
}

 

kazufumi
Participant

How to Associat contacts with notes use API

SOLVE

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_KE...'

 

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_KE...'


Is this possible ??

 

Error occured at the moment

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

 

0 Upvotes