APIs & Integrations

sbraines
Member | Partner
Member | Partner

Get recently created contacts API issue

SOLVE

I'm having some issues with the "Get recently created contacts" API call. I'm expecting it to return a list of contacts created since a specific time by passing timeOffset=X. However, I'm getting a paginated list of all contacts returned. Am I misreading the documentation?
E.g. If I call curl "api.hubapi.com/contacts/v1/lists/all/contacts/recent?hapikey=demo&count=10&timeOffset=1538557440000"
then the response includes contacts created before the timeOffset I have passed, which is not what I would expect.

Thanks,
Simon

0 Upvotes
1 Accepted solution
Mohmmadsalim_Sh
Solution
Member

Get recently created contacts API issue

SOLVE

Hi Simon

It does not seems to be feasible for now.

Instead you can read recently created contacts in descending order.
First call without timeOffset - api.hubapi.com/contacts/v1/lists/all/contacts/recent?hapikey=demo&count=10

and call API with pagination and check until timeOffset of last contact in API response is greater than the date from which you need contacts.

Hope this helps.

Salim

View solution in original post

0 Upvotes
2 Replies 2
Mohmmadsalim_Sh
Solution
Member

Get recently created contacts API issue

SOLVE

Hi Simon

It does not seems to be feasible for now.

Instead you can read recently created contacts in descending order.
First call without timeOffset - api.hubapi.com/contacts/v1/lists/all/contacts/recent?hapikey=demo&count=10

and call API with pagination and check until timeOffset of last contact in API response is greater than the date from which you need contacts.

Hope this helps.

Salim

0 Upvotes
sbraines
Member | Partner
Member | Partner

Get recently created contacts API issue

SOLVE

Thanks for the response Salim.

0 Upvotes