Browsing Returned Results
This section provides guidance about interacting with the CX Cloud API to browse and manage returned results using features such as Pagination, Filtering, Reducing, Sorting, and Formatting, enabling the customization of queries and the efficient retrieval of data.
Pagination
Paginated GET operations only return a subset of results in the first response and allow API consumers to retrieve the number of records and specific pages in the JSON response. API Pagination relies on a snapshot of data at the time the API operation is invoked. There is no guarantee of data consistency between different API invocations. Pagination parameters are “page” and “rows”, which are optional; however, if “page” is added as part of the query parameter, “rows” must also be part of the query parameter and vice versa.
Example: https://apix.cisco.com/cs/api/v2/inventory/hardware
"pagination": {
"page": 1,
"pages": 18,
"rows": 8,
"total": 142
}
Filtering Result Set
The Filtering capability allows API consumers to filter the JSON response based on one or more optional parameters mentioned in the API Reference section.
Example: https://apix.cisco.com/cs/api/v2/inventory/hardware?customerId=1234&serialNumber=56789
Reducing Result Parameters
API consumers can reduce which response parameters are included in the JSON response. Refer to each API response parameter to use this capability in association with the keyword “fields”.
Example: https://apix.cisco.com/cs/api/v2/inventory/hardware?customerId=1234&fields=productFamily,productId,serialNumber
Sorting Results
The Sorting feature allows API consumers to sort the JSON response in ascending or descending order based on the optional request parameters. The request parameter used for this feature is “sort”, and the possible values are “ASC” or “DESC”. Only one field can be included in the sorting.
Example: https://apix.cisco.com/cs/api/v2/inventory/hardware?customerId=1234&sort=serialNumber:ASC
Rate Limits on Results
The rate limit for the project is 10 requests per second and 5000 requests per day.
Changing Response Format
API consumers can change the format of the API response from JSON to either CSV or TSV with the keyword "format".
Example: https://apix.cisco.com/cs/api/v2/inventory/hardware?customerId=1234&format=CSV
Combining Multiple Parameters in a Single API Request
CX Cloud API requests can combine any number of these request parameters. This example combines several into a single API request.
Example: https://apix.cisco.com/cs/api/v2/inventory/hardware?customerId=1234&page=1&rows=8&fields=productFamily,productId,serialNumber&sort=serialNumber:ASC&format=CSV