I am trying to use the python API to update a set of HS contacts. I am able to do this contact by contact (with a for loop), but I would like to do this in batch mode.
Reading the documentation, I see that the input properties have to be in this format:
inputs=[{“id”:“1”,“properties”:{“company”:“Biglytics”,“email”:“bcooper@biglytics.net”,“firstname”:“Bryan”,“lastname”:“Cooper”,“phone”:“(877) 929-0687”,“website”:“biglytics.net”}}]
and I am wondering if there is a simple way to convert a python dictionary or list to this format? I’ve done something similar with the SimplePublicObjectInput, with something like:
SimplePublicObjectInput(properties=properties_ccontacts[0])
and this creates the formatting needed for the “simple” (not batch) API to work. But I haven’t found in the documentation something similar for the batch api.
Many thanks,
Iván.
not quite sure if I follow you, but there is a class called BatchInputSimplePublicObjectBatchInput that you could use in this scenario, where you can pull in a list of dictionaries into the input. It looks something like this:
Sorry about the formatting, but the system won’t let me post with code blocks and proper highlighting.
Maybe you knew this already, so please give some more detail regarding your original question.
But if you found this post helpful, consider helping others in the community to find answers faster by marking this as a solution. I’d really appreciate it.