How To Use API Pagination
search cancel

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

  1. Using curl
    1. curl -X GET '{API_URLForYourEnvironment}/integrationServices/v3/device?start=1&rows=1000' -H 'x-auth-token: {API Key}' - Returns rows 1-1000
      1. .../v3/device?start=1001&rows=1000' -H 'x-auth-token: {API Key}' - Returns rows 1001-2000
      2. .../v3/device?start=2001&rows=1000' -H 'x-auth-token: {API Key}' - Returns rows 2001-3000
  2. Using Invoke-WebRequest
    1. Invoke-WebRequest -Uri {API_URLForYourEnvironment}/integrationServices/v3/device?start=1&rows=1000 -Headers @{'X-Auth-Token'= API Key}' - Returns rows 1-1000
      1. .../v3/device?start=1001&rows=1000 -Headers @{'X-Auth-Token'= API Key}' - Returns rows 1001-2000
      2. .../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
    1. Log into the Web Console
    2. Go to the Connectors page
    3. Click the Download button
    4. Click on the API Specification button