When calling a list method which returns multiple results, such as
GET /v1/customers, it is common that not all the results will be returned in one page and you will need to paginate to retrieve all the results. Metronome provides two URL parameters on all list endpoints that help with this.
limit- The limit parameter can be used to customize how many results are returned per page. If you want to make a quick API call to inspect the response format, you could set
limit=1, but if you want to try to load many results with as few API calls as possible, you could set
limit=50. For performance reasons,
limitis capped at
next_page- Allows the client to provide a
next_pagecursor from a prior request to fetch the next set of results.
When a set of results are returned, the response will optionally contain a
next_page field. If this is present, it should be sent along in the query on the next request to fetch the next set of results.
// The next_page cursor that can be passed in the URL to get the next
// set of results.
Given the above response, you can provide the
next_page cursor with the next request.
// Since no next_page value was returned, this is the last page of results.