Error Searching Contact

Hi,

I am trying to find all contacts modified after a certain time.

I use the command below using the website

curl --request POST \
--url ‘https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=xxxxxxxxx’ \
--header ‘content-type: application/json’ \
--data ‘{
“filterGroups”: [
{
“filters”: [
{
“value”: “2020-08-04T09:10:06.850Z”,
“propertyName”: “lastmodifieddate”,
“operator”: “GTE”
}
]
}
],
“sorts”: [
“lastmodifieddate”
],
“query”: “string”,
“properties”: [
“id”
],
“limit”: 0,
“after”: 0
}’

but I get the error below

HTTP 400

{
“status”: “error”,
“message”: “There was a problem with the request.”,
“correlationId”: “9fe4f275-f2c5-44c3-9154-4806951255c2”
}

Regards

Ad

Hi @AdKerremans ,

The problem is the value for the lastmodifieddate, it should be a UNIX timestamp, so try converting it. I tried a test call with your code, and it is working fine with a UNIX timestamp:

curl --request POST \
 --url 'https://api.hubapi.com/crm/v3/objects/contacts/search?hapikey=' \
 --header 'content-type: application/json' \
 --data '{
 "filterGroups": [
 {
 "filters": [
 {
 "value": "1586329806",
 "propertyName": "lastmodifieddate",
 "operator": "GTE"
 }
 ]
 }
 ],
 "sorts": [
 "lastmodifieddate"
 ],
 "properties": [
 "email",
 "lastmodifieddate"
 ],
 "limit": 10,
 "after": 0
}'