Pagination issue on get recently updated contacts API endpoint

Pagination issue on get recently updated contacts API endpoint

I am using the get recently updated contacts endpoint in order to poll for all changes to contacts. However, I have run into an issue with pagination. I have contacts per page set to 20, and I grab the vid-offest and time-offset values in order to get to each page of results. However, if I do a batch import, some of the contacts end up getting the same modified timestamp, if the last contact on a page has the same timestamp as the next contact in the list then that contact is dropped from the next page, and I never see that it was updated.

I tested this by doing a batch import, paginating through all the entries. I then found one that was missing and changed my page size to ensuring that the contacts that shared the same modified timestamp did not end up at the end/beginning of a page. When I did that they appeared.

If I can provide any other information to help clarify the problem let me know.

Hi @Silas , it is possible to use the endpoint with just the vidOffset parameter. If you leave out the timeOffset parameter, would that work for you?

I don’t think it would. If I was using only the vid-offset and that contact was updated before I retrieved the next page then I would be even worse off.

I see, that makes sense. Could you share with me how you are doing the batch import? Do you mean importing a CSV file in the app or using API to create contacts?

It would be great if you can provide me a few example contacts in your portal that you batch imported and has the same last modified timestamp so that I can do some tests on my end. You can direct message me the links to the contacts if you’d like.

The bulk import was just done via the CSV import. We were using hub id 2660145 for testing. Here are three VIDs that all have a modified timestamp of: 1557763791766

390555
390556
390562

Thanks @Silas , I am able to see the same on my end. Let me reach out to my team on this and I’ll update here once I get more information!

Hi @Silas , thank you for your patience here! My team had managed to find a bug in that endpoint and have rolled out a fix. I have tested it on my end and the issue should no longer be happening. Let me know if it persists for you.

Thankyou, It looks like the problem is fixed.

Hello!

I’m having trouble with the pagination. I’ve been trying to get contacts but no luck getting the second page.

I’ve tried on demo URL and I keep getting same page.

Maybe I’m doing something wrong?

if I’m correct, this should be page one:

https://api.hubapi.com/contacts/v1/lists/recently_updated/contacts/recent?hapikey=demo&count=4

Then this should be page 2:

https://api.hubapi.com/contacts/v1/lists/recently_updated/contacts/recent?vid-offset=12677474&time-offset=1620340766712&hapikey=demo&count=4