APIs & Integrations

TimMunro
Contributor | Platinum Partner
Contributor | Platinum Partner

After Merging Contact API Unable to Set Associated Company

After 2 contacts have been merged it is possible that in the HubSpot UI the contact shows that it is associated with a company, however the API may indicate that no company is associated. Here is an example of such a contact:Contact showing copany assoc.png

When retrieving that contact via the HubSpot API (using e.g. get all contacts endpoint /contacts/v1/lists/all/contacts/all) you will notice the "associatedcompanyid" is blank:

 

 

{
  "vid": 1074951,
  "properties": {
    "firstname": {
      "value": "Rodney"
    },
    "associatedcompanyid": {
      "value": ""
    },
  },
  "merged-vids": [
    1074951,
    1367101
  ],
}

 

 

Retrieving this same contact via the API with property history shows the most recent value for associated company was set by RollupPropertes and is "" (no company) - so the UI is incorrectly showing a compnay association:

 

 

{
	"vid": 1074951,
	"properties": {
		"firstname": {
			"value": "Rodney",
			"versions": [
				{
					"value": "Rodney",
					"selected": false,
					"source-id": "appId=184560",
					"timestamp": 1600863589919,
					"source-type": "BATCH_UPDATE",
					"source-label": null
				}
			]
		},
		"associatedcompanyid": {
			"value": "",
			"versions": [
				{
					"value": "",
					"selected": false,
					"source-id": "RollupProperties",
					"timestamp": 1604528951415,
					"source-type": "CALCULATED",
					"source-label": null
				},
				{
					"value": "2896169130",
					"selected": false,
					"source-id": "appId=184560",
					"timestamp": 1600863589919,
					"source-type": "BATCH_UPDATE",
					"source-label": null
				}
			]
		},
	},
	"merged-vids": [
		1074951,
		1367101
	],
}

 

 

If we then attempt to assign a company to this contact (using the batch endpint POST /contacts/v1/contact/batch/). This is a post that we commonly use (with success) to associate companies and contact, example:

 

 

[
	{
		"vid": "259429",
		"properties": [
			{
				"property": "associatedcompanyid",
				"value": "2595166485"
			}
		]
	}
]

 

In this situation the API call does not set the company association - so the get response continues to appear thus:

{
  "vid": 1074951,
  "properties": {
    "firstname": {
      "value": "Rodney"
    },
    "associatedcompanyid": {
      "value": ""
    },
  },
  "merged-vids": [
    1074951,
    1367101
  ],
}

 

I suspect this is a bug that was recently introduced as had not seen it until ~ 1 month ago. It causes problems as, from the perspective of the integration, the set-company-association appeart to have failed, and so it continues to retry ... and continues to fail.

 

0 Upvotes
3 Replies 3
dennisedson
HubSpot Product Team
HubSpot Product Team

After Merging Contact API Unable to Set Associated Company

Hey @TimMunro ,

Thank you for the detailed post.  I will replicate this on my end to confirm and will report to the team afterwards. 

 

0 Upvotes
TimMunro
Contributor | Platinum Partner
Contributor | Platinum Partner

After Merging Contact API Unable to Set Associated Company

Any updates @dennisedson? This issue is ongoing & painful to work around (latest example: portal 6919540, contact id:  7327, I have just manually resolved)

0 Upvotes
TimMunro
Contributor | Platinum Partner
Contributor | Platinum Partner

After Merging Contact API Unable to Set Associated Company

@dennisedson - FY ref, another portal 6190695 & contact 218301 that had this issue (I have manually resolved)

0 Upvotes