Skip to content

Latest commit

 

History

History
265 lines (181 loc) · 7.79 KB

CustomScriptsAPI.md

File metadata and controls

265 lines (181 loc) · 7.79 KB

CustomScriptsAPI

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

Method HTTP request Description
createCustomScript POST /api/v1/library/custom-scripts Create Custom Script
deleteCustomScript DELETE /api/v1/library/custom-scripts/{library_item_id} Delete Custom Script
getCustomScript GET /api/v1/library/custom-scripts/{library_item_id} Get Custom Script
listCustomScripts GET /api/v1/library/custom-scripts List Custom Scripts
updateCustomScript PATCH /api/v1/library/custom-scripts/{library_item_id} Update Custom Script

createCustomScript

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

Create Custom Script

This request allows you to create a custom script in the Kandji library.

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 body = "body_example" // String |  (optional)

// Create Custom Script
CustomScriptsAPI.createCustomScript(body: body) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
body String [optional]

Return type

AnyCodable

Authorization

bearer

HTTP request headers

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

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

deleteCustomScript

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

Delete Custom Script

NOTICE: This is permanent so be careful.

This endpoint sends a request to delete a specific custom scripts from the Kandji library.

Request Parameters

library_item_id (path parameter): The unique identifier 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 libraryItemId = "libraryItemId_example" // String | 

// Delete Custom Script
CustomScriptsAPI.deleteCustomScript(libraryItemId: libraryItemId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
libraryItemId String

Return type

Void (empty response body)

Authorization

bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: text/html; charset=utf-8

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

getCustomScript

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

Get Custom Script

This endpoint retrieves details about a specific custom script from the Kandji library.

Request Parameters

library_item_id (path parameter): The unique identifier 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 libraryItemId = "libraryItemId_example" // String | 

// Get Custom Script
CustomScriptsAPI.getCustomScript(libraryItemId: libraryItemId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
libraryItemId 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]

listCustomScripts

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

List Custom Scripts

This endpoint makes a request to retrieve a list of custom scripts from the Kandji library.

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 page = "page_example" // String | Optional page number. Used when results exceed pagination threshold. A hard upper limit is set at 300 device records returned per request. (optional)

// List Custom Scripts
CustomScriptsAPI.listCustomScripts(page: page) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
page String Optional page number. Used when results exceed pagination threshold. A hard upper limit is set at 300 device records returned per request. [optional]

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]

updateCustomScript

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

Update Custom Script

This request allows you to update a custom script in the Kandji library.

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 libraryItemId = "libraryItemId_example" // String | 
let body = "body_example" // String |  (optional)

// Update Custom Script
CustomScriptsAPI.updateCustomScript(libraryItemId: libraryItemId, body: body) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
libraryItemId String
body String [optional]

Return type

AnyCodable

Authorization

bearer

HTTP request headers

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

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