Forum Discussion
how to create a query that paginates?
gotmike or ImkeF I am using the HubSpot Contacts API to get all contacts from the CRM. I am running into the same issue with paging through the contact list. I have been reading through the comments and trying different approaches, but unfortunately without any luck. The parameter for &vidOffset can be used in the url to page through contacts, but needs to be sent in the second call and is based on the the vid-offset value in the first call. Any help on this would be greatly appreciated.
- ImkeF8 years ago
Community Champion
I'm too busy currently to look deeper into this, but please check this link: http://blog.datainspirations.com/2018/02/17/dynamic-web-contents-and-power-bi-refresh-errors/
- snamuth8 years agoFrequent Visitor
Thanks ImkeF. I reviewed the link you posted and tried that code as part of my testing, but unfortunatly it doesn't work for my use case. I don't get a number of pages back in the response, instead I get a vid-offset number and a has-more value of true if there are additional contacts to page through. The vid-offset number that I get back on the first call is the max vid (hubspot contact id) in the list. This number needs to then be passed into the parameter &vidOffset in the url to get additional contacts. Each time the vid-offset will come back with another number until the has-more value no longer equals true. I will keep at it and see if I can figure it out. Thanks again.