I’m having trouble with the HubSpot Batch API for updating contact properties. I’m using a batch size of 50 contacts but I’m seeing weird results. Some properties update fine but others don’t change at all.
I know HubSpot doesn’t update the “update date” if the new value is the same as the old one. But in my case the new values are different so they should all update. Here’s a simplified version of my code:
function updateContactBatch($batchData) {
$updates = [];
foreach ($batchData as $data) {
$contact = findContact($data['email']);
if (!$contact) continue;
$props = [
'prop_1' => $data['val_1'],
'prop_2' => $data['val_2'],
'prop_3' => $data['val_3'],
'prop_4' => $data['val_4'],
'prop_5' => $data['val_5'],
];
$updates[] = new ContactUpdate([
'id' => $contact->id,
'properties' => $props
]);
pause(1);
}
if ($updates) {
$batchUpdate = new BatchUpdate(['updates' => $updates]);
pause(40);
sendBatchUpdate($batchUpdate);
}
}
Any ideas why some properties aren’t updating? I’m stumped and could really use some help. Thanks!