APIs & Integrations

psoldi
Member

Labels API endpoint returning wrong ID

I've been testing the endpoint to get all the labels in an association between a Contact and a Company.

For some how all the IDs are incremented by +1.

 

To reach this conclusion, I assigned manually all the labels to a contact and I got all the assigned labels through the API:

=>{"category"=>"USER_DE...", "typeId"=>13, "label"=>"Primary App User"},{"category"=>"USER_DEFINED", "typeId"=>15, "label"=>"Primary Billing Contact"}.....

 

then when I found all the labels using the api endpoint in "

https://api.hubapi.com/crm/v4/associations/
/Company/Contact/labels", this is what I get:
 
=>{"category"=>"USER_DEFINED", "typeId"=>14, "label"=>"Primary App User"}
{"category"=>"USER_DEFINED", "typeId"=>16, "label"=>"Primary Billing Contact"}...
 
0 Upvotes
2 Replies 2
Jaycee_Lewis
Community Manager
Community Manager

Labels API endpoint returning wrong ID

Hey, @psoldi 👋 Can you post the full request and response for both setting (creating?) the associations and then for the second example where they came back as +1, please? It will be helpful in trying to recreate your steps and give the community a bit more information to work with.

 

Thank you! — Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
FCLAUSSET
Member

Labels API endpoint returning wrong ID

Hello,

I have kind of the same problem, it is not the same id depending of the request.
When I ask for contacts of a company :
/crm/v4/objects/company/xxxxxxxxxxxx/associations/contact

 

{
            "toObjectId": yyyyyyyy,
            "associationTypes": [
                {
                    "category": "USER_DEFINED",
                    "typeId": 4,
                    "label": "My Label"
                },
                {
                    "category": "HUBSPOT_DEFINED",
                    "typeId": 280,
                    "label": null
                }
            ]
}

 

 

But when i ask the other way around, I do not get the same Ids.

/crm/v4/objects/contact/yyyyyyy/associations/company

 

 

{
            "toObjectId": xxxxxxxx,
            "associationTypes": [
                {
                    "category": "HUBSPOT_DEFINED",
                    "typeId": 279,
                    "label": null
                },
                {
                    "category": "USER_DEFINED",
                    "typeId": 3,
                    "label": "My Label"
                }
            ]
        }

 

 

4 and 280 are the rights Ids.

Thank you

0 Upvotes