MailSlurpAPI.Api.AttachmentController (mailslurp v15.17.22)

API calls for all endpoints tagged AttachmentController.

Summary

Functions

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 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.

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.

Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.

Functions

Link to this function

delete_all_attachments(connection, opts \\ [])

@spec 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

Link to this function

delete_attachment(connection, attachment_id, opts \\ [])

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

Delete an 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

Link to this function

download_attachment_as_base64_encoded(connection, attachment_id, opts \\ [])

@spec 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

Link to this function

download_attachment_as_bytes(connection, attachment_id, opts \\ [])

@spec 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

Link to this function

get_attachment(connection, attachment_id, opts \\ [])

@spec get_attachment(Tesla.Env.client(), String.t(), keyword()) ::
  {:ok, MailSlurpAPI.Model.AttachmentEntity.t()} | {:error, Tesla.Env.t()}

Get an attachment entity

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

Link to this function

get_attachment_info(connection, attachment_id, opts \\ [])

@spec 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

Link to this function

get_attachments(connection, opts \\ [])

@spec 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
    • :page (integer()): Optional page index for list pagination
    • :size (integer()): Optional page size for list pagination
    • :sort (String.t): Optional createdAt sort direction ASC or DESC
    • :file_name_filter (String.t): Optional file name and content type search filter
    • :since (DateTime.t): Filter by created at after the given timestamp
    • :before (DateTime.t): Filter by created at before the given timestamp

Returns

} on success {:error, info} on failure

Link to this function

upload_attachment(connection, upload_attachment_options, opts \\ [])

@spec 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.

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • upload_attachment_options (UploadAttachmentOptions):
  • opts (KeywordList): [optional] Optional parameters

Returns

, ...]} on success {:error, info} on failure

Link to this function

upload_attachment_bytes(connection, inline_object1, opts \\ [])

@spec upload_attachment_bytes(
  Tesla.Env.client(),
  MailSlurpAPI.Model.InlineObject1.t(),
  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.

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • inline_object1 (InlineObject1):
  • opts (KeywordList): [optional] Optional parameters
    • :content_type (String.t): Optional contentType for file. For instance application/pdf
    • :filename (String.t): Optional filename to save upload with

Returns

, ...]} on success {:error, info} on failure

Link to this function

upload_multipart_form(connection, opts \\ [])

@spec upload_multipart_form(Tesla.Env.client(), 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.

Parameters

  • connection (MailSlurpAPI.Connection): Connection to server
  • opts (KeywordList): [optional] Optional parameters
    • :content_type (String.t): Optional content type of attachment
    • :filename (String.t): Optional name of file
    • :x_filename (String.t): Optional content type header of attachment
    • :inline_object (InlineObject):

Returns

, ...]} on success {:error, info} on failure