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