Skip to content

Latest commit

 

History

History
419 lines (325 loc) · 13.1 KB

RealmApi.md

File metadata and controls

419 lines (325 loc) · 13.1 KB

Okta.Sdk.Api.RealmApi

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

Method HTTP request Description
CreateRealm POST /api/v1/realms Create a Realm
DeleteRealm DELETE /api/v1/realms/{realmId} Delete a Realm
GetRealm GET /api/v1/realms/{realmId} Retrieve a Realm
ListRealms GET /api/v1/realms List all Realms
ReplaceRealm PUT /api/v1/realms/{realmId} Replace the realm profile

CreateRealm

Realm CreateRealm (CreateRealmRequest body)

Create a Realm

Creates a new Realm

Example

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

namespace Example
{
    public class CreateRealmExample
    {
        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 RealmApi(config);
            var body = new CreateRealmRequest(); // CreateRealmRequest | 

            try
            {
                // Create a Realm
                Realm result = apiInstance.CreateRealm(body);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RealmApi.CreateRealm: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
body CreateRealmRequest

Return type

Realm

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]

DeleteRealm

void DeleteRealm (string realmId)

Delete a Realm

Deletes a Realm permanently. This operation can only be performed after disassociating other entities like Users and Identity Providers from a Realm.

Example

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

namespace Example
{
    public class DeleteRealmExample
    {
        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 RealmApi(config);
            var realmId = vvrcFogtKCrK9aYq3fgV;  // string | `id` of the Realm

            try
            {
                // Delete a Realm
                apiInstance.DeleteRealm(realmId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RealmApi.DeleteRealm: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
realmId string `id` of the Realm

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 -
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]

GetRealm

Realm GetRealm (string realmId)

Retrieve a Realm

Retrieves a Realm

Example

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

namespace Example
{
    public class GetRealmExample
    {
        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 RealmApi(config);
            var realmId = vvrcFogtKCrK9aYq3fgV;  // string | `id` of the Realm

            try
            {
                // Retrieve a Realm
                Realm result = apiInstance.GetRealm(realmId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RealmApi.GetRealm: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
realmId string `id` of the Realm

Return type

Realm

Authorization

apiToken, oauth2

HTTP request headers

  • Content-Type: Not defined
  • 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]

ListRealms

List<Realm> ListRealms (int? limit = null, string after = null, string search = null, string sortBy = null, string sortOrder = null)

List all Realms

Lists all Realms

Example

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

namespace Example
{
    public class ListRealmsExample
    {
        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 RealmApi(config);
            var limit = 200;  // int? | Specifies the number of results returned. Defaults to 10 if `search` is provided. (optional)  (default to 200)
            var after = "after_example";  // string | The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See [Pagination](/#pagination). (optional) 
            var search = "search_example";  // string | Searches for Realms with a supported filtering expression for most properties (optional) 
            var sortBy = profile.name;  // string | Specifies field to sort by and can be any single property (for search queries only). (optional) 
            var sortOrder = "\"asc\"";  // string | Specifies sort order `asc` or `desc` (for search queries only). This parameter is ignored if `sortBy` isn't present. (optional)  (default to "asc")

            try
            {
                // List all Realms
                List<Realm> result = apiInstance.ListRealms(limit, after, search, sortBy, sortOrder).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RealmApi.ListRealms: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
limit int? Specifies the number of results returned. Defaults to 10 if `search` is provided. [optional] [default to 200]
after string The cursor to use for pagination. It is an opaque string that specifies your current location in the list and is obtained from the `Link` response header. See Pagination. [optional]
search string Searches for Realms with a supported filtering expression for most properties [optional]
sortBy string Specifies field to sort by and can be any single property (for search queries only). [optional]
sortOrder string Specifies sort order `asc` or `desc` (for search queries only). This parameter is ignored if `sortBy` isn't present. [optional] [default to "asc"]

Return type

List<Realm>

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]

ReplaceRealm

Realm ReplaceRealm (string realmId, UpdateRealmRequest body)

Replace the realm profile

Replaces the realm profile

Example

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

namespace Example
{
    public class ReplaceRealmExample
    {
        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 RealmApi(config);
            var realmId = vvrcFogtKCrK9aYq3fgV;  // string | `id` of the Realm
            var body = new UpdateRealmRequest(); // UpdateRealmRequest | 

            try
            {
                // Replace the realm profile
                Realm result = apiInstance.ReplaceRealm(realmId, body);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RealmApi.ReplaceRealm: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
realmId string `id` of the Realm
body UpdateRealmRequest

Return type

Realm

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]