Skip to content

odm_api.UsersApi

All URIs are relative to http://localhost

Method HTTP request Description
create_user POST /api/v1/scim/Users Add a new user
delete_user DELETE /api/v1/scim/Users/{id} Deactivate a user
find_users GET /api/v1/scim/Users Retrieve a list of all active users
get_user GET /api/v1/scim/Users/{id} Retrieve a user by id
patch_user PATCH /api/v1/scim/Users/{id} Update a user

create_user

CreateUser201Response create_user(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

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.create_user201_response import CreateUser201Response
from odm_api.models.create_user_request import CreateUserRequest
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.UsersApi(api_client)
    body = odm_api.CreateUserRequest() # CreateUserRequest | 

    try:
        # Add a new user
        api_response = api_instance.create_user(body)
        print("The response of UsersApi->create_user:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->create_user: %s\n" % e)

Parameters

Name Type Description Notes
body CreateUserRequest

Return type

CreateUser201Response

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

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

delete_user

delete_user(id)

Deactivate a user

Example

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.UsersApi(api_client)
    id = 'id_example' # str | String, unique identifier of the user in ODM.

    try:
        # Deactivate a user
        api_instance.delete_user(id)
    except Exception as e:
        print("Exception when calling UsersApi->delete_user: %s\n" % e)

Parameters

Name Type Description Notes
id str 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. -

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

find_users

FilterUsersResponse find_users(filter=filter, start_index=start_index, count=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

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.filter_users_response import FilterUsersResponse
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.UsersApi(api_client)
    filter = 'filter_example' # str | 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 = 56 # int | The 1-based index of the first result in the current set of list results. (optional)
    count = 56 # int | The number of resources returned in a list response page. The value by default is 100. (optional)

    try:
        # Retrieve a list of all active users
        api_response = api_instance.find_users(filter=filter, start_index=start_index, count=count)
        print("The response of UsersApi->find_users:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->find_users: %s\n" % e)

Parameters

Name Type Description Notes
filter str 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 int The 1-based index of the first result in the current set of list results. [optional]
count int The number of resources returned in a list response page. The value by default is 100. [optional]

Return type

FilterUsersResponse

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

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

get_user

CreateUser201Response get_user(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

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.create_user201_response import CreateUser201Response
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.UsersApi(api_client)
    id = 'id_example' # str | String, unique identifier of the user in ODM.

    try:
        # Retrieve a user by id
        api_response = api_instance.get_user(id)
        print("The response of UsersApi->get_user:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->get_user: %s\n" % e)

Parameters

Name Type Description Notes
id str String, unique identifier of the user in ODM.

Return type

CreateUser201Response

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

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

patch_user

CreateUser201Response patch_user(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

  • Api Key Authentication (Access-token):
  • Api Key Authentication (Genestack-API-Token):
import odm_api
from odm_api.models.create_user201_response import CreateUser201Response
from odm_api.models.user_patch import UserPatch
from odm_api.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = odm_api.Configuration(
    host = "http://localhost"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure API key authorization: Access-token
configuration.api_key['Access-token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Access-token'] = 'Bearer'

# Configure API key authorization: Genestack-API-Token
configuration.api_key['Genestack-API-Token'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Genestack-API-Token'] = 'Bearer'

# Enter a context with an instance of the API client
with odm_api.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = odm_api.UsersApi(api_client)
    id = 'id_example' # str | String, unique identifier of the user in ODM.
    body = odm_api.UserPatch() # UserPatch | 

    try:
        # Update a user
        api_response = api_instance.patch_user(id, body)
        print("The response of UsersApi->patch_user:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->patch_user: %s\n" % e)

Parameters

Name Type Description Notes
id str String, unique identifier of the user in ODM.
body UserPatch

Return type

CreateUser201Response

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

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