APIs & Integrations

JChen1
Participante

Creating CRM Associations via API

Trying to associate Products (line items) with Deals via the API and I'm not sure of the proper syntax to test the call within the HubSpot API documentation for Associations: https://developers.hubspot.com/docs/api/crm/associations.

 

I have the fromObjectId and the toObjectId, but the documentation doesn't really say what the proper syntax should be for Type, fromObjectType, and toObjectType.

 

I've tried product_to_deal and products_to_deals for Type and it's throwing errors specifically to the Type when I test the call in the documentation.

 

I'm using fromObjectType of Products and toObjectType of Deals and there doesn't seem to be any issues with that.

 

The Legacy API accomplished this Type using codes and laid out exactly which codes corresponded to what types of associations (https://legacydocs.hubspot.com/docs/methods/crm-associations/crm-associations-overview), but it doesn't look like the New API documentation does that.

0 Avaliação positiva
1 Resposta 1
dennisedson
Equipe de Produto da HubSpot
Equipe de Produto da HubSpot

Creating CRM Associations via API

Hi @JChen1 

Try "line_item_to_deal"

You can hit this endpoint (changing the objects in the request) to see the name

https://api.hubapi.com/crm/v3/associations/line_items/deals/types?hapikey=sswqsqioqq

0 Avaliação positiva