Skip to content

Latest commit

 

History

History
648 lines (500 loc) · 21.7 KB

DeviceApi.md

File metadata and controls

648 lines (500 loc) · 21.7 KB

Okta.Sdk.Api.DeviceApi

All URIs are relative to https://subdomain.okta.com

Method HTTP request Description
ActivateDevice POST /api/v1/devices/{deviceId}/lifecycle/activate Activate a Device
DeactivateDevice POST /api/v1/devices/{deviceId}/lifecycle/deactivate Deactivate a Device
DeleteDevice DELETE /api/v1/devices/{deviceId} Delete a Device
GetDevice GET /api/v1/devices/{deviceId} Retrieve a Device
ListDeviceUsers GET /api/v1/devices/{deviceId}/users List all Users for a Device
ListDevices GET /api/v1/devices List all Devices
SuspendDevice POST /api/v1/devices/{deviceId}/lifecycle/suspend Suspend a Device
UnsuspendDevice POST /api/v1/devices/{deviceId}/lifecycle/unsuspend Unsuspend a Device

ActivateDevice

void ActivateDevice (string deviceId)

Activate a Device

Activates a Device by setting its status to ACTIVE by deviceId. Activated devices are used to create and delete Device user links.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class ActivateDeviceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new DeviceApi(config);
            var deviceId = guo4a5u7JHHhjXrMK0g4;  // string | `id` of the device

            try
            {
                // Activate a Device
                apiInstance.ActivateDevice(deviceId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DeviceApi.ActivateDevice: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
deviceId string `id` of the device

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

DeactivateDevice

void DeactivateDevice (string deviceId)

Deactivate a Device

Deactivates a Device by setting its status to DEACTIVATED by deviceId. Deactivation causes a Device to lose all device user links. Set the Device status to DEACTIVATED before deleting it. > Note: When deactivating a Device, keep in mind the following: - Device deactivation is a destructive operation for device factors and client certificates. Device reenrollment using Okta Verify allows end users to set up new factors on the device. - Device deletion removes the device record from Okta. Reenrollment creates a new device record.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class DeactivateDeviceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new DeviceApi(config);
            var deviceId = guo4a5u7JHHhjXrMK0g4;  // string | `id` of the device

            try
            {
                // Deactivate a Device
                apiInstance.DeactivateDevice(deviceId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DeviceApi.DeactivateDevice: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
deviceId string `id` of the device

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

DeleteDevice

void DeleteDevice (string deviceId)

Delete a Device

Deletes (permanently) a device by deviceId if it has a status of DEACTIVATED. You can transition the device to DEACTIVATED status using the Deactivate a Device endpoint. This request is destructive and deletes all of the profile data related to the device. Once deleted, device data can't be recovered. However, reenrollment creates a new device record. > Note: Attempts to delete a device that isn't in a DEACTIVATED state raise an error.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class DeleteDeviceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new DeviceApi(config);
            var deviceId = guo4a5u7JHHhjXrMK0g4;  // string | `id` of the device

            try
            {
                // Delete a Device
                apiInstance.DeleteDevice(deviceId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DeviceApi.DeleteDevice: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
deviceId string `id` of the device

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

GetDevice

Device GetDevice (string deviceId)

Retrieve a Device

Retrieves a device by deviceId

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class GetDeviceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new DeviceApi(config);
            var deviceId = guo4a5u7JHHhjXrMK0g4;  // string | `id` of the device

            try
            {
                // Retrieve a Device
                Device result = apiInstance.GetDevice(deviceId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DeviceApi.GetDevice: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
deviceId string `id` of the device

Return type

Device

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

ListDeviceUsers

List<DeviceUser> ListDeviceUsers (string deviceId)

List all Users for a Device

Lists all Users for a Device by deviceId

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class ListDeviceUsersExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new DeviceApi(config);
            var deviceId = guo4a5u7JHHhjXrMK0g4;  // string | `id` of the device

            try
            {
                // List all Users for a Device
                List<DeviceUser> result = apiInstance.ListDeviceUsers(deviceId).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DeviceApi.ListDeviceUsers: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
deviceId string `id` of the device

Return type

List<DeviceUser>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

ListDevices

List<DeviceList> ListDevices (string after = null, int? limit = null, string search = null, ListDeviceExpandSummaryType? expand = null)

List all Devices

Lists all devices with pagination support. You can return a subset of Devices that match a supported search criteria using the search query parameter. Searches for devices based on the properties specified in the search parameter conforming SCIM filter specifications (case-insensitive). This data is eventually consistent. The API returns different results depending on specified queries in the request. Empty list is returned if no objects match search request. > Note: Listing devices with search should not be used as a part of any critical flows—such as authentication or updates—to prevent potential data loss. search results may not reflect the latest information, as this endpoint uses a search index which may not be up-to-date with recent updates to the object.
Don't use search results directly for record updates, as the data might be stale and therefore overwrite newer data, resulting in data loss.
Use an id lookup for records that you update to ensure your results contain the latest data. This operation requires URL encoding. For example, search=profile.displayName eq \"Bob\" is encoded as search=profile.displayName%20eq%20%22Bob%22.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class ListDevicesExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new DeviceApi(config);
            var after = 200u3des4afA47rYJu1d7;  // string |  (optional) 
            var limit = 20;  // int? | A limit on the number of objects to return (recommend `20`) (optional)  (default to 200)
            var search = status eq "ACTIVE";  // string | A SCIM filter expression that filters the results. Searches include all Device `profile` properties and the Device `id`, `status`, and `lastUpdated` properties. (optional) 
            var expand = user;  // ListDeviceExpandSummaryType? | Includes associated user details and management status for the device in the `_embedded` attribute (optional) 

            try
            {
                // List all Devices
                List<DeviceList> result = apiInstance.ListDevices(after, limit, search, expand).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DeviceApi.ListDevices: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
after string [optional]
limit int? A limit on the number of objects to return (recommend `20`) [optional] [default to 200]
search string A SCIM filter expression that filters the results. Searches include all Device `profile` properties and the Device `id`, `status`, and `lastUpdated` properties. [optional]
expand ListDeviceExpandSummaryType? Includes associated user details and management status for the device in the `_embedded` attribute [optional]

Return type

List<DeviceList>

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
403 Forbidden -
429 Too Many Requests -

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

SuspendDevice

void SuspendDevice (string deviceId)

Suspend a Device

Suspends a Device by setting its status to SUSPENDED. Use suspended devices to create and delete device user links. You can only unsuspend or deactivate suspended devices. > Note: SUSPENDED status is meant to be temporary, so it isn't destructive.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class SuspendDeviceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new DeviceApi(config);
            var deviceId = guo4a5u7JHHhjXrMK0g4;  // string | `id` of the device

            try
            {
                // Suspend a Device
                apiInstance.SuspendDevice(deviceId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DeviceApi.SuspendDevice: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
deviceId string `id` of the device

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

UnsuspendDevice

void UnsuspendDevice (string deviceId)

Unsuspend a Device

Unsuspends a Device by returning its status to ACTIVE. >Note: Only devices with a SUSPENDED status can be unsuspended.

Example

using System.Collections.Generic;
using System.Diagnostics;
using Okta.Sdk.Api;
using Okta.Sdk.Client;
using Okta.Sdk.Model;

namespace Example
{
    public class UnsuspendDeviceExample
    {
        public static void Main()
        {
            Configuration config = new Configuration();
            config.OktaDomain = "https://subdomain.okta.com";
            // Configure API key authorization: apiToken
            config.Token ="YOUR_API_KEY";
            // Configure OAuth2 access token for authorization: oauth2
            config.AccessToken = "YOUR_ACCESS_TOKEN";

            var apiInstance = new DeviceApi(config);
            var deviceId = guo4a5u7JHHhjXrMK0g4;  // string | `id` of the device

            try
            {
                // Unsuspend a Device
                apiInstance.UnsuspendDevice(deviceId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling DeviceApi.UnsuspendDevice: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
deviceId string `id` of the device

Return type

void (empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 No Content -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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