APIs & Integrations

trayconnector
Member

Object types for parent to child companies associations in API v4

Hi,
I can't find the values for object types when it comes to child and parent companies in API v4 associations. Going through the association endpoints: https://developers.hubspot.com/docs/api/crm/associations,

I'd like to find the association definition ID between the Child Company and Parent Company object types using the the

GET /crm/v4/associations/{fromObjectType}/{toObjectType}/labels

endpoint. 
I understand in the legacy docs this is referred to as 13 and 14. But how do I get the values using the above endpoint in API v4?
These are the values I have tried so far for "fromObjectType" and "toObjectType":

GET /crm/v4/associations/company_child/company_parent/labels
GET /crm/v4/associations/child_company/parent_company/labels
GET /crm/v4/associations/child company/parent company/labels
GET /crm/v4/associations/child-company/parent-company/labels

 

If I call the above endpoint with the value "company" (/crm/v4/associations/company/company/labels) I then get the following response: 

 

{
  "results": [
    {
      "category": "HUBSPOT_DEFINED",
      "typeId": 14,
      "label": "Parent Company"
    },
    {
      "category": "HUBSPOT_DEFINED",
      "typeId": 13,
      "label": "Child Company"
    }
  ]
}

 

But this is not something I want. I won't know what my users would choose for those values so I need to be able to provide them with the correct string value.

I appreciate any help on this. 

 

 
0 Upvotes
2 Replies 2
CMcKay
Top Contributor

Object types for parent to child companies associations in API v4

The Object_type for a company is 0-2, it doesn't matter if it's a parent company or child company. Those labels (parent/child) only is relevent when you're trying to associate a company to another company.

0 Upvotes
Jaycee_Lewis
Community Manager
Community Manager

Object types for parent to child companies associations in API v4

Hi, @trayconnector 👋 Can you provide more details on what you are expecting to see? It's not 100% clear on how we would use this endpoint with two Association types and not two Object types. 

 

Hey, @CMcKay @tominal, is there a better way to think about this? 

 

Thank you! —Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes