I want to update the batch of custom objects and create some new objects if they didn’t exists. The problem is that I don’t know which ones are already exists in HubSpot.
When I try to POST to /crm/v3/objects/{obj}/batch/update full batch fails on non-existing objects. When I POST to /crm/v3/objects/{obj}/batch/create it fails on already existing objects, because of unique ID.
I can do it one-by-one, but this will require 2 API requests for a single object (ask if it is exists and next create new or update existing one). In fact sometimes I need to update 1k objects, so 2k api requests ruins my server and meet the HubSpot limits.
Self-answer: I need to batch-read objects first by POST/crm/v3/objects/{objectType}/batch/read to determinate which objects olready exists and next update existing and create non-existing ones. Total 2 api calls per 100 objects - looks good. Thanks me for an answer.
Hi, I wonder if objectType in API endpoint is equal to object internal name. I tried to use this /crm/v3/objects/{objectType}/batch/read but it always returned
{
“status”: “error”,
“message”: “Unable to infer object type from: XXX”,