API Pagination Question

Pagination with our API. Is the expectation to parse the meta return for total vs current and determine the remaining page loop? Most have a header or a data value for nextlink. I guess I’ve always been lazy on ours with a -1 or something. Trying to figure out the cleanest way to paginate.

correct, no nextlinks with morpheus

@ncelebic gotta increase that column width 🙂

looks great on mobile?

probably should be >= intstead of == 

I dunno…but the pattern is sound

if nextResult['meta']['offset'] + nextResult['meta']['size'] >= result['meta']['total']

if you passed an offset greater than the total, it would loop forever

ie. a bunch of records got deleted right before you send your last request

Oh…yeah, good catch

didn’t think about an increase during runtime

I have a powershell script that pages

was going to post it

-1 will be getting removed

We should start doing that in 5.5 actually

make that a big bold red warning in the docs please

it’s definitely going to break stuff, but I know it’s the proper way to do it