APIs & Integrations

Vnico99
Participant

Get objectid couple from association

Hi all,

 

I've created a custom objet mycustomobject which is associated with contacts. 


If I do this:
curl -X GET https://api.hubapi.com/crm/v4/associations/mycustomobject /contacts/labels?hapikey=MYKEY


I can retieve all associations with labels but I can't get my custom object ID and the Contact ID associated. 


Is there a way to get a full association list between Contact and My custom object with IDs (and labels too) ?


Thxs

0 Upvotes
3 Replies 3
Vnico99
Participant

Get objectid couple from association

Hi Dennis,

Object has been created via the API with

"associatedObjects": [
"CONTACT", "DEAL"
]

But associations are done by Sales directly via the the hubspot Admin

 

A GET on https://api.hubapi.com/crm/v4/associations/property/contacts/labels

give associations but I didn't succeed in geting Object ID's associated 

{
"results": [{
"category": "USER_DEFINED",
"typeId": 38,
"label": "Dislike"
}, {
"category": "USER_DEFINED",
"typeId": 13,
"label": null
},...

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Get objectid couple from association

@Vnico99 

Ah! Gotchya.  To get that info, you will need the ID of one of the records, then you can query this endpoint

/crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}

 

0 Upvotes
dennisedson
HubSpot Product Team
HubSpot Product Team

Get objectid couple from association

@Vnico99 

Can you show us the request you are making to create the association? (minus hapikey)

0 Upvotes