OpenXchangeClient.Api.OAuth (open_xchange_client v0.10.1)

API calls for all endpoints tagged OAuth.

Link to this section Summary

Functions

Creates an OAuth account. This action is typically called by provided call-back URL and is only intended for manual invocation if "outOfBand" interaction is returned by preceeding /oauth/account?action=init step.

Gets all OAuth services' meta data.

Gets all OAuth service's meta data.

Link to this section Functions

Link to this function

create_o_auth_account(connection, session, oauth_token, uuid, display_name, scopes, opts \\ [])

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

Creates an OAuth account. This action is typically called by provided call-back URL and is only intended for manual invocation if "outOfBand" interaction is returned by preceeding /oauth/account?action=init step.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • oauth_token (String.t): The request token from preceeding OAuth interaction.
  • uuid (String.t): The UUID of the preceeding OAuth interaction.
  • display_name (String.t): The display name for the new account.
  • scopes (String.t): A space-separated list of scopes to be added. Valid scopes are 'calendar', 'contacts', 'mail', 'drive', 'generic'. Note that not all scopes are applicable to every OAuth provider.
  • opts (KeywordList): [optional] Optional parameters
    • :oauth_verifier (String.t): The verifier string which confirms that user granted access.

returns

Returns

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

Link to this function

delete_o_auth_account(connection, session, id, opts \\ [])

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

Deletes an OAuth account.

parameters

Parameters

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

returns

Returns

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

Link to this function

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

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

Gets all OAuth accounts.

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
    • :service_id (String.t): The service meta data identifier. If missing all accounts of all services are returned; otherwise all accounts of specified service are returned.

returns

Returns

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

Link to this function

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

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

Gets all OAuth grants.

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

returns

Returns

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

Link to this function

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

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

Gets all OAuth services' meta data.

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

returns

Returns

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

Link to this function

get_o_auth_account(connection, session, id, opts \\ [])

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

Gets an OAuth account.

parameters

Parameters

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

returns

Returns

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

Link to this function

get_o_auth_service(connection, session, id, opts \\ [])

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

Gets all OAuth service's meta data.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (String.t): The service's identifier.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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

Link to this function

init_o_auth_account(connection, session, service_id, display_name, scopes, opts \\ [])

Initializes the creation of an OAuth account.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • service_id (String.t): The service meta data identifier, e.g. "com.openexchange.oauth.twitter".
  • display_name (String.t): The display name of the account.
  • scopes (String.t): A space-separated list of scopes to be added. Valid scopes are 'calendar', 'contacts', 'mail', 'drive', 'generic'. Note that not all scopes are applicable to every OAuth provider.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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

Link to this function

reauthorize_o_auth_account(connection, session, id, service_id, scopes, opts \\ [])

@spec reauthorize_o_auth_account(
  Tesla.Env.client(),
  String.t(),
  integer(),
  String.t(),
  String.t(),
  keyword()
) :: {:ok, nil} | {:error, Tesla.Env.t()}

Reauthorises the specified OAuth account

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (integer()): The account identifier. May also be provided in request body's JSON object by field id.
  • service_id (String.t): The service meta data identifier, e.g. "com.openexchange.oauth.twitter".
  • scopes (String.t): A space-separated list of scopes to be added. Valid scopes are 'calendar', 'contacts', 'mail', 'drive', 'generic'. Note that not all scopes are applicable to every OAuth provider.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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

Link to this function

revoke_o_auth_grant(connection, session, client, opts \\ [])

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

Revokes access for an OAuth client.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • client (String.t): The ID of the client whose access shall be revoked.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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

Link to this function

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

Updates an OAuth account.

parameters

Parameters

  • connection (OpenXchangeClient.Connection): Connection to server
  • session (String.t): A session ID previously obtained from the login module.
  • id (integer()): The account identifier. May also be provided in request body's JSON object by field id.
  • body (OAuthAccountData): A JSON object providing the OAuth account data to update. Currently the only values which make sense being updated are displayName and the token-secret-pair.
  • opts (KeywordList): [optional] Optional parameters

returns

Returns

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