cancel
Showing results for 
Search instead for 
Did you mean: 

Smartsheet rest api pagination

sravan
New Contributor II

Hi ,

We are integrating smartsheet rest api’s in snaplogic. We get only totalrecordscount in the response. there is no other things comes up in response. I need to apply pagination . In paramters i can use page and pageSize .
Page is something which page we want to access and pageSize is 100 by default. These 2 paramters are not part of the response.

I am not sure how I can create hasNext and nextUrl to paginate and fetch all 77k records.

I am attaching the screenshots of rest snap settings .I am unable to loop. it is like never ending. please suggest.

https://smartsheet.redoc.ly/tag/reports#operation/getReport

offset is a parameter i gave as 0 for incrementing in nexUrl page

pipeline1
pipelinesettings2
response

2 REPLIES 2

koryknick
Employee
Employee

I think you are very close given your screenshot. But you want to get the next page as long as:
$totalRowCount > ((snap.out.totalCount+1) * 1000)

Then next url is built with
...page=" + (snap.out.totalCount+2) + "...

sravan
New Contributor II

Thank you! Some How it is not fetching the last page data. I had to change Has next url to something like below:

$entity.rows.length==100. so that it loops till the rows are 100. if rows array is not 100, which means there is no further data.

Thanks for the Help!