cancel
Showing results for 
Search instead for 
Did you mean: 

Pagination in REST API

Siva_Venna
Contributor

A very good explanation of how to implement pagination in REST API in this below blog post:

When I try to implement the same(I am extracting data from survey monkey api), I have noticed that when the ā€œNext URLā€ is executing it is ignoring the query parameters provided.As shown in below image, when service URL is executing it’s getting right records considering all input query parameters i.e total:3043 but when ā€œNext URLā€ is hitting it is extracting all records i.e. total : 61896
capture2

How to include query parameters in ā€œNext URLā€ to get required data?

9 REPLIES 9

ptaylor
Employee
Employee

Please share your configuration of the Snap’s settings.

below is configuration of Snap’s settings.
service URL: https://api.surveymonkey.net/v3/collectors/xxxxx/responses/bulk

pagination

In the ā€œNext URLā€ i have replaced ā€œoffsetā€ with ā€œpageā€ api is throwing error as bad request, may be api don’t accept parameter as offset.error below
pagination

ptaylor
Employee
Employee

I can’t see the entire expression for Next URL in your screen capture, but it seems more complicated than it needs to be. Try this: ā€œhttps://api.surveymonkey.net/v3/collectors/xxxxx/responses/bulk?per_page=ā€ + ($entity.per_page) + ā€œ&page=ā€ + ($entity.page + 1)

Actually, after looking at the Survey Monkey API docs, I think it’s even easier. Try this:

Has next: ā€˜next’ in $entity.links
Next URL: $entity.links.next