Hi all,
Here is the response error that I am receiving:
{“status”:“error”,“message”:“Invalid input JSON on line 1, column 39: Invalid UTF-8 middle byte 0x6f”,“correlationId”:“e1c67327-1455-47a4-a525-ef136721f550”}
I copied the sample python API code for searching the contact objects. When I tried to run the same code in my Python file, it fails. It seems to work only with non-accented text strings, but strings with characters such as “ñ” and “Ê” cause it to fail. Am I missing something to make it work with accented characters?
Thank for the help!
Wayde
# Sample code from the Hubspot API pages
# Search Contacts
import requests
url = "https://api.hubapi.com/crm/v3/objects/contacts/search"
querystring = {"hapikey":"XXXXXXXXXXXXXXXXXXXXXXXX"}
payload = "{\"filterGroups\":[{\"filters\":[{\"value\":\"Baño\",\"propertyName\":\"firstname\",\"operator\":\"EQ\"}]}],\"sorts\":[\"string\"],\"query\":\"string\",\"properties\":[\"string\"],\"limit\":0,\"after\":0}"
headers = {
'accept': "application/json",
'content-type': "application/json"
}
response = requests.request("POST", url, data=payload, headers=headers, params=querystring)
print(response.text)