All URIs are relative to https://your-api-subdomain.onelogin.com
Method | HTTP request | Description |
---|---|---|
addPrivilegeToRole | POST /api/1/privileges/{privilege_id}/roles | Assign a Privilege to Roles |
assignUsersToPrivilege | POST /api/1/privileges/{privilege_id}/users | Assign Users to a Privilege |
createPrivilege | POST /api/1/privileges | Create a Privilege |
deletePrivilege | DELETE /api/1/privileges/{privilege_id} | Delete a Privilege |
deleteRoleFromPrivilege | DELETE /api/1/privileges/{privilege_id}/roles/{role_id} | Remove a Privilege from a Role |
getAssignedUser | GET /api/1/privileges/{privilege_id}/users | Get Users assigned to a Privilege |
getPrivilege | GET /api/1/privileges/{privilege_id} | Get a Privilege |
listPrivilegeRoles | GET /api/1/privileges/{privilege_id}/roles | Get Roles assigned to Privilege |
listPrivileges | GET /api/1/privileges | List Privileges |
removeUserFromPrivilege | DELETE /api/1/privileges/{privilege_id}/users/{user_id} | Remove a Privilege from Users |
updatePrivilege | PUT /api/1/privileges/{privilege_id} | Update a Privilege |
AddPrivilegeToRole201Response addPrivilegeToRole(privilegeId, addPrivilegeToRoleRequest)
Assign a Privilege to Roles
Add roles to privilege
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.PrivilegesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
PrivilegesApi apiInstance = new PrivilegesApi(defaultClient);
String privilegeId = "privilegeId_example"; // String |
AddPrivilegeToRoleRequest addPrivilegeToRoleRequest = new AddPrivilegeToRoleRequest(); // AddPrivilegeToRoleRequest |
try {
AddPrivilegeToRole201Response result = apiInstance.addPrivilegeToRole(privilegeId, addPrivilegeToRoleRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PrivilegesApi#addPrivilegeToRole");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
privilegeId | String | ||
addPrivilegeToRoleRequest | AddPrivilegeToRoleRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
400 | Bad Request | - |
401 | Unauthorized | - |
AddPrivilegeToRole201Response assignUsersToPrivilege(privilegeId, assignUsersToPrivilegeRequest)
Assign Users to a Privilege
Assign Users to Privilege
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.PrivilegesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
PrivilegesApi apiInstance = new PrivilegesApi(defaultClient);
String privilegeId = "privilegeId_example"; // String |
AssignUsersToPrivilegeRequest assignUsersToPrivilegeRequest = new AssignUsersToPrivilegeRequest(); // AssignUsersToPrivilegeRequest |
try {
AddPrivilegeToRole201Response result = apiInstance.assignUsersToPrivilege(privilegeId, assignUsersToPrivilegeRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PrivilegesApi#assignUsersToPrivilege");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
privilegeId | String | ||
assignUsersToPrivilegeRequest | AssignUsersToPrivilegeRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
400 | Bad Request | - |
401 | Unauthorized | - |
Privilege createPrivilege(privilege)
Create a Privilege
Create privilege
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.PrivilegesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
PrivilegesApi apiInstance = new PrivilegesApi(defaultClient);
Privilege privilege = new Privilege(); // Privilege |
try {
Privilege result = apiInstance.createPrivilege(privilege);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PrivilegesApi#createPrivilege");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
privilege | Privilege | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
400 | Bad Request | - |
401 | Unauthorized | - |
deletePrivilege(privilegeId)
Delete a Privilege
Delete
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.PrivilegesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
PrivilegesApi apiInstance = new PrivilegesApi(defaultClient);
String privilegeId = "privilegeId_example"; // String |
try {
apiInstance.deletePrivilege(privilegeId);
} catch (ApiException e) {
System.err.println("Exception when calling PrivilegesApi#deletePrivilege");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
privilegeId | String |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
401 | Unauthorized | - |
404 | Not Found | - |
deleteRoleFromPrivilege(privilegeId, roleId)
Remove a Privilege from a Role
Add roles to privilege
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.PrivilegesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
PrivilegesApi apiInstance = new PrivilegesApi(defaultClient);
String privilegeId = "privilegeId_example"; // String |
String roleId = "roleId_example"; // String | Set to the id of the role you want to return.
try {
apiInstance.deleteRoleFromPrivilege(privilegeId, roleId);
} catch (ApiException e) {
System.err.println("Exception when calling PrivilegesApi#deleteRoleFromPrivilege");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
privilegeId | String | ||
roleId | String | Set to the id of the role you want to return. |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
401 | Unauthorized | - |
404 | Not Found | - |
GetAssignedUser200Response getAssignedUser(privilegeId)
Get Users assigned to a Privilege
Get Assigned Users
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.PrivilegesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
PrivilegesApi apiInstance = new PrivilegesApi(defaultClient);
String privilegeId = "privilegeId_example"; // String |
try {
GetAssignedUser200Response result = apiInstance.getAssignedUser(privilegeId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PrivilegesApi#getAssignedUser");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
privilegeId | String |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
401 | Unauthorized | - |
404 | Not Found | - |
Privilege getPrivilege(privilegeId)
Get a Privilege
Get a Privilige
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.PrivilegesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
PrivilegesApi apiInstance = new PrivilegesApi(defaultClient);
String privilegeId = "privilegeId_example"; // String |
try {
Privilege result = apiInstance.getPrivilege(privilegeId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PrivilegesApi#getPrivilege");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
privilegeId | String |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
401 | Unauthorized | - |
404 | Not Found | - |
ListPrivilegeRoles200Response listPrivilegeRoles(privilegeId)
Get Roles assigned to Privilege
List roles for privilege
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.PrivilegesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
PrivilegesApi apiInstance = new PrivilegesApi(defaultClient);
String privilegeId = "privilegeId_example"; // String |
try {
ListPrivilegeRoles200Response result = apiInstance.listPrivilegeRoles(privilegeId);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PrivilegesApi#listPrivilegeRoles");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
privilegeId | String |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
401 | Unauthorized | - |
404 | Not Found | - |
List<Privilege> listPrivileges()
List Privileges
List Privileges
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.PrivilegesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
PrivilegesApi apiInstance = new PrivilegesApi(defaultClient);
try {
List<Privilege> result = apiInstance.listPrivileges();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PrivilegesApi#listPrivileges");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
401 | Unauthorized | - |
removeUserFromPrivilege(privilegeId, userId)
Remove a Privilege from Users
Remove a Privilege from Users
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.PrivilegesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
PrivilegesApi apiInstance = new PrivilegesApi(defaultClient);
String privilegeId = "privilegeId_example"; // String |
Integer userId = 56; // Integer | Set to the id of the user that you want to return.
try {
apiInstance.removeUserFromPrivilege(privilegeId, userId);
} catch (ApiException e) {
System.err.println("Exception when calling PrivilegesApi#removeUserFromPrivilege");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
privilegeId | String | ||
userId | Integer | Set to the id of the user that you want to return. |
null (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
401 | Unauthorized | - |
404 | Not Found | - |
UpdatePrivilege200Response updatePrivilege(privilegeId, privilege)
Update a Privilege
Update privilege
// Import classes:
import com.onelogin.client.ApiClient;
import com.onelogin.client.ApiException;
import com.onelogin.client.Configuration;
import com.onelogin.client.auth.*;
import com.onelogin.client.models.*;
import com.onelogin.client.api.PrivilegesApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://your-api-subdomain.onelogin.com");
// Configure OAuth2 access token for authorization: OAuth2
OAuth OAuth2 = (OAuth) defaultClient.getAuthentication("OAuth2");
OAuth2.setAccessToken("YOUR ACCESS TOKEN");
PrivilegesApi apiInstance = new PrivilegesApi(defaultClient);
String privilegeId = "privilegeId_example"; // String |
Privilege privilege = new Privilege(); // Privilege |
try {
UpdatePrivilege200Response result = apiInstance.updatePrivilege(privilegeId, privilege);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling PrivilegesApi#updatePrivilege");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
privilegeId | String | ||
privilege | Privilege | [optional] |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful response | - |
400 | Bad Request | - |
401 | Unauthorized | - |