HPE Morpheus Enterprise
1834628 Members
3045 Online
110069 Solutions
New Discussion

API Pagination Question

 
cbunge
HPE Pro

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.

17 REPLIES 17
Not applicable

Re: API Pagination Question

-1 will be getting removed

Not applicable

Re: API Pagination Question

make that a big bold red warning in the docs please

Not applicable

Re: API Pagination Question

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

Not applicable

Re: API Pagination Question

looks great on mobile?

Not applicable

Re: API Pagination Question

I dunno…but the pattern is sound

Not applicable

Re: API Pagination Question

didn’t think about an increase during runtime

Not applicable

Re: API Pagination Question

was going to post it

Not applicable

Re: API Pagination Question

Oh…yeah, good catch

Not applicable

Re: API Pagination Question

We should start doing that in 5.5 actually

Not applicable

Re: API Pagination Question

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

Not applicable

Re: API Pagination Question

probably should be >= intstead of == 
Not applicable

Re: API Pagination Question

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

Not applicable

Re: API Pagination Question

Not applicable

Re: API Pagination Question

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

Re: API Pagination Question

I have a powershell script that pages

cbunge
HPE Pro

Re: API Pagination Question

@ncelebic gotta increase that column width b284698a003982884f961036c7d65ac8b28a6b22.png

Not applicable

Re: API Pagination Question

correct, no nextlinks with morpheus