Create Note using the API

Hi, I am trying to create a note using the v3 API in Python.

 from hubspot.crm.objects import SimplePublicObjectInput

 simple_public_object_input = SimplePublicObjectInput(
 properties={
 "engagement": {
 "active": True,
 "ownerId": owner_id,
 "type": "NOTE",
 },
 "associations": {
 "contactIds": [],
 "companyIds": [company_id],
 "dealIds": [],
 "ownerIds": [],
 "ticketIds": [],
 },
 "attachments": [],
 "metadata": {"body": body},
 }
 )
 obj = self.api_client.crm.objects.basic_api.create(
 object_type="NOTE",
 simple_public_object_input=simple_public_object_input,
 )

I get the following error:

HTTP response body: {"status":"error","message":"Invalid input JSON on line 1, column 31: Cannot deserialize instance of java.lang.String out of START_OBJECT token","correlationId"...

Thanks!

Hi @DanTheHookMan

There are no v3 endpoints for engagements, yet.

Have you looked at the v1? There is a tab with a python example there

Thanks! I’ve looked at the v1 endpoint but was just trying to see if there was a way to do it with the v3 one. Do you know when the v3 api will support this feature?

I do not have a definitive date. It is being worked on, though. The v1 will be safe to use for the foreseeable future