Kandji
  • 08 Aug 2024
  • 2 Minutes to read
  • Dark
    Light
  • PDF

Kandji

  • Dark
    Light
  • PDF

Article summary

Kandji API

API Documentation Link


Configuration Parameters

Any instance where an entry in the below configuration has a leading $ represents a parameter that needs to be replaced with a static value.

Parameters in this document:

  • $sub_domain - Per Kandji API documentation, you can find your API URL sub-domain in the Settings > Access.
  • $base_url - The Base URL will follow the below format, depending on your region:
    • US - https://$sub_domain.api.kandji.io/api/v1
    • EU - https://$sub_domain.api.eu.kandji.io/api/v1
  • $resource_name - The Resource Name represents the name of the resource to be appended and used as part of the Destination Table name. Details of the value that should be used here can be found in the API Resources section below.
  • $api_token - The API Token will provide access to the Kandji API. Documentation on how to generate an API Token can be found here.

API Resources

For a list of API Resources available for Kandji, please refer to the list of endpoints found within their documentation here, where a list of endpoints can be found on the lefthand side of the documentation.


Connector configuration

  • Base url: $base_url/$resource_name

Example: If collecting the Blueprints endpoint with a sub-domain of Panoply from the US region, the Base URL would be https://panoply.api.kandji.io/api/v1/blueprints, with https://panoply.api.kandji.io/api/v1 representing the $base_url and blueprints representing the $resource_name.

  • Method: GET
  • URL Parameters: limit=2500
  • Headers: {"Authorization":"Bearer {api_token}"}
  • Destination: kandji_$resource_name

Destination table naming convention is ultimately up to you as the data owner. One common structure used for this API is kandji_$resource_name (e.g. when collecting the Blueprints resource, using the Destination of kandji_blueprints).

Authorization

  • Authorization Bearer Token
  • Token: {api_token}

Variables

Variable nameVariable value
api_token$api_token

Pagination

Not all resources will require pagination, so please refer to documentation to ensure this section is required for the data that you would like to ingest into Panoply.

  • Enable: Checkbox.png
  • Get next page value: Static (integer to be incremented)
  • Start page: 0
  • Page step: 2500
  • Use next page value: As a URL parameter value
  • URL/body key: offset
  • URL parameters to remove: offset
  • Stop iterating when: Empty data

Advanced Settings

  • Data Key: The Data Key should be set as location in the API call response of the data that you would like to ingest. Each resource will have a different Data Key, and should be identified from the Example Response the is provided alongside each of the API resources. For example, the List Devices resource does not require a Data Key since the data being ingested is at the top-level of the API response, while the List Blueprints resource will have a Data Key of results. See the screenshot below for a visual example of where the Data Key is in each of the responses mentioned.
  • Primary Key: The Primary Key should be set as the field in the API call response that can be used as a unique value for each record, and should be entered in {} brackets. Each resource will have a different Primary Key, and should be identified from the Example Response the is provided alongside each of the API resources. For example, the List Devices resource will have a Primary Key of {device_id}, while the List Blueprints resource has a unique value under the id field, and thus no value will be required here in the configuration as Panoply defaults to using {id} as the Primary Key. See the screenshot below for a visual example of where the Primary Key is in each of the responses mentioned.

Data Key Example.png


Was this article helpful?

What's Next