GOGETMUSCLE Community Confusing issue with a search request for contacts

Confusing issue with a search request for contacts

Our cursor poller for contacts recently started failing, and the resulting message only tells us there was some issue, but doesn´t specify why.

Here is the code that breaks:

client = hubspot.Client.create(access_token=HUBSPOT_API_KEY)

with open (‘columns’, ‘rb’) as fp:
columns = pickle.load(fp)

if ascending:
public_object_search_request = PublicObjectSearchRequest(
filter_groups=[
{
“filters”: [
{
“propertyName”: “lastmodifieddate”,
“operator”: “GT”,
“value”: cursor.datetime,
}
]
}
],
sorts=[{“propertyName”: “lastmodifieddate”, “direction”: “ASCENDING”}],
properties=columns,
limit=200 )
else:
public_object_search_request = PublicObjectSearchRequest(
filter_groups=[
{
“filters”: [
{
“propertyName”: “lastmodifieddate”,
“operator”: “LT”,
“value”: cursor.datetime,
}
]
}
],
sorts=[{“propertyName”: “lastmodifieddate”, “direction”: “DESCENDING”}],
properties=columns,
limit=200)

api_response = client.crm.contacts.search_api.do_search(public_object_search_request=public_object_search_request)


The search response is a status 400 with the following body

{“status”:”error”,”message”:”There was a problem with the request.”,”correlationId”:”e3997f3e-c69d-436d-b351-25eabd0b9235″}

Leave a Reply

Your email address will not be published.

Related Post