GitHub
CRM
Pagination
organizationID = organization.get("organization_id");
uniqueInvoiceIDs = List();
pageNumbers = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
 
for each pageNumber in pageNumbers {
    invoicesResponse = invokeurl [
        url: "https://books.zoho.com/api/v3/invoices",
        type: GET,
        parameters: {
            "page": pageNumber,
            "per_page": 200,
            "organization_id": organizationID
        },
        connection: "zbooks"
    ];
 
    invoices = invoicesResponse.get("invoices");
    for each invoice in invoices {
        invoiceID = invoice.get("invoice_id");
        if (uniqueInvoiceIDs.notcontains(invoiceID)) {
            uniqueInvoiceIDs.add(invoiceID);
        }
    }
}
 
info uniqueInvoiceIDs;