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.
Deletes an OAuth account.
Gets all OAuth accounts.
Gets all OAuth grants.
Gets all OAuth services' meta data.
Gets an OAuth account.
Gets all OAuth service's meta data.
Initializes the creation of an OAuth account.
Reauthorises the specified OAuth account
Revokes access for an OAuth client.
Updates an OAuth account.
Link to this section Functions
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
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
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
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
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
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
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
init_o_auth_account(connection, session, service_id, display_name, scopes, opts \\ [])
@spec init_o_auth_account( Tesla.Env.client(), String.t(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, OpenXchangeClient.Model.OAuthAccountInteractionResponse.t()} | {:error, Tesla.Env.t()}
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
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
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
update_o_auth_account(connection, session, id, body, opts \\ [])
@spec update_o_auth_account( Tesla.Env.client(), String.t(), integer(), OpenXchangeClient.Model.OAuthAccountData.t(), keyword() ) :: {:ok, OpenXchangeClient.Model.OAuthAccountUpdateResponse.t()} | {:error, Tesla.Env.t()}
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 thetoken
-secret
-pair. - opts (KeywordList): [optional] Optional parameters
returns
Returns
on success {:error, Tesla.Env.t} on failure