Forum Discussion
Anonymous
4 years agoNot applicable
Looping API (total results not available)
Hi, Been asking a similar question before, but for a different API. The current API gives me the ID of the last row much like this example from hubspot API https://api.hubapi.com/crm/v3/o...
Anonymous
4 years agoNot applicable
Thanks mahoneypat , your video was perfect for the previous API I was working with where I got the total number of rows available.
In the current API the pagination part of the call return only gives me the following.
after: the ID of the last result in the current call
link: full link of the next call, skipping all rows in the current call (&after=32401)
Also worth mentioning, the ID is not sequential. The next ID might be 33551, i.e. its not 32402.
Any hints?
Wes
mahoneypat
4 years agoMicrosoft Employee
If you know approximately how many to expect, you could make a list of numbers to use as your "after" values that intentionally goes just past it and then remove any rows where you get error instead of "Table". That would be simpler than a recursive solution.
Pat