Skip to main content

I’m using a REST API’s method that returns results in pages.  I’d like this to be the source of a “Search” action (basic integration; not CLI).

What’s the recommended way to retrieve all pages?

** edit ** 

I read that a polling trigger may work for this.  The API returns data in this format:

{
"hasMoreResults": true,
"continuationToken": "00000002-0000-0000-c800-000000000000",
"additionalResultsUrl": "/v1/legalentities/00000/employeesIdentifyingData?continuationToken=00000002-0000-0000-c800-000000000000",
"records":
{
"firstName": "First",
"lastName": "Last",
"socialSecurityNumber": "00000000",
"employeeId": "00000000-0000-0000-0000-00000000",
"employeeNumber": "012345",
"birthDate": "2000-01-01T00:00:00",
"status": "Active"
},
...
]
}

Can this be used with the bundle.meta.page value?

Hi @benjamink9 

Good question.

To clarify, are you trying to do this in a Zap or part of the Zapier Developer Platform?

 

That will depend on the app API endpoint you are using.

Generally API results are pagination because there could be lots of results.

That means logic has to be applied to loop thru all the available pages to get the results.


I am attempting to do this in an integration, not a Zap.

To page this endpoint, I need to repeatedly supply the continuationToken as a parameter, until the hasMoreResults is false or the continuationToken is null.

Can this be done within a search action without having to convert the integration to a CLI project?

I think I would prefer to use an action rather than a trigger, as the former has the “Pair an existing search and a create to enable "Find or Create" functionality?” option.

Can the code in “Configure your API Request (step 1)” be adapted to page this API in the manner that I describe?