OpenXchangeClient.Api.Messaging (open_xchange_client v0.10.0)
API calls for all endpoints tagged Messaging
.
Link to this section Summary
Functions
Creates a messaging account.
Deletes a messaging account.
Gets all messaging accounts.
Gets all messaging messages.
Gets all messaging services.
Gets a messaging account.
Gets a messaging message.
A messaging message consists of some metadata, headers and a content. The content attribute varies by the content-type header. If the content-type is text/*
it is a string, if it is multipart/*
it is an array of objects, each representing a part of the multipart. If it is anything else it is considered binary and is a Base64 encoded string. The folder ID of a message follows a predefined format: [messagingService]://[accountId]/[path]
, like com.openexchange.messaging.twitter://535/defaultTimeline/directMessages
.
Gets a list of messaging messages.
Gets a messaging service.
Performs a certain messaging action on a message. On actions of type "message" the body should contain the JSON representation of the message the action should be applied to. To invoke a messaging action of type "storage" the folder and id are needed in URL parameters. Messaging actions of type "none" need a messaging message and account.
Sends a messaging message.
Updates a messaging account.
Link to this section Functions
create_messaging_account(connection, session, body, opts \\ [])
@spec create_messaging_account( Tesla.Env.client(), String.t(), OpenXchangeClient.Model.MessagingAccountData.t(), keyword() ) :: {:ok, OpenXchangeClient.Model.MessagingAccountUpdateResponse.t()} | {:error, Tesla.Env.t()}
Creates a messaging account.
parameters
Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- body (MessagingAccountData): A JSON object describing the account to create. The ID is generated by the server and must not be present.
- opts (KeywordList): [optional] Optional parameters
returns
Returns
on success {:error, Tesla.Env.t} on failure
delete_messaging_account(connection, session, messaging_service, id, opts \\ [])
@spec delete_messaging_account( Tesla.Env.client(), String.t(), String.t(), integer(), keyword() ) :: {:ok, OpenXchangeClient.Model.MessagingAccountUpdateResponse.t()} | {:error, Tesla.Env.t()}
Deletes a messaging account.
parameters
Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- messaging_service (String.t): The messaging service ID that the account belongs to.
- id (integer()): The messaging account ID.
- opts (KeywordList): [optional] Optional parameters
returns
Returns
on success {:error, Tesla.Env.t} on failure
get_all_messaging_accounts(connection, session, opts \\ [])
@spec get_all_messaging_accounts(Tesla.Env.client(), String.t(), keyword()) :: {:ok, OpenXchangeClient.Model.MessagingAccountsResponse.t()} | {:error, Tesla.Env.t()}
Gets all messaging 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
- :messaging_service (String.t): List only those accounts that belong to the given
messagingService
.
- :messaging_service (String.t): List only those accounts that belong to the given
returns
Returns
on success {:error, Tesla.Env.t} on failure
get_all_messaging_messages(connection, session, columns, folder, opts \\ [])
@spec get_all_messaging_messages( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, OpenXchangeClient.Model.MessagingMessagesResponse.t()} | {:error, Tesla.Env.t()}
Gets all messaging messages.
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 column names, like "folder,headers,body". See Messaging fields for valid column names.
- folder (String.t): The folder ID, like "com.openexchange.messaging.twitter://535/defaultTimeline/directMessages".
- opts (KeywordList): [optional] Optional parameters
- :sort (String.t): A column name to sort by.
- :order (String.t): The order direction which can be "asc" for ascending (default) or "desc" for descending.
returns
Returns
on success {:error, Tesla.Env.t} on failure
get_all_messaging_services(connection, session, opts \\ [])
@spec get_all_messaging_services(Tesla.Env.client(), String.t(), keyword()) :: {:ok, OpenXchangeClient.Model.MessagingServicesResponse.t()} | {:error, Tesla.Env.t()}
Gets all messaging services.
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_messaging_account(connection, session, messaging_service, id, opts \\ [])
@spec get_messaging_account( Tesla.Env.client(), String.t(), String.t(), integer(), keyword() ) :: {:ok, OpenXchangeClient.Model.MessagingAccountResponse.t()} | {:error, Tesla.Env.t()}
Gets a messaging account.
parameters
Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- messaging_service (String.t): The messaging service ID that the account belongs to.
- id (integer()): The messaging account ID.
- opts (KeywordList): [optional] Optional parameters
returns
Returns
on success {:error, Tesla.Env.t} on failure
get_messaging_message(connection, session, id, folder, opts \\ [])
@spec get_messaging_message( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, OpenXchangeClient.Model.MessagingMessageResponse.t()} | {:error, Tesla.Env.t()}
Gets a messaging message.
A messaging message consists of some metadata, headers and a content. The content attribute varies by the content-type header. If the content-type is text/*
it is a string, if it is multipart/*
it is an array of objects, each representing a part of the multipart. If it is anything else it is considered binary and is a Base64 encoded string. The folder ID of a message follows a predefined format: [messagingService]://[accountId]/[path]
, like com.openexchange.messaging.twitter://535/defaultTimeline/directMessages
.
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 message to load.
- folder (String.t): The folder ID of the message.
- opts (KeywordList): [optional] Optional parameters
- :peek (boolean()): If set to
true
the read/unread state of the message will not change. Default isfalse
.
- :peek (boolean()): If set to
returns
Returns
on success {:error, Tesla.Env.t} on failure
get_messaging_message_list(connection, session, columns, body, opts \\ [])
@spec get_messaging_message_list( Tesla.Env.client(), String.t(), String.t(), [[Map.t()]], keyword() ) :: {:ok, OpenXchangeClient.Model.MessagingMessagesResponse.t()} | {:error, Tesla.Env.t()}
Gets a list of messaging messages.
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 column names, like "folder,headers,body". See Messaging fields for valid column names.
- body ([[map()]]): A JSON array of JSON arrays with the folder and ID as elements each identifying a message.
- opts (KeywordList): [optional] Optional parameters
returns
Returns
on success {:error, Tesla.Env.t} on failure
get_messaging_service(connection, session, id, opts \\ [])
@spec get_messaging_service(Tesla.Env.client(), String.t(), String.t(), keyword()) :: {:ok, OpenXchangeClient.Model.MessagingServiceResponse.t()} | {:error, Tesla.Env.t()}
Gets a messaging service.
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 messaging service to load.
- opts (KeywordList): [optional] Optional parameters
returns
Returns
on success {:error, Tesla.Env.t} on failure
perform_messaging_action(connection, session, message_action, body, opts \\ [])
@spec perform_messaging_action( Tesla.Env.client(), String.t(), String.t(), OpenXchangeClient.Model.MessagingMessageData.t(), keyword() ) :: {:ok, OpenXchangeClient.Model.MessagingMessageUpdateResponse.t()} | {:error, Tesla.Env.t()}
Performs a certain messaging action on a message. On actions of type "message" the body should contain the JSON representation of the message the action should be applied to. To invoke a messaging action of type "storage" the folder and id are needed in URL parameters. Messaging actions of type "none" need a messaging message and account.
parameters
Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- message_action (String.t): The message action to invoke.
- body (MessagingMessageData): A JSON array of JSON arrays with the folder and ID as elements each identifying a message.
- opts (KeywordList): [optional] Optional parameters
- :id (String.t): The ID of the message the action shall be invoked on. Only used on actions of type "storage".
- :folder (String.t): The folder ID of the message. Only used on actions of type "storage".
- :account (integer()): The account ID. Only used on actions of type "none".
returns
Returns
on success {:error, Tesla.Env.t} on failure
send_messaging_message(connection, session, body, opts \\ [])
@spec send_messaging_message( Tesla.Env.client(), String.t(), OpenXchangeClient.Model.MessagingMessageData.t(), keyword() ) :: {:ok, OpenXchangeClient.Model.MessagingMessageUpdateResponse.t()} | {:error, Tesla.Env.t()}
Sends a messaging message.
parameters
Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- body (MessagingMessageData): A JSON array of JSON arrays with the folder and ID as elements each identifying a message.
- opts (KeywordList): [optional] Optional parameters
- :recipients (String.t): A list of recipients as defined in RFC822, like "Joe Doe joe@doe.org". If set the message is sent to the given list of recipients, otherwise this defaults to the "To" header of the message.
returns
Returns
on success {:error, Tesla.Env.t} on failure
update_messaging_account(connection, session, body, opts \\ [])
@spec update_messaging_account( Tesla.Env.client(), String.t(), OpenXchangeClient.Model.MessagingAccountData.t(), keyword() ) :: {:ok, OpenXchangeClient.Model.MessagingAccountUpdateResponse.t()} | {:error, Tesla.Env.t()}
Updates a messaging account.
parameters
Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- body (MessagingAccountData): A JSON object containing the modified data of the account. The fields
id
andmessagingService
must always be set. - opts (KeywordList): [optional] Optional parameters
returns
Returns
on success {:error, Tesla.Env.t} on failure