OpenXchangeClient.Api.User (open_xchange_client v0.10.1)

API calls for all endpoints tagged User.

Link to this section Summary

Functions

Gets a user attribute. Gets a custom user attribute that was previously set with the /user?action=setAttribute request.

Sets a user attribute. Sets a custom user attribute consisting of a name and a value. The attribute can later be retrieved using the /user?action=getAttribute request.

Link to this section Functions

Link to this function

get_all_users(connection, session, columns, opts \\ [])

@spec get_all_users(Tesla.Env.client(), String.t(), String.t(), keyword()) ::
  {:ok, OpenXchangeClient.Model.UsersResponse.t()} | {:error, Tesla.Env.t()}

Gets all users.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • columns (String.t): A comma-separated list of columns to return, like "1,501,610". Each column is specified by a numeric column identifier, see Common object data, Detailed contact data and Detailed user data.
  • opts (KeywordList): [optional] Optional parameters
    • :sort (String.t): The identifier of a column which determines the sort order of the response. If this parameter is specified, then the parameter order must be also specified.
    • :order (String.t): "asc" if the response entities should be sorted in the ascending order, "desc" if the response entries should be sorted in the descending order. If this parameter is specified, then the parameter sort must be also specified.

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

get_user(connection, session, opts \\ [])

@spec get_user(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, OpenXchangeClient.Model.UserResponse.t()} | {:error, Tesla.Env.t()}

Gets a user.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • opts (KeywordList): [optional] Optional parameters
    • :id (String.t): Object ID of the requested user. This parameter is optional and the default is the currently logged in user.

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

get_user_attribute(connection, session, id, name, opts \\ [])

@spec get_user_attribute(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, OpenXchangeClient.Model.UserAttributeResponse.t()}
  | {:error, Tesla.Env.t()}

Gets a user attribute. Gets a custom user attribute that was previously set with the /user?action=setAttribute request.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the user.
  • name (String.t): The name of the attribute.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

get_user_list(connection, session, columns, body, opts \\ [])

@spec get_user_list(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  [String.t()],
  keyword()
) ::
  {:ok, OpenXchangeClient.Model.UsersResponse.t()} | {:error, Tesla.Env.t()}

Gets a list of users.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • columns (String.t): A comma-separated list of columns to return, like "1,501,610". Each column is specified by a numeric column identifier, see Common object data, Detailed contact data and Detailed user data.
  • body ([String.t]): A JSON array of identifiers of the requested users. A null value in the array is interpreted as the currently logged in user.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

search_users(connection, session, columns, body, opts \\ [])

Search for users.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • columns (String.t): A comma-separated list of columns to return, like "1,501,610". Each column is specified by a numeric column identifier, see Common object data, Detailed contact data and Detailed user data.
  • body (UserSearchBody): A JSON object containing search parameters.
  • opts (KeywordList): [optional] Optional parameters
    • :sort (String.t): The identifier of a column which determines the sort order of the response. If this parameter is specified , then the parameter order must be also specified.
    • :order (String.t): "asc" if the response entires should be sorted in the ascending order, "desc" if the response entries should be sorted in the descending order. If this parameter is specified, then the parameter sort must be also specified.

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

set_user_attribute(connection, session, id, body, opts \\ [])

Sets a user attribute. Sets a custom user attribute consisting of a name and a value. The attribute can later be retrieved using the /user?action=getAttribute request.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The ID of the user.
  • body (UserAttribute): A JSON object providing the name and the value of the attribute. If the value field is missing or null, the attribute is removed.
  • opts (KeywordList): [optional] Optional parameters
    • :set_if_absent (boolean()): Set to true to put the value only if the specified name is not already associated with a value, otherwise false to put value in any case.

returns

Returns

on success {:error, Tesla.Env.t} on failure

Link to this function

update_user(connection, session, id, timestamp, body, opts \\ [])

Updates a user.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): Object ID of the requested user.
  • timestamp (integer()): Timestamp of the last update of the requested user. If the user was modified after the specified timestamp, then the update must fail.
  • body (UserData): A JSON object containing the user's data. Only modified fields are present. From Detailed user data only the fields timezone and locale are allowed to be updated.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

on success {:error, Tesla.Env.t} on failure