Hello I have the following code in python:
import urllib3
import json
http = urllib3.PoolManager()
endpoint = 'https://api.hubapi.com/crm/v3/objects/contacts'
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer Token"
}
type='POST'
data = [
{
"name": "name",
"value": "Test"
},
{
"name": "description",
"value": "test"
},
{
"name": "price",
"value": "15"
},
{
"name": "recurringbillingfrequency",
"value": "quarterly"
}
]
def lambda_handler(event, context):
print(data)
if type == 'GET':
r = http.request(type, endpoint, headers=headers).data
else:
r = http.request(type, endpoint, headers=headers, body=json.dumps(data)).data
print(r)
return r
I am getting the following error:
invalid input JSON on line 1, column 1: Cannot deserialize value of type `com.hubspot.inbounddb.publicobject.core.v2.SimplePublicObjectInputForCreate$Json` from Array value (token `JsonToken.START_ARRAY`)
I searched the internet but have not found a solution yet.
Be very grateful if someone can help.