MailSlurpAPI.Api.AttachmentController (mailslurp v15.0.2)
API calls for all endpoints tagged AttachmentController
.
Link to this section Summary
Functions
Delete all attachments
Delete an attachment
Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with SendEmailOptions
when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents.
Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the downloadAttachment
method but allows some clients to get around issues with binary responses.
Download attachments. Get email attachment bytes. If you have trouble with byte responses try the downloadAttachmentBase64
response endpoints.
Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
Get an attachment entity
Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with SendEmailOptions
when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
Get email attachment metadata information
Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties name
and content-type
and content-length
in bytes for a given attachment.
Get email attachments
Get all attachments in paginated response. Each entity contains meta data for the attachment such as name
and content-type
. Use the attachmentId
and the download endpoints to get the file contents.
Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with SendEmailOptions
when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with SendEmailOptions
when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with SendEmailOptions
when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
Link to this section Functions
delete_all_attachments(connection, opts \\ [])
Specs
delete_all_attachments(Tesla.Env.client(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t()}
Delete all attachments
Parameters
- connection (MailSlurpAPI.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
Returns
} on success {:error, info} on failure
delete_attachment(connection, attachment_id, opts \\ [])
Specs
delete_attachment(Tesla.Env.client(), String.t(), keyword()) :: {:ok, nil} | {:error, Tesla.Env.t()}
Delete an attachment
Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with SendEmailOptions
when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
Parameters
- connection (MailSlurpAPI.Connection): Connection to server
- attachment_id (String.t): ID of attachment
- opts (KeywordList): [optional] Optional parameters
Returns
} on success {:error, info} on failure
download_attachment_as_base64_encoded(connection, attachment_id, opts \\ [])
Specs
download_attachment_as_base64_encoded(Tesla.Env.client(), String.t(), keyword()) :: {:ok, MailSlurpAPI.Model.DownloadAttachmentDto.t()} | {:error, Tesla.Env.t()}
Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents.
Returns the specified attachment for a given email as a base 64 encoded string. The response type is application/json. This method is similar to the downloadAttachment
method but allows some clients to get around issues with binary responses.
Parameters
- connection (MailSlurpAPI.Connection): Connection to server
- attachment_id (String.t): ID of attachment
- opts (KeywordList): [optional] Optional parameters
Returns
} on success {:error, info} on failure
download_attachment_as_bytes(connection, attachment_id, opts \\ [])
Specs
download_attachment_as_bytes(Tesla.Env.client(), String.t(), keyword()) :: {:ok, String.t()} | {:error, Tesla.Env.t()}
Download attachments. Get email attachment bytes. If you have trouble with byte responses try the downloadAttachmentBase64
response endpoints.
Returns the specified attachment for a given email as a stream / array of bytes. You can find attachment ids in email responses endpoint responses. The response type is application/octet-stream.
Parameters
- connection (MailSlurpAPI.Connection): Connection to server
- attachment_id (String.t): ID of attachment
- opts (KeywordList): [optional] Optional parameters
Returns
} on success {:error, info} on failure
get_attachment(connection, attachment_id, opts \\ [])
Specs
get_attachment(Tesla.Env.client(), String.t(), keyword()) :: {:ok, MailSlurpAPI.Model.AttachmentEntity.t()} | {:error, Tesla.Env.t()}
Get an attachment entity
Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with SendEmailOptions
when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
Parameters
- connection (MailSlurpAPI.Connection): Connection to server
- attachment_id (String.t): ID of attachment
- opts (KeywordList): [optional] Optional parameters
Returns
} on success {:error, info} on failure
get_attachment_info(connection, attachment_id, opts \\ [])
Specs
get_attachment_info(Tesla.Env.client(), String.t(), keyword()) :: {:ok, MailSlurpAPI.Model.AttachmentMetaData.t()} | {:error, Tesla.Env.t()}
Get email attachment metadata information
Returns the metadata for an attachment. It is saved separately to the content of the attachment. Contains properties name
and content-type
and content-length
in bytes for a given attachment.
Parameters
- connection (MailSlurpAPI.Connection): Connection to server
- attachment_id (String.t): ID of attachment
- opts (KeywordList): [optional] Optional parameters
Returns
} on success {:error, info} on failure
get_attachments(connection, opts \\ [])
Specs
get_attachments(Tesla.Env.client(), keyword()) :: {:ok, MailSlurpAPI.Model.PageAttachmentEntity.t()} | {:error, Tesla.Env.t()}
Get email attachments
Get all attachments in paginated response. Each entity contains meta data for the attachment such as name
and content-type
. Use the attachmentId
and the download endpoints to get the file contents.
Parameters
- connection (MailSlurpAPI.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
- :before (DateTime.t): Filter by created at before the given timestamp
- :file_name_filter (String.t): Optional file name and content type search filter
- :page (integer()): Optional page index event list pagination
- :since (DateTime.t): Filter by created at after the given timestamp
- :size (integer()): Optional page size event list pagination
- :sort (String.t): Optional createdAt sort direction ASC or DESC
Returns
} on success {:error, info} on failure
upload_attachment(connection, upload_options, opts \\ [])
Specs
upload_attachment( Tesla.Env.client(), MailSlurpAPI.Model.UploadAttachmentOptions.t(), keyword() ) :: {:ok, [String.t()]} | {:error, Tesla.Env.t()}
Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with SendEmailOptions
when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
Parameters
- connection (MailSlurpAPI.Connection): Connection to server
- upload_options (UploadAttachmentOptions): uploadOptions
- opts (KeywordList): [optional] Optional parameters
Returns
, ...]} on success {:error, info} on failure
upload_attachment_bytes(connection, opts \\ [])
Specs
upload_attachment_bytes(Tesla.Env.client(), keyword()) :: {:ok, [String.t()]} | {:error, Tesla.Env.t()}
Upload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with SendEmailOptions
when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
Parameters
- connection (MailSlurpAPI.Connection): Connection to server
- opts (KeywordList): [optional] Optional parameters
, ...]} on success {:error, info} on failure
upload_multipart_form(connection, file, opts \\ [])
Specs
upload_multipart_form(Tesla.Env.client(), String.t(), keyword()) :: {:ok, [String.t()]} | {:error, Tesla.Env.t()}
Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.
Email attachments are essentially files with meta data. Files are byte arrays and the meta data is a content type and a filename. These properties allow email clients to display the filename and icon etc. When sending emails with attachments first upload each attachment with an upload endpoint. Record the returned attachment ID and use it with subsequent email sending. For legacy reasons the ID is returned as the first element in an array. Only a single ID is ever returned. To send the attachments pass a list of attachment IDs with SendEmailOptions
when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
Parameters
- connection (MailSlurpAPI.Connection): Connection to server
- file (String.t): file
- opts (KeywordList): [optional] Optional parameters
, ...]} on success {:error, info} on failure