Hi,
I have an implementation for upserting a larger number of contacts by calling:
crm.contacts.batchApi.upsert
through the Node.js HubSpot SDK.
The implementation used the documentation, as of: https://developers.hubspot.com/docs/api-reference/crm-postal-mail-v3/batch/post-crm-v3-objects-postal_mail-batch-upsert#batch-upsert
Where it stated, the API endpoint was supposed to return a proper payload. But in reality, near the 200 OK, the payload is sometimes literally empty, sometimes an empty JSON object.
There is a lack of features to bulk/batch check or just ask for the last process status.
Is there any information about this error on the HS side when they willing to fix it?
Note
The SDK is the latest. I have tried the simple HTTP requests using the v3 API. The problem can be reproduced via `cURL` or `Postman` too.
Also, I have a retry mechanism, with a wait time of over 60 seconds to mitigate the caching, but it is not helping. Even after the 5th attempt, over 60 seconds between each attempt (which is ridiculous).
Note:
There is another SDK call/endpoint, with the same random behavior, the `
client.crm.lists.membershipsApi.add
Sometimes, it does result in an empty JSON object or an empty/no payload as well.
Thank you. The first one seems interesting and somewhat related to my problem. It’s really interesting that I sometimes get a response from the endpoints and sometimes not. The data is the same; it exists, and there are no issues. But encountered it with multiple endpoints. What is more strange is that, subsequent read/search attempts also give me empty results after the original calls (retry mechanism is on, 60 seconds between them)
Hi @GBakonyi0 
I’ve not been able to replicate this behaviour using HubSpot’s API (via HTTP requests). Please share some example code -- this should enable the community to attempt to reproduce the issue you’re experiencing and offer subsequent support.
I will try to extract the given code.
We are using it mostly via the SDK, but in my case, while I tested via cURL (and via Postman collection), I faced the issue yet again. The weirdness in the entire situation is that it seems somewhat random. Many tests were successful and 100% correct, but in many cases, the API just did not send back anything, or just an empty JSON object.
Hey @GBakonyi0!
I just wanted to reach out and see if we can get any more insight on @zach_threadint’s follow up request!
Shane, Senior Community Moderator
Hi @GBakonyi0 
The documentation you’ve linked to seems to relate to creating or updating HubSpot Postal Mail records, not HubSpot Contacts. Regardless, would you please share some example code demonstrating the API call you’re making and the response? This should help the community offer guidance here.
You are right, I linked the wrong documentation: it should be this one instead
Hi @GBakonyi0
When I see the link that you have shared, it redirects to engagement batch upsert, which is not the same as your requirements.
here is the link to contacts batch upsert - Accounts Dashboard | HubSpot
Here is the curl as well - curl --request POST \
--url https://api.hubapi.com/crm/v3/objects/contacts/batch/upsert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
""inputs"": [
{
""id"": ""<string>"",
""properties"": {},
""idProperty"": ""<string>"",
""objectWriteTraceId"": ""<string>""
}
]
}
'
I hope this will help you out. Please mark it as Solution Accepted and upvote to help another Community member.
Thanks!