Retrieve deal association tags using HubSpot API

Hi there,
I´m trying to retrieve deal association tags using the API, but cannot find the property where this information is saved in the CRM. To be more precise, the data I want to retrieve is the one shown below

This information is set in the Associations tab, in objects, but cannot find a way to retrieve this information from API when fetching deals information through API.

Thanks in advance!

@Egoi - I may be missing something, but I think you will be required to make a second API call using a Deal ID (and that of the assoicated object) to retrieve association information.

The documentation for this is at: Accounts Dashboard | HubSpot

Best of luck!

Steve

Hi @SteveHTM,

Thanks for your reply. Already checked assocciations documentation but I don’t see the option to retrieve associations tags related to deals.

Hi @Egoi ,
You are looking for the association label to be specific.

If you retrieve the deal using the ‘read’ endpoint, you can retrieve the associated objects as well, for example;

https://api.hubapi.com/crm/v3/objects/deals/{dealId}?associations=contacts

will return something like;

"associations": {
 "contacts": {
 "results": [
 {
 "id": "<ID>",
 "type": "label"
 },
 ]
 }
}

You can retrieve the association label from the “type” in this result.

I don’t know what object association you are retrieving, but I would have thought that a call like:

GET/crm/v4/objects/deal/{dealId}/associations/{toObjectType}

would get you the data you want?

Steve

``

@SteveHTM @Teun
Thanks for your time!

Indeed i´m not looking for object associations, but as @SteveHTM mentioned label associations. I can retrieve them with no problem through API, the problem is that I´m not able to find for a deal for example, and check if it has any association label.
For objects associations there is no problem as you can retrieve this information through the request, but not for labels, at least I´m not able to find this information in the documentation. I would need some kind of:

"associations": {
		"labels": {
			"results": [
				{
					"id": "6029651",
					"type": "deal_to_contact"
				}
			]
		}
	}

in the response, so that I can do another request to the API and find to which label is associated 6029651 id.

Got it, this should be the endpoint I was looking for:
/crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}

Thanks for your time!