cancel
Showing results for 
Search instead for 
Did you mean: 

HTTP snap pagination Not Working

mohit_jain
New Contributor III

Hi Everyone,

I hope you're doing well. I need some assistance with implementing pagination in SnapLogic for the Google Search Console API. Currently, there's a row limit of 25,000, making it challenging to load the data on a daily basis. If the data exceeds this limit, we risk losing valuable information.

To avoid this, I’m looking for a way to implement a loop within the API calls to handle pagination efficiently. Given the urgency of this task, any guidance or suggestions on how to achieve this would be greatly appreciated.

Here is the snap config

mohit_jain_0-1725451942766.png

now we need to update the startRow to +25000 in every execution and it should be end once it is completed

api result :


mohit_jain_1-1725452176925.png

 

Can anyone help me in this
 

1 ACCEPTED SOLUTION

mohit_jain
New Contributor III

Really Thanks to @koryknick and @Palermo 

We have found one solution and it is working fine 
What we have changed is we have passed all the raw entity in the query parameters 

mohit_jain_0-1725604975156.png

And set the pagination parameters like this and it works 

mohit_jain_1-1725605026364.png

 

But thanks everyone for looking and supporting us on this

View solution in original post

10 REPLIES 10

Palermo
New Contributor II

or

$entity.get("rows",[]).length == 25000

But the pagination will not work because this is a POST request with data:

image.png

According to the documentation, the HTTP Client Snap does not automatically resend data in subsequent pagination requests. But the Google Search Console API requires that for each page. So, the second request returns nothing.

The first request:

image.png

The second request:

image.png

@koryknick Is there a way to pass HTTP entity(data) for subsequent pagination requests?

mohit_jain
New Contributor III

Really Thanks to @koryknick and @Palermo 

We have found one solution and it is working fine 
What we have changed is we have passed all the raw entity in the query parameters 

mohit_jain_0-1725604975156.png

And set the pagination parameters like this and it works 

mohit_jain_1-1725605026364.png

 

But thanks everyone for looking and supporting us on this

koryknick
Employee
Employee

@mohit_jain - I missed the request body / POST action.  Typically pagination is performed using GET so that is the methodology I provided.  In case you encounter this again and cannot provide the body in the query parameters, we do have a recommended pattern for paginating POST requests with body content

I'm happy you found a solution and thank you for posting it back to the page.  This is helpful for others with similar questions!

Palermo
New Contributor II

@koryknick the pattern doesn't work for the Google Search Console API because it doesn't return 'total' or similar values to determine how many pages are available. Is it possible to request adding an option(checkbox) to HTTP client to allow resending a request body using pagination for POST?

@Palermo - sorry for the slow response on this question - I have been out of office.  There is a request already created to pass the POST body content to subsequent calls, which is currently under review to be added to the roadmap.