Skip to content

Latest commit

 

History

History
550 lines (387 loc) · 24.6 KB

BlueprintsAPI.md

File metadata and controls

550 lines (387 loc) · 24.6 KB

BlueprintsAPI

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

Method HTTP request Description
assignLibraryItem POST /api/v1/blueprints/{blueprint_id}/assign-library-item Assign Library Item
createBlueprint POST /api/v1/blueprints Create Blueprint
deleteBlueprint DELETE /api/v1/blueprints/{blueprint_id} Delete Blueprint
getBlueprint GET /api/v1/blueprints/{blueprint_id} Get Blueprint
getBlueprintTemplates GET /api/v1/blueprints/templates/ Get Blueprint Templates
getManualEnrollmentProfile GET /api/v1/blueprints/{blueprint_id}/ota-enrollment-profile Get Manual Enrollment Profile
listBlueprints GET /api/v1/blueprints List Blueprints
listLibraryItems GET /api/v1/blueprints/{blueprint_id}/list-library-items List Library Items
removeLibraryItem POST /api/v1/blueprints/{blueprint_id}/remove-library-item Remove Library Item
updateBlueprint PATCH /api/v1/blueprints/{blueprint_id} Update Blueprint

assignLibraryItem

    open class func assignLibraryItem(blueprintId: String, body: String? = nil, completion: @escaping (_ data: AnyCodable?, _ error: Error?) -> Void)

Assign Library Item

This endpoint allows assigning a library item to a specific blueprint (classic and maps). The response will include a list of library item IDs assigned to the blueprint.

Request Parameters

blueprint_id (path parameter): The unique identifier of the blueprint.

Request Body

  • library_item_id (string, required)

  • assignment_node_id (string, required for maps)

    • Note: To find the assignment_node_id, view the map in a browser. Then, on your keyboard, press and hold the Option ⌥ key. Each node ID remains fixed for the lifespan of the node on the map.

Error responses

Code Body
400 - Bad Request Bad Request
"Library Item already exists on Blueprint"
"Library Item already exists in Assignment Node"
"assignment_node_id cannot be provided for Classic Blueprint"
"Must provide assignment_node_id for Assignment Map Blueprint"

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk

let blueprintId = "blueprintId_example" // String | 
let body = "body_example" // String |  (optional)

// Assign Library Item
BlueprintsAPI.assignLibraryItem(blueprintId: blueprintId, body: body) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
blueprintId String
body String [optional]

Return type

AnyCodable

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createBlueprint

    open class func createBlueprint(name: String, enrollmentCodeIsActive: String, enrollmentCodeCode: String, sourceType: String, sourceId: String, type: String, completion: @escaping (_ data: AnyCodable?, _ error: Error?) -> Void)

Create Blueprint

This request creates a new empty Blueprint or a new Blueprint from a template. The keys name and enrollment_code is_active are required, and the blueprint name key must be unique from the existing blueprint names in the Kandji tenant.

optionally, type: map can be used when creating a new Assignment Map blueprint.

Note: If cloning an existing blueprint,`type` value and the type of sourced (`source.id`) blueprint must match and `source.type` value must be set to `blueprint`.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk

let name = "name_example" // String | (required) Set the name of the Blueprint. The name provided must be unique.
let enrollmentCodeIsActive = "enrollmentCodeIsActive_example" // String | (required) Enable or Disable the Blueprint for manual device enrollment from the enrollment portal
let enrollmentCodeCode = "enrollmentCodeCode_example" // String | Optionally, set the enrollment code of the Blueprint. This key is not required. If an enrollment code is not supplied in the payload body, it will be randomly generated. The enrollment code will be returned in the response and visible in the Web app.
let sourceType = "sourceType_example" // String | Set the source to create the blueprint from. Possible options: <code>template</code> and <code>blueprint</code>.
let sourceId = "sourceId_example" // String | Set either the source template ID, or the source Blueprint ID to clone an existing template or blueprint.
let type = "type_example" // String | Choose the type of blueprint to create. Options: <code>classic</code> or <code>map</code>

// Create Blueprint
BlueprintsAPI.createBlueprint(name: name, enrollmentCodeIsActive: enrollmentCodeIsActive, enrollmentCodeCode: enrollmentCodeCode, sourceType: sourceType, sourceId: sourceId, type: type) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
name String (required) Set the name of the Blueprint. The name provided must be unique.
enrollmentCodeIsActive String (required) Enable or Disable the Blueprint for manual device enrollment from the enrollment portal
enrollmentCodeCode String Optionally, set the enrollment code of the Blueprint. This key is not required. If an enrollment code is not supplied in the payload body, it will be randomly generated. The enrollment code will be returned in the response and visible in the Web app.
sourceType String Set the source to create the blueprint from. Possible options: <code>template</code> and <code>blueprint</code>.
sourceId String Set either the source template ID, or the source Blueprint ID to clone an existing template or blueprint.
type String Choose the type of blueprint to create. Options: <code>classic</code> or <code>map</code>

Return type

AnyCodable

Authorization

bearer

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

deleteBlueprint

    open class func deleteBlueprint(blueprintId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)

Delete Blueprint

WARNING!

This is a HIGHLY destructive action.

Deleting a Blueprint will un-manage ALL devices assigned to the Blueprint.

Request Parameters

blueprint_id (path parameter): The unique identifier of the blueprint.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk

let blueprintId = "blueprintId_example" // String | 

// Delete Blueprint
BlueprintsAPI.deleteBlueprint(blueprintId: blueprintId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
blueprintId String

Return type

Void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getBlueprint

    open class func getBlueprint(blueprintId: String, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)

Get Blueprint

This request returns information about a specific blueprint based on blueprint ID.

Request Parameters

blueprint_id (path parameter): The unique identifier of the blueprint.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk

let blueprintId = "blueprintId_example" // String | 

// Get Blueprint
BlueprintsAPI.getBlueprint(blueprintId: blueprintId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
blueprintId String

Return type

Void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getBlueprintTemplates

    open class func getBlueprintTemplates(limit: String? = nil, offset: String? = nil, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)

Get Blueprint Templates

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk

let limit = "limit_example" // String | Number of results to return per page. (optional)
let offset = "offset_example" // String | The initial index from which to return the results. (optional)

// Get Blueprint Templates
BlueprintsAPI.getBlueprintTemplates(limit: limit, offset: offset) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
limit String Number of results to return per page. [optional]
offset String The initial index from which to return the results. [optional]

Return type

Void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getManualEnrollmentProfile

    open class func getManualEnrollmentProfile(blueprintId: String, sso: String? = nil, completion: @escaping (_ data: String?, _ error: Error?) -> Void)

Get Manual Enrollment Profile

This request returns the manual enrollment profile (.mobileconfig file) for a specified Blueprint.

This request will return the enrollment profile even if "Require Authentication" is configured for the Blueprint in Manual Enrollment.

The enrollment profile will be returned in raw form with response headers:

  • Content-Type = application/x-apple-aspen-config

  • Content-Disposition = attachment;filename=kandji-enroll.mobileconfig

An optional query parameter sso=true can be used to return a URL for SSO authentication instead. If this query parameter is used for a Blueprint that does not require authentication, then the enrollment profile will be returned.

Request Parameters

blueprint_id (path parameter): The unique identifier of the blueprint.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk

let blueprintId = "blueprintId_example" // String | 
let sso = "sso_example" // String | Use the <code>sso</code> query parameter, set to <code>true</code>, to return a URL instead of the manual enrollment profile. This parameter should only be used for blueprints in which &quot;Require Authentication&quot; is configured for Manual Enrollment. The returned URL must be used to authenticate via SSO to receive an enrollment profile. (optional)

// Get Manual Enrollment Profile
BlueprintsAPI.getManualEnrollmentProfile(blueprintId: blueprintId, sso: sso) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
blueprintId String
sso String Use the <code>sso</code> query parameter, set to <code>true</code>, to return a URL instead of the manual enrollment profile. This parameter should only be used for blueprints in which &quot;Require Authentication&quot; is configured for Manual Enrollment. The returned URL must be used to authenticate via SSO to receive an enrollment profile. [optional]

Return type

String

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/x-apple-aspen-config

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listBlueprints

    open class func listBlueprints(_id: String? = nil, idIn: String? = nil, name: String? = nil, limit: String? = nil, offset: String? = nil, completion: @escaping (_ data: AnyCodable?, _ error: Error?) -> Void)

List Blueprints

This request returns a list of a blueprint records in the Kandji tenant. Optional query parameters can be specified to filter the results.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk

let _id = "_id_example" // String | Look up a specific Blueprint by its ID (optional)
let idIn = "idIn_example" // String | Specify a list of Blueprint IDs to limit the results to.  Multiple values may be separated by commas. There is a double underscore (<code>__</code>) between id and in (optional)
let name = "name_example" // String | Return Blueprint names &quot;containing&quot; the specified search string. (optional)
let limit = "limit_example" // String | Number of results to return per page. (optional)
let offset = "offset_example" // String | The initial index from which to return the results. (optional)

// List Blueprints
BlueprintsAPI.listBlueprints(_id: _id, idIn: idIn, name: name, limit: limit, offset: offset) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
_id String Look up a specific Blueprint by its ID [optional]
idIn String Specify a list of Blueprint IDs to limit the results to. Multiple values may be separated by commas. There is a double underscore (<code>__</code>) between id and in [optional]
name String Return Blueprint names &quot;containing&quot; the specified search string. [optional]
limit String Number of results to return per page. [optional]
offset String The initial index from which to return the results. [optional]

Return type

AnyCodable

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listLibraryItems

    open class func listLibraryItems(blueprintId: String, completion: @escaping (_ data: AnyCodable?, _ error: Error?) -> Void)

List Library Items

This API endpoint retrieves a list of library items associated with a specific blueprint. (classic and maps). Requires that the blueprint ID is passed as a path parameter in the URL.

Request Parameters

blueprint_id (path parameter): The unique identifier of the blueprint.

Response fields

  • count (int): The total count of library items.

  • next (str): The URL for the next page of results, if available. If not available will value will be null.

  • previous (str): The URL for the previous page of results, if available. If not available will value will be null.

  • results (object): An array containing objects with the following fields:

    • id (str): The ID of the library item.

    • name (str): The name of the library item.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk

let blueprintId = "blueprintId_example" // String | 

// List Library Items
BlueprintsAPI.listLibraryItems(blueprintId: blueprintId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
blueprintId String

Return type

AnyCodable

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json; charset=utf-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

removeLibraryItem

    open class func removeLibraryItem(blueprintId: String, body: String? = nil, completion: @escaping (_ data: AnyCodable?, _ error: Error?) -> Void)

Remove Library Item

This endpoint allows removing a library item from a specific blueprint (classic and maps). The response will include a list of library item IDs assigned to the blueprint.

Request Parameters

blueprint_id (path parameter): The unique identifier of the blueprint.

Request Body

  • library_item_id (string, required)

  • assignment_node_id (string, required for maps)

Error responses

Code Body
400 - Bad Request Bad Request
"assignment_node_id cannot be provided for Classic Blueprint"
"Must provide assignment_node_id for Assignment Map Blueprint"
"Library Item does not exist on Blueprint"
"Library Item does not exist in Assignment Node"

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk

let blueprintId = "blueprintId_example" // String | 
let body = "body_example" // String |  (optional)

// Remove Library Item
BlueprintsAPI.removeLibraryItem(blueprintId: blueprintId, body: body) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
blueprintId String
body String [optional]

Return type

AnyCodable

Authorization

bearer

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateBlueprint

    open class func updateBlueprint(blueprintId: String, name: String, _description: String, enrollmentCodeCode: String, enrollmentCodeIsActive: String, completion: @escaping (_ data: AnyCodable?, _ error: Error?) -> Void)

Update Blueprint

This requests allows updating of the name, icon, icon color, description, enrollment code, and active status on an existing blueprint.

Request Parameters

blueprint_id (path parameter): The unique identifier of the blueprint.

Example

// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import kandji_sdk

let blueprintId = "blueprintId_example" // String | 
let name = "name_example" // String | Update the name of the Blueprint
let _description = "_description_example" // String | Update the description of the Blueprint 
let enrollmentCodeCode = "enrollmentCodeCode_example" // String | Update the enrollment code of the Blueprint 
let enrollmentCodeIsActive = "enrollmentCodeIsActive_example" // String | Disable the Blueprint for manual device enrollment from the enrollment portal.

// Update Blueprint
BlueprintsAPI.updateBlueprint(blueprintId: blueprintId, name: name, _description: _description, enrollmentCodeCode: enrollmentCodeCode, enrollmentCodeIsActive: enrollmentCodeIsActive) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
blueprintId String
name String Update the name of the Blueprint
_description String Update the description of the Blueprint
enrollmentCodeCode String Update the enrollment code of the Blueprint
enrollmentCodeIsActive String Disable the Blueprint for manual device enrollment from the enrollment portal.

Return type

AnyCodable

Authorization

bearer

HTTP request headers

  • Content-Type: application/x-www-form-urlencoded
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]