I am on the https://developers.hubspot.com/docs/api/crm/deals page and I am runing test POSTs of the /crm/v3/objects/deals/search API endpoint, using the Python library.
I post:
url = “https://api.hubapi.com/crm/v3/objects/deals/search”
querystring = {“hapikey”:“API_KEY_REDACTED”}
payload = “{\“filterGroups\”:[{\“filters\”:[{\“value\”:\“closedwon\”,\“propertyName\”:\“dealstage\”,\“operator\”:\“EQ\”}]}],\“sorts\”:[\“ASCENDING\”],\“query\”:\“string\”,\“properties\”:[\“hs_object_id\”],\“limit\”:100,\“after\”:0}”
headers = {
‘accept’: “application/json”,
‘content-type’: “application/json”
}
response = requests.request(“POST”, url, data=payload, headers=headers, params=querystring)
print(response.text)
The response that I get is:
HTTP 200
{
“total”: 0,
“results”: []
}
This is confusing, because there are 25 deals that are currently in closedwon.
I have noticed 2 things:
1) The response does not change if I pass any actual dealstage value, or a random string like “HELLO_WORLD”.
2) The same thing happens for the sorts body parameter. I don’t actually know what list of strings to pass here to achieve any kind of result. But as long as its a string, the post goes through.
What am I missing here? Ideally I would like to filter by dealstage value, and between two dates, and return all deal ids for deals in that search. However, since I can’t even get the dealstage to work, I am unable to progress.
