UsersApi¶
All URIs are relative to http://localhost
| Method | HTTP request | Description |
|---|---|---|
| CreateUser | POST /api/v1/scim/Users | Add a new user |
| DeleteUser | DELETE /api/v1/scim/Users/{id} | Deactivate a user |
| FindUsers | GET /api/v1/scim/Users | Retrieve a list of all active users |
| GetUser | GET /api/v1/scim/Users/{id} | Retrieve a user by id |
| PatchUser | PATCH /api/v1/scim/Users/{id} | Update a user |
CreateUser¶
CreateUser201Response CreateUser(body)
Add a new user
The endpoint creates a new user in ODM or updates the existing user. A user can be updated by this endpoint if the user has the same login as in the request body. The \"Manage organization\" permission is required. The endpoint does not allow to specify the user's password and user permissions, these parameters can be set in the web application by a user with the \"Manage organization\" permission. Only one email can be specified.
Example¶
library(odmApi)
# Add a new user
#
# prepare function argument(s)
var_body <- createUser_request$new("active_example", c(createUser_request_emails_inner$new("work", "value_example", "primary_example")), "displayName_example", "externalId_example", "id_example", c("urn:ietf:params:scim:schemas:core:2.0:User"), "userName_example") # CreateUserRequest |
api_instance <- UsersApi$new()
# Configure API key authorization: Access-token
api_instance$api_client$api_keys["Authorization"] <- Sys.getenv("API_KEY")
# Configure API key authorization: Genestack-API-Token
# api_instance$api_client$api_keys["Genestack-API-Token"] <- Sys.getenv("API_KEY")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$CreateUser(var_bodydata_file = "result.txt")
result <- api_instance$CreateUser(var_body)
dput(result)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| body | CreateUserRequest |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: application/json
- Accept: application/scim+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 201 | The operation is successful. The response body contains the representation of the newly created or updated user. | - |
| 400 | The object cannot be created, the supplied data or metadata are incorrect. See the error message for details. | - |
| 401 | User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). | - |
| 403 | Operation is not permitted. The \"Manage organization\" permission is required. | - |
| 409 | The object cannot be created, data conflict. See the error message for details. | - |
| 500 | An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. | - |
DeleteUser¶
DeleteUser(id)
Deactivate a user
Example¶
library(odmApi)
# Deactivate a user
#
# prepare function argument(s)
var_id <- "id_example" # character | String, unique identifier of the user in ODM.
api_instance <- UsersApi$new()
# Configure API key authorization: Access-token
api_instance$api_client$api_keys["Authorization"] <- Sys.getenv("API_KEY")
# Configure API key authorization: Genestack-API-Token
# api_instance$api_client$api_keys["Genestack-API-Token"] <- Sys.getenv("API_KEY")
api_instance$DeleteUser(var_id)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | character | String, unique identifier of the user in ODM. |
Return type¶
void (empty response body)
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: Not defined
- Accept: application/scim+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 204 | The user has been successfully deactivated. No data is returned. | - |
| 400 | The supplied user ID is invalid. | - |
| 401 | User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). | - |
| 403 | Operation is not permitted. The \"Manage organization\" permission is required. | - |
| 404 | There are no users with the specified id. | - |
| 500 | An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. | - |
FindUsers¶
FilterUsersResponse FindUsers(filter = var.filter, start_index = var.start_index, count = var.count)
Retrieve a list of all active users
The endpoint returns a list of active users. The list can be filtered by user attributes using the filter parameter. If no filtering parameters are passed, then all users are returned. If there are no users in the response body, the endpoint returns 200 OK. The \"Manage organization\" permission is required.
Example¶
library(odmApi)
# Retrieve a list of all active users
#
# prepare function argument(s)
var_filter <- "filter_example" # character | Filter by user attributes. The parameter name is case-sensitive, therefore parameters FILTER, fiLter, and other options are ignored. Supported operators: eq - equal, the attribute and operator values must be identical for a match; and - logical \"and\", the filter is only a match if both expressions evaluate to true; Using other operators returns an error. Attribute names and attribute operators used in filters are case insensitive. Examples of the request: filter=emails[type eq \"work\" and value eq \"user@example.com\"] - returns a user with login = user@example.com filter=userName eq \"bjensen\" filter=emails[type eq \"work\" and value eq \"user@example.com\"] and userName eq \"bjensen\". (Optional)
var_start_index <- 56 # integer | The 1-based index of the first result in the current set of list results. (Optional)
var_count <- 56 # integer | The number of resources returned in a list response page. The value by default is 100. (Optional)
api_instance <- UsersApi$new()
# Configure API key authorization: Access-token
api_instance$api_client$api_keys["Authorization"] <- Sys.getenv("API_KEY")
# Configure API key authorization: Genestack-API-Token
# api_instance$api_client$api_keys["Genestack-API-Token"] <- Sys.getenv("API_KEY")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$FindUsers(filter = var_filter, start_index = var_start_index, count = var_countdata_file = "result.txt")
result <- api_instance$FindUsers(filter = var_filter, start_index = var_start_index, count = var_count)
dput(result)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| filter | character | Filter by user attributes. The parameter name is case-sensitive, therefore parameters FILTER, fiLter, and other options are ignored. Supported operators: eq - equal, the attribute and operator values must be identical for a match; and - logical \"and\", the filter is only a match if both expressions evaluate to true; Using other operators returns an error. Attribute names and attribute operators used in filters are case insensitive. Examples of the request: filter=emails[type eq \"work\" and value eq \"user@example.com\"] - returns a user with login = user@example.com filter=userName eq \"bjensen\" filter=emails[type eq \"work\" and value eq \"user@example.com\"] and userName eq \"bjensen\". | [optional] |
| start_index | integer | The 1-based index of the first result in the current set of list results. | [optional] |
| count | integer | The number of resources returned in a list response page. The value by default is 100. | [optional] |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: Not defined
- Accept: application/scim+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | The request was successful. | - |
| 400 | Incorrect syntax in the request. See the error message for details. | - |
| 401 | User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). | - |
| 403 | Operation is not permitted. The \"Manage organization\" permission is required. | - |
| 500 | An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. | - |
GetUser¶
CreateUser201Response GetUser(id)
Retrieve a user by id
The endpoint returns an active user by id, where id is internal user id in ODM. The \"Manage organization\" permission is required.
Example¶
library(odmApi)
# Retrieve a user by id
#
# prepare function argument(s)
var_id <- "id_example" # character | String, unique identifier of the user in ODM.
api_instance <- UsersApi$new()
# Configure API key authorization: Access-token
api_instance$api_client$api_keys["Authorization"] <- Sys.getenv("API_KEY")
# Configure API key authorization: Genestack-API-Token
# api_instance$api_client$api_keys["Genestack-API-Token"] <- Sys.getenv("API_KEY")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$GetUser(var_iddata_file = "result.txt")
result <- api_instance$GetUser(var_id)
dput(result)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | character | String, unique identifier of the user in ODM. |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: Not defined
- Accept: application/scim+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | The request was successful. | - |
| 400 | The supplied user ID is invalid. | - |
| 401 | User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). | - |
| 403 | Operation is not permitted. The \"Manage organization\" permission is required. | - |
| 404 | There are no available users with the specified id. | - |
| 500 | An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. | - |
PatchUser¶
CreateUser201Response PatchUser(id, body)
Update a user
The endpoint updates one or several attributes of a specific user, where id is internal user id in ODM. Supported operators in the request body: replace, add, remove. For details of the syntax of using these operators, we recommend that you refer to the SCIM 2.0 specification. The list of user attributes that can be edited: userName, externalId, displayName, active. If the user tries to edit other attributes, e.g. id, an error is returned. If the user tries to edit attributes that are not supported in the ODM user scheme, e.g. name name.familyName, this attribute is ignored. If the request body includes only attributes that are not supported by ODM, the endpoint returns 200 OK. A PATCH request, regardless of the number of operations, is treated as atomic. If a single operation encounters an error condition, the original user attributes are restored, and a failure status is returned. It is possible to update attributes of the deactivated users. The endpoint requires the \"Manage organization\" permission.
Example¶
library(odmApi)
# Update a user
#
# prepare function argument(s)
var_id <- "id_example" # character | String, unique identifier of the user in ODM.
var_body <- UserPatch$new(c(GroupPatch_Operations_inner$new("add", "path_example", 123)), c("urn:ietf:params:scim:api:messages:2.0:PatchOp")) # UserPatch |
api_instance <- UsersApi$new()
# Configure API key authorization: Access-token
api_instance$api_client$api_keys["Authorization"] <- Sys.getenv("API_KEY")
# Configure API key authorization: Genestack-API-Token
# api_instance$api_client$api_keys["Genestack-API-Token"] <- Sys.getenv("API_KEY")
# to save the result into a file, simply add the optional `data_file` parameter, e.g.
# result <- api_instance$PatchUser(var_id, var_bodydata_file = "result.txt")
result <- api_instance$PatchUser(var_id, var_body)
dput(result)
Parameters¶
| Name | Type | Description | Notes |
|---|---|---|---|
| id | character | String, unique identifier of the user in ODM. | |
| body | UserPatch |
Return type¶
Authorization¶
Access-token, Genestack-API-Token
HTTP request headers¶
- Content-Type: application/json
- Accept: application/scim+json
HTTP response details¶
| Status code | Description | Response headers |
|---|---|---|
| 200 | User is successfully updated. The response body contains the representation of the updated user. | - |
| 400 | The object cannot be updated, the supplied data or metadata are incorrect. See the error message for details. | - |
| 401 | User is not authenticated. Please supply a valid Access Token in the `Authorization` HTTP header (e.g. Authorization: bearer [token]) or Genestack API token in the `Genestack-API-Token` header (this token may be obtained from the Genestack UI Profile page). | - |
| 403 | Operation is not permitted. The \"Manage organization\" permission is required. | - |
| 404 | There are no users with the specified id. | - |
| 500 | An internal server error occurred. This indicates an unexpected failure in the Genestack system, please file a bug report to support@genestack.com, including the error details. | - |