APIs & Integrations

DGROUSSEAUD
Member

Associations between custom objects

SOLVE

Hello,

I want create an association between 2 same type of custom object(Bases) by API.

I tried this request:

- POST

- https://api.hubapi.com/crm/v3/associations/2-/2-XXXXXXX/batch/create

-

 

 

{
  "inputs": [
    {
      "from": {
        "id": "ID_CUSTOM_OBJECT_A"
      },
      "to": {
        "id": "ID_CUSTOM_OBJECT_B"
      },
      "type": "2-XXXXXXXX_to_2-XXXXXXXX"
    }
  ]
}

 

 

My problem is about fill the type field, in api doc, the given example is 

 

 

 "type": "contact_to_company"

 

 

I made some tries: 'base_to_base', 'bases_to_bases', both with uppercase, '2-XXXXXXXX_to_2-XXXXXXXX', ...

The error message is: 

"subCategory": "crm.associations.INVALID_ASSOCIATION_TYPE",

"message": " 'BAD TYPE' is not a valid association type between XXXXXXXXX and XXXXXXXXX"

 

I cannot find in the interface the expected type. I want some help about this thank you 🙂

0 Upvotes
1 Accepted solution
DGROUSSEAUD
Solution
Member

Associations between custom objects

SOLVE

Ultimately, I found the solution. It was necessary to create association with a label 'LABEL XXX' and put this label in the type field.

View solution in original post

0 Upvotes
1 Reply 1
DGROUSSEAUD
Solution
Member

Associations between custom objects

SOLVE

Ultimately, I found the solution. It was necessary to create association with a label 'LABEL XXX' and put this label in the type field.

0 Upvotes