"status": "error",
"message": "DEADLINE_EXCEEDED: ClientCall was cancelled at or after deadline. [remote_addr=kind-mask.iad02.hubspot-networks.net/172.16.34.176:2048]",
"correlationId": "dc98404a-b8c3-4f71-af60-9b22e481b63d",
"category": "INTERNAL_ERROR"
Another type of error we got was related to some of the contacts having values not acceptable for HubSpot:
"status": "error",
"message": "Property values were not valid: [{\"isValid\":false,\"message\":\"253402214400000 is more than 1,000 years ago or 1,000 years from now.\",\"error\":\"INVALID_DATE\",\"name\":\"utmeldingsdato\"}]",
"correlationId": "ac4c1a67-a5cc-46fe-8d06-376c67198f33",
"category": "VALIDATION_ERROR"
The response did not specify which of the contacts in the batch had invalid values.
So we assumed the whole batches were rejected and nothing were saved in HubSpot both in the case of "Property values were not valid" errors and in the case of "DEADLINE_EXCEEDED" errors.
But this wasn't the case. When we tried to run the sync again for the failed batches, we started to get the following errors:
And again, HubSpot did not specify, which of the contacts included in the batch already existed.
It turned out that regardless of the error type some of the contacts included in a batch were still created in HubSpot.
Would it be possible to change the way HubSpot responds to a batch request, so the responce contains detailed information about each contact: if the creation was successful, hubspot should include HubSpot ID of the contact and all the rest data, which normally is included in a successful response; and if creation failed, we need all the properties back and the error message.
Apr 19, 20222:52 AM - edited Apr 19, 20222:53 AM
Contributor | Platinum Partner
Issue with batch contact creation API (v3)
Hey HS Support. I have also encounter issue with batch API, a bit different origin though: Custom objects POST /crm/v3/objects/{objectType}/batch/create
But I had no luck to create more than one instance of the custom object via batch API. Is body imput wrongly defined? If so, where is the issue? (JSON was walidated, it is correct) I would appreciate help in this matter. Thanks in advance.
We managed to find a workaround. This might be helpful for someone else...
So before sending over the whole batch again we use another API endpoint to check, whether each individual contact already exists in HubSpot, and exclude those already created from the batch. We use the following API:
GET /crm/v3/objects/contacts/{EmailAddressOfTheContact}?idProperty=email
Of course for this to work you need to have contacts with mandatory email addresses, and email address must be unique for each contact.
Thanks writing up such a thorough post documenting your experience using the CRM Objects API. I want to make sure I'm just as thorough in my response, so I'll need a bit of time to touch base with my team and investigate the behavior(s) you're describing.
In the meantime, if you have any other information you think would be relevant, or any other questions for me, please don't hesitate to follow up on this post.
I am getting the expected 400 error for contact 3 but contacts 1,2,4 are still being added. The docs in v3 do not indicate the expected behavior on an error.
The workaround provided is working but would like some confirmation regarding the behavior. Is this expected or is this a bug?