recently updated contacts

Hi
I am trying to get contacts that were created or updated in last 24 hours.
when i hit the API :

/contacts/v1/lists/recently_updated/contacts/recent?hapikey={My_Key_Secret}

It returned last 30 days of updated/created contact. Could any one help in this ?

Hi @KGaur,

I don’t know about that endpoint but it’s v1 and it looks like there are better options available to you now.

Have you tried using the search the CRM endpoint ?

There’s even an example on that page really close to what you’re trying to achieve, getting all contacts updated between two timestamps :

curl https://api.hubapi.com/crm/v3/objects/contacts/search \
 --request POST \
 --header "Content-Type: application/json" \
 --data '{
 "filterGroups":[{
 "filters":[
 {
 "propertyName":"hs_lastmodifieddate",
 "operator":"BETWEEN",
 "highValue": "1642672800000",
 "value":"1579514400000"
 }
]
}
]'
}

Make a call to that endpoint and as a filter:

- use the same field : “hs_lastmodifieddate”

- use the same operator “between”

- change the values to the current timestamp and another one where you’ll substract 24 hours.

I reckon this will be even more helpful since you’ll be able to sort the results by any property you like, making it easier to manage.

Hope this helps !
If it does, please consider marking this answer as a solution :slightly_smiling_face:

Best,

Ludwig

Thanks @LMeert , That went really well. But i could not get all the data i needed. Got only 10 as i applied
“limit”:100 , could you please help in how to go to next page ?
Thanks a ton

Hi @KGaur,

No worries, glad I could help !
To get to the next page you simply run the same call but you add another parameter to the body :

“after”: [value].
The value is equal to the paging.next.after value you receive in the previous call.

See example above, I’ve already run the call to get the second page, and the result is the bottom arrow => “paging.next.after” : “200”, and to get the third page I wrote the same call but added an “after”:200 to get to the next page.

Hope this helps !
If it does, please consider marking this answer as a solution :slightly_smiling_face:

Best,

Ludwig

Bingoo! Thanks @LMeert

Hi @LMeert ,

how to check the request we are making for getting modified contact having more records or not in version 3.

Likewise in version 2 we have “Hasmore” attribute is there any attribute in version or any logic for the checking the there is no more records