Export data automatically under then constrain on offset


#1

When I was trying to GET /contacts/v1/lists/all/contacts/all, there is offset issue, which prevented me from getting data automatically since I need to know VID first before getting next page data, any advice to make it more automated? Thank you


Error about Get Email Event By ID API
#3

Hi, @Xi_Wang,

Could you please describe your goal and issue in more detail?

The Get all contacts endpoint returns a JSON-formatted list of up to 100 contacts. The last two fields in the response are has-more and vid-offset.

If has-more is true, then vid-offset will contain the vid of the last contact returned. You then use this vid-offset value in your next request.

For example, if you query https://api.hubapi.com/contacts/v1/lists/all/contacts/all?count=100&hapikey=your_key, you will receive up to 100 contacts.

If there are more contacts in your account, "has-more": true will appear at the end of the payload followed by "vid-offset": 1234.

You can then use a loop to query the endpoint again, this time with the vid-offset in the request URL:

https://api.hubapi.com/contacts/v1/lists/all/contacts/all?count=100&hapikey=your_key&&vidOffset=1234. This will return the next 100 contacts.