Skip to content

Latest commit

 

History

History
1328 lines (1036 loc) · 43.1 KB

GroupApi.md

File metadata and controls

1328 lines (1036 loc) · 43.1 KB

Okta.Sdk.Api.GroupApi

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

Method HTTP request Description
ActivateGroupRule POST /api/v1/groups/rules/{groupRuleId}/lifecycle/activate Activate a Group Rule
AssignUserToGroup PUT /api/v1/groups/{groupId}/users/{userId} Assign a User
CreateGroup POST /api/v1/groups Create a Group
CreateGroupRule POST /api/v1/groups/rules Create a Group Rule
DeactivateGroupRule POST /api/v1/groups/rules/{groupRuleId}/lifecycle/deactivate Deactivate a Group Rule
DeleteGroup DELETE /api/v1/groups/{groupId} Delete a Group
DeleteGroupRule DELETE /api/v1/groups/rules/{groupRuleId} Delete a group Rule
GetGroup GET /api/v1/groups/{groupId} Retrieve a Group
GetGroupRule GET /api/v1/groups/rules/{groupRuleId} Retrieve a Group Rule
ListAssignedApplicationsForGroup GET /api/v1/groups/{groupId}/apps List all Assigned Applications
ListGroupRules GET /api/v1/groups/rules List all Group Rules
ListGroupUsers GET /api/v1/groups/{groupId}/users List all Member Users
ListGroups GET /api/v1/groups List all Groups
ReplaceGroup PUT /api/v1/groups/{groupId} Replace a Group
ReplaceGroupRule PUT /api/v1/groups/rules/{groupRuleId} Replace a Group Rule
UnassignUserFromGroup DELETE /api/v1/groups/{groupId}/users/{userId} Unassign a User

ActivateGroupRule

void ActivateGroupRule (string groupRuleId)

Activate a Group Rule

Activates a specific group rule by groupRuleId

Example

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

namespace Example
{
    public class ActivateGroupRuleExample
    {
        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 GroupApi(config);
            var groupRuleId = 0pr3f7zMZZHPgUoWO0g4;  // string | The `id` of the group rule

            try
            {
                // Activate a Group Rule
                apiInstance.ActivateGroupRule(groupRuleId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.ActivateGroupRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
groupRuleId string The `id` of the group rule

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]

AssignUserToGroup

void AssignUserToGroup (string groupId, string userId)

Assign a User

Assigns a user to a group with 'OKTA_GROUP' type

Example

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

namespace Example
{
    public class AssignUserToGroupExample
    {
        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 GroupApi(config);
            var groupId = 00g1emaKYZTWRYYRRTSK;  // string | The `id` of the group
            var userId = "userId_example";  // string | ID of an existing Okta user

            try
            {
                // Assign a User
                apiInstance.AssignUserToGroup(groupId, userId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.AssignUserToGroup: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
groupId string The `id` of the group
userId string ID of an existing Okta user

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]

CreateGroup

Group CreateGroup (Group group)

Create a Group

Creates a new group with OKTA_GROUP type

Example

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

namespace Example
{
    public class CreateGroupExample
    {
        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 GroupApi(config);
            var group = new Group(); // Group | 

            try
            {
                // Create a Group
                Group result = apiInstance.CreateGroup(group);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.CreateGroup: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
group Group

Return type

Group

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]

CreateGroupRule

GroupRule CreateGroupRule (GroupRule groupRule)

Create a Group Rule

Creates a group rule to dynamically add users to the specified group if they match the condition

Example

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

namespace Example
{
    public class CreateGroupRuleExample
    {
        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 GroupApi(config);
            var groupRule = new GroupRule(); // GroupRule | 

            try
            {
                // Create a Group Rule
                GroupRule result = apiInstance.CreateGroupRule(groupRule);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.CreateGroupRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
groupRule GroupRule

Return type

GroupRule

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]

DeactivateGroupRule

void DeactivateGroupRule (string groupRuleId)

Deactivate a Group Rule

Deactivates a specific group rule by groupRuleId

Example

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

namespace Example
{
    public class DeactivateGroupRuleExample
    {
        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 GroupApi(config);
            var groupRuleId = 0pr3f7zMZZHPgUoWO0g4;  // string | The `id` of the group rule

            try
            {
                // Deactivate a Group Rule
                apiInstance.DeactivateGroupRule(groupRuleId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.DeactivateGroupRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
groupRuleId string The `id` of the group rule

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]

DeleteGroup

void DeleteGroup (string groupId)

Delete a Group

Deletes a group with OKTA_GROUP type

Example

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

namespace Example
{
    public class DeleteGroupExample
    {
        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 GroupApi(config);
            var groupId = 00g1emaKYZTWRYYRRTSK;  // string | The `id` of the group

            try
            {
                // Delete a Group
                apiInstance.DeleteGroup(groupId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.DeleteGroup: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
groupId string The `id` of the group

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]

DeleteGroupRule

void DeleteGroupRule (string groupRuleId, bool? removeUsers = null)

Delete a group Rule

Deletes a specific group rule by groupRuleId

Example

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

namespace Example
{
    public class DeleteGroupRuleExample
    {
        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 GroupApi(config);
            var groupRuleId = 0pr3f7zMZZHPgUoWO0g4;  // string | The `id` of the group rule
            var removeUsers = true;  // bool? | Indicates whether to keep or remove users from groups assigned by this rule. (optional) 

            try
            {
                // Delete a group Rule
                apiInstance.DeleteGroupRule(groupRuleId, removeUsers);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.DeleteGroupRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
groupRuleId string The `id` of the group rule
removeUsers bool? Indicates whether to keep or remove users from groups assigned by this rule. [optional]

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
202 Accepted -
403 Forbidden -
404 Not Found -
429 Too Many Requests -

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

GetGroup

Group GetGroup (string groupId)

Retrieve a Group

Retrieves a group by groupId

Example

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

namespace Example
{
    public class GetGroupExample
    {
        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 GroupApi(config);
            var groupId = 00g1emaKYZTWRYYRRTSK;  // string | The `id` of the group

            try
            {
                // Retrieve a Group
                Group result = apiInstance.GetGroup(groupId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.GetGroup: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
groupId string The `id` of the group

Return type

Group

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]

GetGroupRule

GroupRule GetGroupRule (string groupRuleId, string expand = null)

Retrieve a Group Rule

Retrieves a specific group rule by groupRuleId

Example

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

namespace Example
{
    public class GetGroupRuleExample
    {
        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 GroupApi(config);
            var groupRuleId = 0pr3f7zMZZHPgUoWO0g4;  // string | The `id` of the group rule
            var expand = "expand_example";  // string |  (optional) 

            try
            {
                // Retrieve a Group Rule
                GroupRule result = apiInstance.GetGroupRule(groupRuleId, expand);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.GetGroupRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
groupRuleId string The `id` of the group rule
expand string [optional]

Return type

GroupRule

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]

ListAssignedApplicationsForGroup

List<Application> ListAssignedApplicationsForGroup (string groupId, string after = null, int? limit = null)

List all Assigned Applications

Lists all applications that are assigned to a group

Example

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

namespace Example
{
    public class ListAssignedApplicationsForGroupExample
    {
        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 GroupApi(config);
            var groupId = 00g1emaKYZTWRYYRRTSK;  // string | The `id` of the group
            var after = "after_example";  // string | Specifies the pagination cursor for the next page of apps (optional) 
            var limit = 20;  // int? | Specifies the number of app results for a page (optional)  (default to 20)

            try
            {
                // List all Assigned Applications
                List<Application> result = apiInstance.ListAssignedApplicationsForGroup(groupId, after, limit).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.ListAssignedApplicationsForGroup: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
groupId string The `id` of the group
after string Specifies the pagination cursor for the next page of apps [optional]
limit int? Specifies the number of app results for a page [optional] [default to 20]

Return type

List<Application>

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]

ListGroupRules

List<GroupRule> ListGroupRules (int? limit = null, string after = null, string search = null, string expand = null)

List all Group Rules

Lists all group rules

Example

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

namespace Example
{
    public class ListGroupRulesExample
    {
        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 GroupApi(config);
            var limit = 50;  // int? | Specifies the number of rule results in a page (optional)  (default to 50)
            var after = "after_example";  // string | Specifies the pagination cursor for the next page of rules (optional) 
            var search = "search_example";  // string | Specifies the keyword to search fules for (optional) 
            var expand = "expand_example";  // string | If specified as `groupIdToGroupNameMap`, then show group names (optional) 

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

Parameters

Name Type Description Notes
limit int? Specifies the number of rule results in a page [optional] [default to 50]
after string Specifies the pagination cursor for the next page of rules [optional]
search string Specifies the keyword to search fules for [optional]
expand string If specified as `groupIdToGroupNameMap`, then show group names [optional]

Return type

List<GroupRule>

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]

ListGroupUsers

List<GroupMember> ListGroupUsers (string groupId, string search = null, string sortBy = null, string sortOrder = null, string after = null, int? limit = null)

List all Member Users

Lists all users that are a member of a group

Example

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

namespace Example
{
    public class ListGroupUsersExample
    {
        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 GroupApi(config);
            var groupId = 00g1emaKYZTWRYYRRTSK;  // string | The `id` of the group
            var search = "search_example";  // string | Searches for users with a supported filtering expression for user name, primary email, or user name (optional) 
            var sortBy = id;  // string | Specifies which field to sort by. This can be any single property. (optional) 
            var sortOrder = "\"asc\"";  // string | Specifies sort order: `asc` or `desc`. This parameter is ignored if `sortBy` is not present. Users with the same value for the `sortBy` parameter are ordered by `id`. (optional)  (default to "asc")
            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 limit = 1000;  // int? | Specifies the number of user results in a page (optional)  (default to 1000)

            try
            {
                // List all Member Users
                List<GroupMember> result = apiInstance.ListGroupUsers(groupId, search, sortBy, sortOrder, after, limit).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.ListGroupUsers: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
groupId string The `id` of the group
search string Searches for users with a supported filtering expression for user name, primary email, or user name [optional]
sortBy string Specifies which field to sort by. This can be any single property. [optional]
sortOrder string Specifies sort order: `asc` or `desc`. This parameter is ignored if `sortBy` is not present. Users with the same value for the `sortBy` parameter are ordered by `id`. [optional] [default to "asc"]
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]
limit int? Specifies the number of user results in a page [optional] [default to 1000]

Return type

List<GroupMember>

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]

ListGroups

List<Group> ListGroups (string q = null, string filter = null, string after = null, int? limit = null, string expand = null, string search = null, string sortBy = null, string sortOrder = null)

List all Groups

Lists all groups with pagination support. A subset of groups can be returned that match a supported filter expression or query.

Example

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

namespace Example
{
    public class ListGroupsExample
    {
        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 GroupApi(config);
            var q = "q_example";  // string | Searches the name property of groups for matching value (optional) 
            var filter = "filter_example";  // string | Filter expression for groups (optional) 
            var after = "after_example";  // string | Specifies the pagination cursor for the next page of groups (optional) 
            var limit = 10000;  // int? | Specifies the number of group results in a page (optional)  (default to 10000)
            var expand = "expand_example";  // string | If specified, it causes additional metadata to be included in the response. (optional) 
            var search = "search_example";  // string | Searches for groups with a supported filtering expression for all attributes except for _embedded, _links, and objectClass (optional) 
            var sortBy = lastUpdated;  // 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` is not present. Groups with the same value for the `sortBy` parameter are ordered by `id`. (optional)  (default to "asc")

            try
            {
                // List all Groups
                List<Group> result = apiInstance.ListGroups(q, filter, after, limit, expand, search, sortBy, sortOrder).ToListAsync();
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.ListGroups: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
q string Searches the name property of groups for matching value [optional]
filter string Filter expression for groups [optional]
after string Specifies the pagination cursor for the next page of groups [optional]
limit int? Specifies the number of group results in a page [optional] [default to 10000]
expand string If specified, it causes additional metadata to be included in the response. [optional]
search string Searches for groups with a supported filtering expression for all attributes except for _embedded, _links, and objectClass [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` is not present. Groups with the same value for the `sortBy` parameter are ordered by `id`. [optional] [default to "asc"]

Return type

List<Group>

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]

ReplaceGroup

Group ReplaceGroup (string groupId, Group group)

Replace a Group

Replaces the profile for a group with OKTA_GROUP type

Example

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

namespace Example
{
    public class ReplaceGroupExample
    {
        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 GroupApi(config);
            var groupId = 00g1emaKYZTWRYYRRTSK;  // string | The `id` of the group
            var group = new Group(); // Group | 

            try
            {
                // Replace a Group
                Group result = apiInstance.ReplaceGroup(groupId, group);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.ReplaceGroup: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
groupId string The `id` of the group
group Group

Return type

Group

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]

ReplaceGroupRule

GroupRule ReplaceGroupRule (string groupRuleId, GroupRule groupRule)

Replace a Group Rule

Replaces a group rule. Only INACTIVE rules can be updated.

Example

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

namespace Example
{
    public class ReplaceGroupRuleExample
    {
        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 GroupApi(config);
            var groupRuleId = 0pr3f7zMZZHPgUoWO0g4;  // string | The `id` of the group rule
            var groupRule = new GroupRule(); // GroupRule | 

            try
            {
                // Replace a Group Rule
                GroupRule result = apiInstance.ReplaceGroupRule(groupRuleId, groupRule);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.ReplaceGroupRule: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
groupRuleId string The `id` of the group rule
groupRule GroupRule

Return type

GroupRule

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]

UnassignUserFromGroup

void UnassignUserFromGroup (string groupId, string userId)

Unassign a User

Unassigns a user from a group with 'OKTA_GROUP' type

Example

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

namespace Example
{
    public class UnassignUserFromGroupExample
    {
        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 GroupApi(config);
            var groupId = 00g1emaKYZTWRYYRRTSK;  // string | The `id` of the group
            var userId = "userId_example";  // string | ID of an existing Okta user

            try
            {
                // Unassign a User
                apiInstance.UnassignUserFromGroup(groupId, userId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling GroupApi.UnassignUserFromGroup: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
groupId string The `id` of the group
userId string ID of an existing Okta user

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]