OpenXchangeClient.Api.Attachments (open_xchange_client v0.10.0)
API calls for all endpoints tagged Attachments
.
Link to this section Summary
Functions
Creates an attachment.
Deletes attachments.
Gets all attachments for an object.
Gets an attachment.
Gets an attachment's document/filedata.
It is possible to add a filename to the request's URI like /attachment/{filename}?action=document
. The filename may be added to the customary attachment path to suggest a filename to a Save-As dialog.
Gets a list of attachments.
Gets the new and deleted attachments.
Gets a ZIP archive for multipe attachment data.
Link to this section Functions
create_attachment(connection, session, json0, file0, opts \\ [])
@spec create_attachment( Tesla.Env.client(), String.t(), String.t(), String.t(), keyword() ) :: {:ok, String.t()} | {:error, Tesla.Env.t()}
Creates an attachment.
Note It is possible to create multiple attachments at once. Therefor add additional form fields and replace "[index]" in json_[index]
and file_[index]
with the appropriate index, like json_1
, file_1
. The index always starts with 0 (mandatory attachment object).
parameters
Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- json0 (String.t): A JSON string representing an attachment object as described in AttachmentData model with at least the fields
folder
,attached
andmodule
. - file0 (String.t): The attachment file as per
<input type=\"file\" />
. - opts (KeywordList): [optional] Optional parameters
returns
Returns
on success {:error, Tesla.Env.t} on failure
delete_attachments(connection, session, attached, folder, module, body, opts \\ [])
@spec delete_attachments( Tesla.Env.client(), String.t(), integer(), integer(), integer(), [String.t()], keyword() ) :: {:ok, OpenXchangeClient.Model.CommonResponse.t()} | {:error, Tesla.Env.t()}
Deletes attachments.
parameters
Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- attached (integer()): The ID of the object to which the attachment belongs.
- folder (integer()): The folder ID of the object.
- module (integer()): The module type of the object: 1 (appointment), 4 (task), 7 (contact), 137 (infostore).
- body ([String.t]): A JSON array with the identifiers of the attachments that shall be deleted.
- opts (KeywordList): [optional] Optional parameters
returns
Returns
on success {:error, Tesla.Env.t} on failure
get_all_attachments(connection, session, attached, folder, module, columns, opts \\ [])
@spec get_all_attachments( Tesla.Env.client(), String.t(), integer(), integer(), integer(), String.t(), keyword() ) :: {:ok, OpenXchangeClient.Model.AttachmentsResponse.t()} | {:error, Tesla.Env.t()}
Gets all attachments for an object.
parameters
Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- attached (integer()): The ID of the object to which the attachment belongs.
- folder (integer()): The folder ID of the object.
- module (integer()): The module type of the object: 1 (appointment), 4 (task), 7 (contact), 137 (infostore).
- columns (String.t): A comma-separated list of columns to return, like "1,800". Each column is specified by a numeric column identifier, see Common object data and Attachment 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
get_attachment(connection, session, id, attached, folder, module, opts \\ [])
@spec get_attachment( Tesla.Env.client(), String.t(), String.t(), integer(), integer(), integer(), keyword() ) :: {:ok, OpenXchangeClient.Model.AttachmentResponse.t()} | {:error, Tesla.Env.t()}
Gets an attachment.
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 infoitem.
- attached (integer()): The ID of the object to which the attachment belongs.
- folder (integer()): The folder ID of the object.
- module (integer()): The module type of the object: 1 (appointment), 4 (task), 7 (contact), 137 (infostore).
- opts (KeywordList): [optional] Optional parameters
returns
Returns
on success {:error, Tesla.Env.t} on failure
get_attachment_document(connection, session, attached, folder, module, id, opts \\ [])
@spec get_attachment_document( Tesla.Env.client(), String.t(), integer(), integer(), integer(), String.t(), keyword() ) :: {:ok, String.t()} | {:error, Tesla.Env.t()}
Gets an attachment's document/filedata.
It is possible to add a filename to the request's URI like /attachment/{filename}?action=document
. The filename may be added to the customary attachment path to suggest a filename to a Save-As dialog.
parameters
Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- attached (integer()): The ID of the object to which the attachment belongs.
- folder (integer()): The folder ID of the object.
- module (integer()): The module type of the object: 1 (appointment), 4 (task), 7 (contact), 137 (infostore).
- id (String.t): Object ID of the requested attachment.
- opts (KeywordList): [optional] Optional parameters
- :content_type (String.t): If present the response declares the given
content_type
in the Content-Type header and not the attachments file MIME type. - :scan (boolean()): Flag to request an Anti-Virus scan for the specified attachment before downloading it.
- :content_type (String.t): If present the response declares the given
returns
Returns
on success {:error, Tesla.Env.t} on failure
get_attachment_list(connection, session, attached, folder, module, columns, body, opts \\ [])
@spec get_attachment_list( Tesla.Env.client(), String.t(), integer(), integer(), integer(), String.t(), [Integer.t()], keyword() ) :: {:ok, OpenXchangeClient.Model.InfoItemsResponse.t()} | {:error, Tesla.Env.t()}
Gets a list of attachments.
parameters
Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- attached (integer()): The ID of the object to which the attachment belongs.
- folder (integer()): The folder ID of the object.
- module (integer()): The module type of the object: 1 (appointment), 4 (task), 7 (contact), 137 (infostore).
- columns (String.t): A comma-separated list of columns to return, like "1,800". Each column is specified by a numeric column identifier, see Common object data and Attachment data.
- body ([integer()]): A JSON array with the identifiers of the requested attachments.
- opts (KeywordList): [optional] Optional parameters
returns
Returns
on success {:error, Tesla.Env.t} on failure
get_attachment_updates(connection, session, attached, folder, columns, module, opts \\ [])
@spec get_attachment_updates( Tesla.Env.client(), String.t(), integer(), integer(), String.t(), integer(), keyword() ) :: {:ok, OpenXchangeClient.Model.AttachmentUpdatesResponse.t()} | {:error, Tesla.Env.t()}
Gets the new and deleted attachments.
parameters
Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- attached (integer()): The ID of the object to which the attachment belongs.
- folder (integer()): The folder ID of the object.
- columns (String.t): A comma-separated list of columns to return, like "1,800". Each column is specified by a numeric column identifier, see Common object data and Attachment data.
- module (integer()): The module type of the object: 1 (appointment), 4 (task), 7 (contact), 137 (infostore).
- opts (KeywordList): [optional] Optional parameters
- :timestamp (integer()): Timestamp of the last update of the requested infoitems.
- :ignore (String.t): Which kinds of updates should be ignored. Currently, the only valid value – "deleted" – causes deleted object IDs not to be returned.
- :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
get_zipped_attachment_documents(connection, session, attached, folder, module, body, opts \\ [])
@spec get_zipped_attachment_documents( Tesla.Env.client(), String.t(), integer(), integer(), integer(), [Integer.t()], keyword() ) :: {:ok, String.t()} | {:error, Tesla.Env.t()}
Gets a ZIP archive for multipe attachment data.
parameters
Parameters
- connection (OpenXchangeClient.Connection): Connection to server
- session (String.t): A session ID previously obtained from the login module.
- attached (integer()): The ID of the object to which the attachment belongs.
- folder (integer()): The folder ID of the object.
- module (integer()): The module type of the object: 1 (appointment), 4 (task), 7 (contact), 137 (infostore).
- body ([integer()]): A JSON array with the identifiers of the attachments, which shall be put into ZIP archive
- opts (KeywordList): [optional] Optional parameters
returns
Returns
on success {:error, Tesla.Env.t} on failure