Skip to content

Latest commit

 

History

History
167 lines (115 loc) · 5.8 KB

UsersAPI.md

File metadata and controls

167 lines (115 loc) · 5.8 KB

UsersAPI

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

Method HTTP request Description
deleteUser DELETE /api/v1/users/{user_id} Delete User
getUser GET /api/v1/users/{user_id} Get User
listUsers GET /api/v1/users List Users

deleteUser

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

Delete User

This endpoint makes a request to delete a specified user directory integration user by id (uuid).

User still assigned to device

You will see the following response (400 bad request), if a user is still assigned to one or more devices in Kandji. The user will need to be unassigned from the device either manually through the Kandji tenant or programatically using the Update device API endpoint.

{     "detail": "User still assigned to one or more devices." }  

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 userId = "userId_example" // String | 

// Delete User
UsersAPI.deleteUser(userId: userId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
userId String

Return type

Void (empty response body)

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]

getUser

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

Get User

This endpoint makes a request to retrieve a specified user directory integration user by id.

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 userId = "userId_example" // String | 

// Get User
UsersAPI.getUser(userId: userId) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
userId String

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]

listUsers

    open class func listUsers(email: String? = nil, _id: String? = nil, integrationId: String? = nil, archived: String? = nil, completion: @escaping (_ data: AnyCodable?, _ error: Error?) -> Void)

List Users

This endpoint makes a request to retrieve a list of users from user directory integrations.

A maximum of 300 records are returned per request, and pagination can be performed leveraging the URLs provided in the next and previous keys in the response. If there are no more results available, the respective key will be null.

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 email = "email_example" // String | Returns users with email addresses containing the provided string. (optional)
let _id = "_id_example" // String | Search for a user matching the provided UUID value. (optional)
let integrationId = "integrationId_example" // String | Search for a integration matching the provided UUID value. (optional)
let archived = "archived_example" // String | Return only users that are either archived (true) or not archived (false). Archived users are users that appear in the Kandji Users module under the Archived tab. (optional)

// List Users
UsersAPI.listUsers(email: email, _id: _id, integrationId: integrationId, archived: archived) { (response, error) in
    guard error == nil else {
        print(error)
        return
    }

    if (response) {
        dump(response)
    }
}

Parameters

Name Type Description Notes
email String Returns users with email addresses containing the provided string. [optional]
_id String Search for a user matching the provided UUID value. [optional]
integrationId String Search for a integration matching the provided UUID value. [optional]
archived String Return only users that are either archived (true) or not archived (false). Archived users are users that appear in the Kandji Users module under the Archived tab. [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]