Skip to content

Latest commit

 

History

History
366 lines (324 loc) · 26.5 KB

README.md

File metadata and controls

366 lines (324 loc) · 26.5 KB

Go API client for kandji_sdk

Welcome to the Kandji API Documentation

You can find your API URL in Settings > Access. The API URL will follow the below formats.

  • US - https://SubDomain.api.kandji.io

  • EU - https://SubDomain.api.eu.kandji.io

For information on how to obtain an API token, please refer to the following support article.

https://support.kandji.io/api

Rate Limit

The Kandji API currently has an API rate limit of 10,000 requests per hour per customer.

Request Methods

HTTP request methods supported by the Kandji API.

Method Definition
GET The GET method requests a representation of the specified resource.
POST The POST method submits an entity to the specified resource.
PATCH The PATCH method applies partial modifications to a resource.
DELETE The DELETE method deletes the specified resource.

Response codes

Not all response codes apply to every endpoint.

Code Response
200 OK
201 Created
204 No content
Typical response when sending the DELETE method.
400 Bad Request
"Command already running" - The command may already be running in a Pending state waiting on the device.
"Command is not allowed for current device" - The command may not be compatible with the target device.
"JSON parse error - Expecting ',' delimiter: line 3 column 2 (char 65)"
401 Unauthorized
This error can occur if the token is incorrect, was revoked, or the token has expired.
403 Forbidden
The request was understood but cannot be authorized.
404 Not found
Unable to locate the resource in the Kandji tenant.
415 Unsupported Media Type
The request contains a media type which the server or resource does not support.
500 Internal server error
503 Service unavailable
This error can occur if a file upload is still being processed via the custom apps API.

Data structure

The API returns all structured responses in JSON schema format.

Examples

Code examples using the API can be found in the Kandji support GitHub.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import kandji_sdk "github.com/MScottBlake/kandji-go-sdk"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value kandji_sdk.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), kandji_sdk.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value kandji_sdk.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), kandji_sdk.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using kandji_sdk.ContextOperationServerIndices and kandji_sdk.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), kandji_sdk.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), kandji_sdk.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://<sub_domain>.api.kandji.io

Class Method HTTP request Description
AutomatedDeviceEnrollmentIntegrationsAPI AutomatedDeviceEnrollmentIntegrationsCreateAdeIntegration Post /api/v1/integrations/apple/ade/ Create ADE integration
AutomatedDeviceEnrollmentIntegrationsAPI AutomatedDeviceEnrollmentIntegrationsDeleteAdeIntegration Delete /api/v1/integrations/apple/ade/{ade_token_id} Delete ADE integration
AutomatedDeviceEnrollmentIntegrationsAPI AutomatedDeviceEnrollmentIntegrationsDownloadAdePublicKey Get /api/v1/integrations/apple/ade/public_key/ Download ADE public key
AutomatedDeviceEnrollmentIntegrationsAPI AutomatedDeviceEnrollmentIntegrationsGetAdeDevice Get /api/v1/integrations/apple/ade/devices/{device_id} Get ADE device
AutomatedDeviceEnrollmentIntegrationsAPI AutomatedDeviceEnrollmentIntegrationsGetAdeIntegration Get /api/v1/integrations/apple/ade/{ade_token_id} Get ADE integration
AutomatedDeviceEnrollmentIntegrationsAPI AutomatedDeviceEnrollmentIntegrationsListAdeDevices Get /api/v1/integrations/apple/ade/devices List ADE devices
AutomatedDeviceEnrollmentIntegrationsAPI AutomatedDeviceEnrollmentIntegrationsListAdeIntegrations Get /api/v1/integrations/apple/ade List ADE integrations
AutomatedDeviceEnrollmentIntegrationsAPI AutomatedDeviceEnrollmentIntegrationsListDevicesAssociatedToAdeToken Get /api/v1/integrations/apple/ade/{ade_token_id}/devices List devices associated to ADE token
AutomatedDeviceEnrollmentIntegrationsAPI AutomatedDeviceEnrollmentIntegrationsRenewAdeIntegration Post /api/v1/integrations/apple/ade/{ade_token_id}/renew Renew ADE integration
AutomatedDeviceEnrollmentIntegrationsAPI AutomatedDeviceEnrollmentIntegrationsUpdateAdeDevice Patch /api/v1/integrations/apple/ade/devices/{device_id} Update ADE device
AutomatedDeviceEnrollmentIntegrationsAPI AutomatedDeviceEnrollmentIntegrationsUpdateAdeIntegration Patch /api/v1/integrations/apple/ade/{ade_token_id} Update ADE integration
BlueprintsAPI BlueprintsAssignLibraryItem Post /api/v1/blueprints/{blueprint_id}/assign-library-item Assign Library Item
BlueprintsAPI BlueprintsCreateBlueprint Post /api/v1/blueprints Create Blueprint
BlueprintsAPI BlueprintsDeleteBlueprint Delete /api/v1/blueprints/{blueprint_id} Delete Blueprint
BlueprintsAPI BlueprintsGetBlueprint Get /api/v1/blueprints/{blueprint_id} Get Blueprint
BlueprintsAPI BlueprintsGetBlueprintTemplates Get /api/v1/blueprints/templates/ Get Blueprint Templates
BlueprintsAPI BlueprintsGetManualEnrollmentProfile Get /api/v1/blueprints/{blueprint_id}/ota-enrollment-profile Get Manual Enrollment Profile
BlueprintsAPI BlueprintsListBlueprints Get /api/v1/blueprints List Blueprints
BlueprintsAPI BlueprintsListLibraryItems Get /api/v1/blueprints/{blueprint_id}/list-library-items List Library Items
BlueprintsAPI BlueprintsRemoveLibraryItem Post /api/v1/blueprints/{blueprint_id}/remove-library-item Remove Library Item
BlueprintsAPI BlueprintsUpdateBlueprint Patch /api/v1/blueprints/{blueprint_id} Update Blueprint
CustomAppsAPI CustomAppsCreateCustomApp Post /api/v1/library/custom-apps Create Custom App
CustomAppsAPI CustomAppsDeleteCustomApp Delete /api/v1/library/custom-apps/{library_item_id} Delete Custom App
CustomAppsAPI CustomAppsGetCustomApp Get /api/v1/library/custom-apps/{library_item_id} Get Custom App
CustomAppsAPI CustomAppsListCustomApps Get /api/v1/library/custom-apps List Custom Apps
CustomAppsAPI CustomAppsUpdateCustomApp Patch /api/v1/library/custom-apps/{library_item_id} Update Custom App
CustomAppsAPI CustomAppsUploadCustomApp Post /api/v1/library/custom-apps/upload Upload Custom App
CustomProfilesAPI CustomProfilesCreateCustomProfile Post /api/v1/library/custom-profiles Create Custom Profile
CustomProfilesAPI CustomProfilesDeleteCustomProfile Delete /api/v1/library/custom-profiles/{library_item_id} Delete Custom Profile
CustomProfilesAPI CustomProfilesGetCustomProfile Get /api/v1/library/custom-profiles/{library_item_id} Get Custom Profile
CustomProfilesAPI CustomProfilesListCustomProfiles Get /api/v1/library/custom-profiles List Custom Profiles
CustomProfilesAPI CustomProfilesUpdateCustomProfile Patch /api/v1/library/custom-profiles/{library_item_id} Update Custom Profile
CustomScriptsAPI CustomScriptsCreateCustomScript Post /api/v1/library/custom-scripts Create Custom Script
CustomScriptsAPI CustomScriptsDeleteCustomScript Delete /api/v1/library/custom-scripts/{library_item_id} Delete Custom Script
CustomScriptsAPI CustomScriptsGetCustomScript Get /api/v1/library/custom-scripts/{library_item_id} Get Custom Script
CustomScriptsAPI CustomScriptsListCustomScripts Get /api/v1/library/custom-scripts List Custom Scripts
CustomScriptsAPI CustomScriptsUpdateCustomScript Patch /api/v1/library/custom-scripts/{library_item_id} Update Custom Script
DeviceActionsAPI DeviceActionsClearPasscode Post /api/v1/devices/{device_id}/action/clearpasscode Clear Passcode
DeviceActionsAPI DeviceActionsDeleteDevice Delete /api/v1/devices/{device_id} Delete Device
DeviceActionsAPI DeviceActionsDeleteUser Post /api/v1/devices/{device_id}/action/deleteuser Delete User
DeviceActionsAPI DeviceActionsEraseDevice Post /api/v1/devices/{device_id}/action/erase Erase Device
DeviceActionsAPI DeviceActionsGetDeviceCommands Get /api/v1/devices/{device_id}/commands Get Device Commands
DeviceActionsAPI DeviceActionsLockDevice Post /api/v1/devices/{device_id}/action/lock Lock Device
DeviceActionsAPI DeviceActionsReinstallAgent Post /api/v1/devices/{device_id}/action/reinstallagent Reinstall Agent
DeviceActionsAPI DeviceActionsRemoteDesktop Post /api/v1/devices/{device_id}/action/remotedesktop Remote Desktop
DeviceActionsAPI DeviceActionsRenewMdmProfile Post /api/v1/devices/{device_id}/action/renewmdmprofile Renew MDM Profile
DeviceActionsAPI DeviceActionsRestartDevice Post /api/v1/devices/{device_id}/action/restart Restart Device
DeviceActionsAPI DeviceActionsSendBlankpush Post /api/v1/devices/{device_id}/action/blankpush Send Blankpush
DeviceActionsAPI DeviceActionsSetName Post /api/v1/devices/{device_id}/action/setname Set Name
DeviceActionsAPI DeviceActionsShutdown Post /api/v1/devices/{device_id}/action/shutdown Shutdown
DeviceActionsAPI DeviceActionsUnlockAccount Post /api/v1/devices/{device_id}/action/unlockaccount Unlock Account
DeviceActionsAPI DeviceActionsUpdateInventory Post /api/v1/devices/{device_id}/action/updateinventory Update Inventory
DeviceInformationAPI DeviceInformationCancelLostMode Delete /api/v1/devices/{device_id}/details/lostmode Cancel Lost Mode
DeviceInformationAPI DeviceInformationGetDeviceActivity Get /api/v1/devices/{device_id}/activity Get Device Activity
DeviceInformationAPI DeviceInformationGetDeviceApps Get /api/v1/devices/{device_id}/apps Get Device Apps
DeviceInformationAPI DeviceInformationGetDeviceDetails Get /api/v1/devices/{device_id}/details Get Device Details
DeviceInformationAPI DeviceInformationGetDeviceLibraryItems Get /api/v1/devices/{device_id}/library-items Get Device Library Items
DeviceInformationAPI DeviceInformationGetDeviceLostModeDetails Get /api/v1/devices/{device_id}/details/lostmode Get Device Lost Mode details
DeviceInformationAPI DeviceInformationGetDeviceParameters Get /api/v1/devices/{device_id}/parameters Get Device Parameters
DeviceInformationAPI DeviceInformationGetDeviceStatus Get /api/v1/devices/{device_id}/status Get Device Status
DeviceInformationAPI DeviceInformationListDevices Get /api/v1/devices List Devices
DeviceSecretsAPI DeviceSecretsGetActivationLockBypassCode Get /api/v1/devices/{device_id}/secrets/bypasscode Get Activation Lock Bypass Code
DeviceSecretsAPI DeviceSecretsGetFilevaultRecoveryKey Get /api/v1/devices/{device_id}/secrets/filevaultkey Get FileVault Recovery Key
DeviceSecretsAPI DeviceSecretsGetRecoveryLockPassword Get /api/v1/devices/{device_id}/secrets/recoverypassword Get Recovery Lock Password
DeviceSecretsAPI DeviceSecretsGetUnlockPin Get /api/v1/devices/{device_id}/secrets/unlockpin Get Unlock Pin
InHouseAppsAPI InhouseAppsCreateInhouseApp Post /api/v1/library/ipa-apps Create In-House App
InHouseAppsAPI InhouseAppsDeleteInhouseApp Delete /api/v1/library/ipa-apps/{library_item_id} Delete In-House App
InHouseAppsAPI InhouseAppsGetInhouseApp Get /api/v1/library/ipa-apps/{library_item_id} Get In-House App
InHouseAppsAPI InhouseAppsListInhouseApps Get /api/v1/library/ipa-apps List In-House Apps
InHouseAppsAPI InhouseAppsUpdateInhouseApp Patch /api/v1/library/ipa-apps/{library_item_id} Update In-House App
InHouseAppsAPI InhouseAppsUploadInhouseApp Post /api/v1/library/ipa-apps/upload Upload In-House App
InHouseAppsAPI InhouseAppsUploadInhouseAppStatus Get /api/v1/library/ipa-apps/upload/{pending_upload_id}/status Upload In-House App Status
LibraryItemsAPI LibraryItemsGetLibraryItemActivity Get /api/v1/library/library-items/{library_item_id}/activity Get Library Item Activity
LibraryItemsAPI LibraryItemsGetLibraryItemStatuses Get /api/v1/library/library-items/{library_item_id}/status Get Library Item Statuses
LostModeAPI LostModeDisableLostMode Post /api/v1/devices/{device_id}/action/disablelostmode Disable Lost Mode
LostModeAPI LostModeEnableLostMode Post /api/v1/devices/{device_id}/action/enablelostmode Enable Lost Mode
LostModeAPI LostModePlayLostModeSound Post /api/v1/devices/{device_id}/action/playlostmodesound Play Lost Mode Sound
LostModeAPI LostModeUpdateLocation Post /api/v1/devices/{device_id}/action/updatelocation Update Location
NotesAPI NotesCreateDeviceNote Post /api/v1/devices/{device_id}/notes Create Device Note
NotesAPI NotesDeleteDeviceNote Delete /api/v1/devices/{device_id}/notes/{note_id} Delete Device Note
NotesAPI NotesGetDeviceNotes Get /api/v1/devices/{device_id}/notes Get Device Notes
NotesAPI NotesRetrieveDeviceNote Get /api/v1/devices/{device_id}/notes/{note_id} Retrieve Device Note
NotesAPI NotesUpdateDeviceNote Patch /api/v1/devices/{device_id}/notes/{note_id} Update Device Note
PrismAPI PrismActivationLock Get /api/v1/prism/activation_lock Activation lock
PrismAPI PrismApplicationFirewall Get /api/v1/prism/application_firewall Application firewall
PrismAPI PrismApplications Get /api/v1/prism/apps Applications
PrismAPI PrismCertificates Get /api/v1/prism/certificates Certificates
PrismAPI PrismCount Get /api/v1/prism/count Count
PrismAPI PrismDesktopAndScreensaver Get /api/v1/prism/desktop_and_screensaver Desktop and Screensaver
PrismAPI PrismDeviceInformation Get /api/v1/prism/device_information Device information
PrismAPI PrismFilevault Get /api/v1/prism/filevault FileVault
PrismAPI PrismGatekeeperAndXprotect Get /api/v1/prism/gatekeeper_and_xprotect Gatekeeper and XProtect
PrismAPI PrismGetCategoryExport Get /api/v1/prism/export/{export_id} Get category export
PrismAPI PrismInstalledProfiles Get /api/v1/prism/installed_profiles Installed profiles
PrismAPI PrismKernelExtensions Get /api/v1/prism/kernel_extensions Kernel Extensions
PrismAPI PrismLaunchAgentsAndDaemons Get /api/v1/prism/launch_agents_and_daemons Launch Agents and Daemons
PrismAPI PrismLocalUsers Get /api/v1/prism/local_users Local users
PrismAPI PrismRequestCategoryExport Post /api/v1/prism/export Request category export
PrismAPI PrismStartupSettings Get /api/v1/prism/startup_settings Startup settings
PrismAPI PrismSystemExtensions Get /api/v1/prism/system_extensions System Extensions
PrismAPI PrismTransparencyDatabase Get /api/v1/prism/transparency_database Transparency database
SelfServiceAPI SelfServiceListSelfServiceCategories Get /api/v1/self-service/categories List Self Service Categories
SettingsAPI SettingsLicensing Get /api/v1/settings/licensing Licensing
TagsAPI TagsCreateTag Post /api/v1/tags Create Tag
TagsAPI TagsDeleteTag Delete /api/v1/tags/{tag_id} Delete Tag
TagsAPI TagsGetTags Get /api/v1/tags Get Tags
TagsAPI TagsUpdateTag Patch /api/v1/tags/{tag_id} Update Tag
ThreatsAPI ThreatsGetThreatDetails Get /api/v1/threat-details Get Threat Details
UsersAPI UsersDeleteUser Delete /api/v1/users/{user_id} Delete User
UsersAPI UsersGetUser Get /api/v1/users/{user_id} Get User
UsersAPI UsersListUsers Get /api/v1/users List Users

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

bearer

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), kandji_sdk.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

[email protected]