APIs & Integrations

AB35
Member

Associations v4 schema endpoints confusion | How to retrieve name?

Sending a POST request to/crm/v4/associations/{fromObjectType}/{toObjectType}/labels with "label" and "name" in the POST data creates a label to use for associations. What is "name" in this scenario, and how does it differ from "label"?

 

Sending a GET request to https://api.hubapi.com/crm/v4/objects/contacts?associations=companies returns associations between contacts and companies. The associations/results array includes "id" and "type". Id is the association ID and type seems to be either a standard HubSpot association type or the label "name". Is this correct?
---
      "associations": {
        "companies": {
          "results": [
            {
              "id": "6277896643",
              "type": "contact_to_company"
            },
            {
              "id": "6266951100",
              "type": "contact_to_company_unlabeled"
            },
            {
              "id": "6277896643",
              "type": "contact_to_company_unlabeled"
            }
          ]
----
Lastly, why does sending a GET request to
/crm/v4/associations/{fromObjectType}/{toObjectType}/labels
not return the created label name?
----
"results": [
  {
    "category": "HUBSPOT_DEFINED",
    "typeId": 0,
    "label": "string"
  }
]
-----
Is the label "name" only used when creating a label and when sending a request to https://api.hubapi.com/crm/v4/objects/{fromObjectType}?associations={objectTypes}

Are clients supposed to give labels a "meaningful name"? Most importantly what is the difference between it and "label"?
0 Upvotes
2 Replies 2
Jaycee_Lewis
Community Manager
Community Manager

Associations v4 schema endpoints confusion | How to retrieve name?

Hi, @AB35 👋 Are you still having challenges here? If so, I am happy to help with any remaining questions.

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
AB35
Member

Associations v4 schema endpoints confusion | How to retrieve name?

Hello,
Apologies since I can see no other replies, I would like help with any of the questions I made above.
Kind regards

0 Upvotes