How To Use API Pagination
book
Article ID: 289833
calendar_today
Updated On:
Products
Carbon Black Cloud Endpoint Standard (formerly Cb Defense)
Issue/Introduction
Explain how to modify API calls/queries to use pagination parameters
Environment
- Carbon Black Cloud Web Console: All Versions (Formerly CB Defense)
Resolution
- Using curl
- curl -X GET '{API_URLForYourEnvironment}/integrationServices/v3/device?start=1&rows=1000' -H 'x-auth-token: {API Key}' - Returns rows 1-1000
- .../v3/device?start=1001&rows=1000' -H 'x-auth-token: {API Key}' - Returns rows 1001-2000
- .../v3/device?start=2001&rows=1000' -H 'x-auth-token: {API Key}' - Returns rows 2001-3000
- Using Invoke-WebRequest
- Invoke-WebRequest -Uri {API_URLForYourEnvironment}/integrationServices/v3/device?start=1&rows=1000 -Headers @{'X-Auth-Token'= API Key}' - Returns rows 1-1000
- .../v3/device?start=1001&rows=1000 -Headers @{'X-Auth-Token'= API Key}' - Returns rows 1001-2000
- .../v3/device?start=2001&rows=1000 -Headers @{'X-Auth-Token'= API Key}' - Returns rows 2001-3000
Additional Information
- Use the 'start' and 'rows' parameters to return large result sets
- start: specify which row to begin the query from
- rows: specify the number of rows from start to return
- There is a hard limit of 5k rows on the /devices API per call, and a hard limit of 10k rows on the /events API at maximum
- For more information on using the Carbon Black Cloud API follow these steps to view the current reference document
- Log into the Web Console
- Go to the Connectors page
- Click the Download button
- Click on the API Specification button
Feedback
thumb_up
Yes
thumb_down
No