cancel
Showing results for 
Search instead for 
Did you mean: 

Rest GET Pagination Issue

rahulkalyanwat
New Contributor

I am trying to read documents for REST GET snap and for specific ID i am having 918 records and I am only able to access starting 100 record and am not able to traverse next records. 

Sample response:

rahulkalyanwat_0-1693818719823.png

 

HAS NEXT and NEXT URL :

$entity.pageInfo.totalCount > 100*snap.out.totalCount

_BaseUrl+'/submgmt/api/v1/subscriptions/'+$ID+'/users?skip='+(100*snap.out.totalCount)+'&take=100'

rahulkalyanwat_1-1693818761217.png

 

7 REPLIES 7

RogerSramkoski
Employee
Employee

Hello @rahulkalyanwat! Assuming that 'skip' is the correct query parameter and the rest of the URL is accurate, you could replace the expression at the end: 

(snap.out.totalCount + 1).toString()

with this:

($entity.startCount + $entity.limit)

 One thing I can't see in the previous screenshots though is your initial 'startCount' value. From the response in the original post it looks like 101 already. You may need to double-check that since every API can be different, though typically they would start at record 0 or 1, meaning the first page would be 0-99 or 1-100, next page would be 100-199 or 101-200

@RogerSramkoski I tried with HAS NEXT and NEXT URL but it's not working for me and attached the complete REST GET SNAP screenshot below and API first page skip = 0 and startcount=1 each page has 1 to 100 records.

Servirce URL : 'https://api.sendpro360.pitneybowes.com/submgmt/api/v1/subscriptions/7057/users'

rahulkalyanwat_0-1693941381725.png

 

@RogerSramkoski  I tried below HAS NEXT and NEXT URL

$entity.pageInfo.startCount+99 < $entity.pageInfo.totalCount

'https://api.sendpro360.pitneybowes.com/submgmt/api/v1/subscriptions/7057/users?skip='+ (snap.out.totalCount +1).toString()+'&limit=100'

and It's working for me partially. when I am validating the pipeline I see a total count of 921 and a limit of 100. first-page startcount= 1 and the limit 100 for the next page start count should be 101 but it starts from 201 and attached a screenshot for the same.

rahulkalyanwat_0-1693985665461.png