Skip to content

Latest commit

 

History

History
568 lines (357 loc) · 14.8 KB

DeviceAPI.md

File metadata and controls

568 lines (357 loc) · 14.8 KB

\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

ActivateDevice(ctx, deviceId).Execute()

Activate a Device

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    deviceId := "guo4a5u7JHHhjXrMK0g4" // string | `id` of the device

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.DeviceAPI.ActivateDevice(context.Background(), deviceId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.ActivateDevice``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
deviceId string `id` of the device

Other Parameters

Other parameters are passed through a pointer to a apiActivateDeviceRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

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

DeactivateDevice

DeactivateDevice(ctx, deviceId).Execute()

Deactivate a Device

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    deviceId := "guo4a5u7JHHhjXrMK0g4" // string | `id` of the device

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.DeviceAPI.DeactivateDevice(context.Background(), deviceId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DeactivateDevice``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
deviceId string `id` of the device

Other Parameters

Other parameters are passed through a pointer to a apiDeactivateDeviceRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

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

DeleteDevice

DeleteDevice(ctx, deviceId).Execute()

Delete a Device

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    deviceId := "guo4a5u7JHHhjXrMK0g4" // string | `id` of the device

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.DeviceAPI.DeleteDevice(context.Background(), deviceId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.DeleteDevice``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
deviceId string `id` of the device

Other Parameters

Other parameters are passed through a pointer to a apiDeleteDeviceRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

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

GetDevice

Device GetDevice(ctx, deviceId).Execute()

Retrieve a Device

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    deviceId := "guo4a5u7JHHhjXrMK0g4" // string | `id` of the device

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.DeviceAPI.GetDevice(context.Background(), deviceId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.GetDevice``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetDevice`: Device
    fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.GetDevice`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
deviceId string `id` of the device

Other Parameters

Other parameters are passed through a pointer to a apiGetDeviceRequest struct via the builder pattern

Name Type Description Notes

Return type

Device

Authorization

apiToken, oauth2

HTTP request headers

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

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

ListDeviceUsers

[]DeviceUser ListDeviceUsers(ctx, deviceId).Execute()

List all Users for a Device

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    deviceId := "guo4a5u7JHHhjXrMK0g4" // string | `id` of the device

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.DeviceAPI.ListDeviceUsers(context.Background(), deviceId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.ListDeviceUsers``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListDeviceUsers`: []DeviceUser
    fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.ListDeviceUsers`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
deviceId string `id` of the device

Other Parameters

Other parameters are passed through a pointer to a apiListDeviceUsersRequest struct via the builder pattern

Name Type Description Notes

Return type

[]DeviceUser

Authorization

apiToken, oauth2

HTTP request headers

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

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

ListDevices

[]DeviceList ListDevices(ctx).After(after).Limit(limit).Search(search).Expand(expand).Execute()

List all Devices

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    after := "200u3des4afA47rYJu1d7" // string |  (optional)
    limit := int32(20) // int32 | A limit on the number of objects to return (recommend `20`) (optional) (default to 200)
    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)
    expand := "user" // string | Includes associated user details and management status for the device in the `_embedded` attribute (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.DeviceAPI.ListDevices(context.Background()).After(after).Limit(limit).Search(search).Expand(expand).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.ListDevices``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ListDevices`: []DeviceList
    fmt.Fprintf(os.Stdout, "Response from `DeviceAPI.ListDevices`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListDevicesRequest struct via the builder pattern

Name Type Description Notes
after string
limit int32 A limit on the number of objects to return (recommend `20`) [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.
expand string Includes associated user details and management status for the device in the `_embedded` attribute

Return type

[]DeviceList

Authorization

apiToken, oauth2

HTTP request headers

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

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

SuspendDevice

SuspendDevice(ctx, deviceId).Execute()

Suspend a Device

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    deviceId := "guo4a5u7JHHhjXrMK0g4" // string | `id` of the device

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.DeviceAPI.SuspendDevice(context.Background(), deviceId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.SuspendDevice``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
deviceId string `id` of the device

Other Parameters

Other parameters are passed through a pointer to a apiSuspendDeviceRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

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

UnsuspendDevice

UnsuspendDevice(ctx, deviceId).Execute()

Unsuspend a Device

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "github.com/okta/okta-sdk-golang"
)

func main() {
    deviceId := "guo4a5u7JHHhjXrMK0g4" // string | `id` of the device

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    r, err := apiClient.DeviceAPI.UnsuspendDevice(context.Background(), deviceId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `DeviceAPI.UnsuspendDevice``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
deviceId string `id` of the device

Other Parameters

Other parameters are passed through a pointer to a apiUnsuspendDeviceRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

apiToken, oauth2

HTTP request headers

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

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