I am trying to perform a simple batch update using the recommened python package hubspot-api-client.
My expectation is that I could create a list of dictionaries with the id and properties and use them as below:
from hubspot.crm.companies import SimplePublicObjectInput
from hubspot.crm.companies import BatchInputSimplePublicObjectBatchInput
companies_to_update = []
for company in companies:
companies_to_update.append(SimplePublicObjectInput(properties={
“id”: “12345”,
“level”: “good”
}))
objects_input = [CompanyObjectInput(**obj) for obj in companies_to_update]
batch_input = BatchInputSimplePublicObjectBatchInput(inputs=objects_input)
response = api_client.crm.companies.batch_api.update(batch_input)
However, when I try this, the api responds that id is a required field. If I instead move [id] out of properties and into kwargs, then python barks at me that id is not an expected kwarg.
This would seem to me a very common use case which I can’t seem to get to work? Can anyone spot what I’m doing wrong?