Recently Created API call isn't paging results


#1

I'm trying to pull down recently create contacts (/contacts/v1/lists/all/contacts/recent), and I am paging through the results with the vid-offset field.

Here's the query.

https://api.hubapi.com/contacts/v1/lists/all/contacts/recent?hapikey=xxx&count=100&property=vid&property=email&property=firstname&property=lastname&property=address&property=city&property=state&property=zip&property=phone&property=hs_lead_status&property=hs_lifecyclestage_customer_date&property=lifecyclestage&property=referral_code

So that returns a vid-offset of 41151101, so I append my query to get the next "page":

https://api.hubapi.com/contacts/v1/lists/all/contacts/recent?hapikey=xxx&count=100&property=vid&property=email&property=firstname&property=lastname&property=address&property=city&property=state&property=zip&property=phone&property=hs_lead_status&property=hs_lifecyclestage_customer_date&property=lifecyclestage&property=referral_code
&vidOffset=41151101

But Hubspot returns the exact same results?


#2

Here's the query.

https://api.hubapi.com/contacts/v1/lists/all/contacts/recent?hapikey=xxx&count=100&property=vid&property=email&property=firstname&property=lastname&property=address&property=city&property=state&property=zip&property=phone&property=hs_lead_status&property=hs_lifecyclestage_customer_date&property=lifecyclestage&property=referral_code

So that returns a vid-offset of 41151101, so I append my query to get the next "page":

https://api.hubapi.com/contacts/v1/lists/all/contacts/recent?hapikey=xxx&count=100&property=vid&property=email&property=firstname&property=lastname&property=address&property=city&property=state&property=zip&property=phone&property=hs_lead_status&property=hs_lifecyclestage_customer_date&property=lifecyclestage&property=referral_code
&vidOffset=41151101

But Hubspot returns the exact same results?


#3

Updated my question.


#5

Hi @obsidianreq,

Apologies for the delayed response. Connor and I try our best to respond to topics in the order they are posted. Edits and subsequent posts, however, reset the [Last] Activity timer, making older topics appear much newer.

That said, what is your Hub ID? I would like to try and replicate this behavior myself.


#7

No problem. Our Hub ID is 3306228


#8

Hi @obsidianreq,

Sorry for overlooking this earlier — you must use both vidOffset and timeOffset to properly page through recent contacts. This is stated as a requirement in the documentation, but I can see how it could be misinterpreted.

If you include both offset parameters, you will get the next 100 contacts:

https://api.hubapi.com/contacts/v1/lists/all/contacts/recent?count=100&property=vid&property=email&property=firstname&property=lastname&property=address&property=city&property=state&property=zip&property=phone&property=hs_lead_status&property=hs_lifecyclestage_customer_date&property=lifecyclestage&property=referral_code&vidOffset=41172702&timeOffset=1541530437001


#9

Thanks, that did the trick!