Skip to content

Latest commit

 

History

History
485 lines (374 loc) · 14 KB

HookKeyApi.md

File metadata and controls

485 lines (374 loc) · 14 KB

Okta.Sdk.Api.HookKeyApi

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

Method HTTP request Description
CreateHookKey POST /api/v1/hook-keys Create a key
DeleteHookKey DELETE /api/v1/hook-keys/{hookKeyId} Delete a key
GetHookKey GET /api/v1/hook-keys/{hookKeyId} Retrieve a key
GetPublicKey GET /api/v1/hook-keys/public/{publicKeyId} Retrieve a public key
ListHookKeys GET /api/v1/hook-keys List all keys
ReplaceHookKey PUT /api/v1/hook-keys/{hookKeyId} Replace a key

CreateHookKey

HookKey CreateHookKey (KeyRequest keyRequest)

Create a key

Creates a key for use with other parts of the application, such as inline hooks Use the key name to access this key for inline hook operations. The total number of keys that you can create in an Okta org is limited to 50.

Example

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

namespace Example
{
    public class CreateHookKeyExample
    {
        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 HookKeyApi(config);
            var keyRequest = new KeyRequest(); // KeyRequest | 

            try
            {
                // Create a key
                HookKey result = apiInstance.CreateHookKey(keyRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling HookKeyApi.CreateHookKey: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
keyRequest KeyRequest

Return type

HookKey

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Success -
400 Bad Request -
403 Forbidden -
429 Too Many Requests -

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

DeleteHookKey

void DeleteHookKey (string hookKeyId)

Delete a key

Deletes a key by hookKeyId. After being deleted, the key is unrecoverable. As a safety precaution, only keys that aren't being used are eligible for deletion.

Example

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

namespace Example
{
    public class DeleteHookKeyExample
    {
        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 HookKeyApi(config);
            var hookKeyId = XreKU5laGwBkjOTehusG;  // string | `id` of the Hook Key

            try
            {
                // Delete a key
                apiInstance.DeleteHookKey(hookKeyId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling HookKeyApi.DeleteHookKey: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
hookKeyId string `id` of the Hook Key

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]

GetHookKey

HookKey GetHookKey (string hookKeyId)

Retrieve a key

Retrieves a key by hookKeyId

Example

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

namespace Example
{
    public class GetHookKeyExample
    {
        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 HookKeyApi(config);
            var hookKeyId = XreKU5laGwBkjOTehusG;  // string | `id` of the Hook Key

            try
            {
                // Retrieve a key
                HookKey result = apiInstance.GetHookKey(hookKeyId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling HookKeyApi.GetHookKey: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
hookKeyId string `id` of the Hook Key

Return type

HookKey

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]

GetPublicKey

JsonWebKey GetPublicKey (string publicKeyId)

Retrieve a public key

Retrieves a public key by keyId

Example

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

namespace Example
{
    public class GetPublicKeyExample
    {
        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 HookKeyApi(config);
            var publicKeyId = FcH2P9Eg7wr0o8N2FuV0;  // string | `id` of the Public Key

            try
            {
                // Retrieve a public key
                JsonWebKey result = apiInstance.GetPublicKey(publicKeyId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling HookKeyApi.GetPublicKey: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
publicKeyId string `id` of the Public Key

Return type

JsonWebKey

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]

ListHookKeys

List<HookKey> ListHookKeys ()

List all keys

Lists all keys

Example

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

namespace Example
{
    public class ListHookKeysExample
    {
        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 HookKeyApi(config);

            try
            {
                // List all keys
                List<HookKey> result = apiInstance.ListHookKeys().ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling HookKeyApi.ListHookKeys: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

List<HookKey>

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 -
429 Too Many Requests -

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

ReplaceHookKey

HookKey ReplaceHookKey (string hookKeyId, KeyRequest keyRequest)

Replace a key

Replaces a key by hookKeyId This request replaces existing properties after passing validation. Note: The only parameter that you can update is the name of the key, which must be unique at all times.

Example

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

namespace Example
{
    public class ReplaceHookKeyExample
    {
        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 HookKeyApi(config);
            var hookKeyId = XreKU5laGwBkjOTehusG;  // string | `id` of the Hook Key
            var keyRequest = new KeyRequest(); // KeyRequest | 

            try
            {
                // Replace a key
                HookKey result = apiInstance.ReplaceHookKey(hookKeyId, keyRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling HookKeyApi.ReplaceHookKey: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
hookKeyId string `id` of the Hook Key
keyRequest KeyRequest

Return type

HookKey

Authorization

apiToken, oauth2

HTTP request headers

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

HTTP response details

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

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