WebService Connector: Paginating Google API

Hey im triying to page google APIs and it has the same logic as yours, but by some reason it gets stuck looping in the first request. Any ideas? This is the paging im using:

TERMINATE_IF $response.nextPageToken$ == NULL
$endpoint.fullUrl$ = $application.baseUrl$ +“/admin/directory/v1/users?domain=beta.lan.com&maxResults=10&pageToken=”+ $response.nextPageToken$

1 Like

Not sure if this helps, but here is an example offset based pagination.

There’s also this doc: Paging Based on Response Markers

What im trying to accomplish is done with nextPageTokens, thus it provides me a token inside the request body, which i need to send as a query parameter in the next aggregation page…

Colins previous suggestion of using a before operation rule would apply here as well. Documentation Link

TERMINATE_IF $response.nextPageToken$ == NULL
$next$ = $response.nextPageToken$
$endpoint.fullUrl$ = $application.baseUrl$ + "/users?maxResults=10&pageToken=" + $next$

works for me. Technically it’s doing the same exact thing but I’m declaring the nextPageToken as a separate variable

Before operation rule shouldn’t be necessary unless Google is also including special characters that cause java errors in the their page token which I haven’t experienced yet

edit: I’m not a 100% sure if nextpagetoken is always included, does your context url also include maxResults=10?