Package 

Class AttachmentControllerApi

    • Constructor Detail

      • AttachmentControllerApi

        AttachmentControllerApi(String xApiKey, String basePath)
    • Method Detail

      • deleteAttachment

         final Unit deleteAttachment(String attachmentId)

        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:
        attachmentId - ID of attachment
      • downloadAttachmentAsBase64Encoded

         final DownloadAttachmentDto downloadAttachmentAsBase64Encoded(String attachmentId)

        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:
        attachmentId - ID of attachment
      • downloadAttachmentAsBytes

         final ByteArray downloadAttachmentAsBytes(String attachmentId)

        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:
        attachmentId - ID of attachment
      • getAttachment

         final AttachmentEntity getAttachment(String attachmentId)

        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:
        attachmentId - ID of attachment
      • getAttachmentInfo

         final AttachmentMetaData getAttachmentInfo(String attachmentId)

        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:
        attachmentId - ID of attachment
      • getAttachments

         final PageAttachmentEntity getAttachments(OffsetDateTime before, String fileNameFilter, Integer page, OffsetDateTime since, Integer size, String sort)

        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:
        before - Filter by created at before the given timestamp (optional)
        fileNameFilter - Optional file name and content type search filter (optional)
        page - Optional page index event list pagination (optional, default to 0)
        since - Filter by created at after the given timestamp (optional)
        size - Optional page size event list pagination (optional, default to 20)
        sort - Optional createdAt sort direction ASC or DESC (optional, default to ASC)
      • getAttachmentsRequestConfig

         final RequestConfig getAttachmentsRequestConfig(OffsetDateTime before, String fileNameFilter, Integer page, OffsetDateTime since, Integer size, String sort)

        To obtain the request config of the operation getAttachments

        Parameters:
        before - Filter by created at before the given timestamp (optional)
        fileNameFilter - Optional file name and content type search filter (optional)
        page - Optional page index event list pagination (optional, default to 0)
        since - Filter by created at after the given timestamp (optional)
        size - Optional page size event list pagination (optional, default to 20)
        sort - Optional createdAt sort direction ASC or DESC (optional, default to ASC)
      • uploadAttachment

         final List<String> uploadAttachment(UploadAttachmentOptions uploadOptions)

        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 &#x60;SendEmailOptions&#x60; when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.

        Parameters:
        uploadOptions - uploadOptions
      • uploadAttachmentBytes

         final List<String> uploadAttachmentBytes(String contentType, String filename, ByteArray byteArray)

        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 &#x60;SendEmailOptions&#x60; when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.

        Parameters:
        contentType - Optional contentType for file.
        filename - Optional filename to save upload with (optional)
        byteArray - Byte array request body (optional)
      • uploadAttachmentBytesRequestConfig

         final RequestConfig uploadAttachmentBytesRequestConfig(String contentType, String filename, ByteArray byteArray)

        To obtain the request config of the operation uploadAttachmentBytes

        Parameters:
        contentType - Optional contentType for file.
        filename - Optional filename to save upload with (optional)
        byteArray - Byte array request body (optional)
      • uploadMultipartForm

         final List<String> uploadMultipartForm(File file, String contentType, String filename, String xFilename)

        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 &#x60;SendEmailOptions&#x60; when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.

        Parameters:
        file - file
        contentType - Optional content type of attachment (optional)
        filename - Optional name of file (optional)
        xFilename - Optional content type header of attachment (optional)
      • uploadMultipartFormRequestConfig

         final RequestConfig uploadMultipartFormRequestConfig(File file, String contentType, String filename, String xFilename)

        To obtain the request config of the operation uploadMultipartForm

        Parameters:
        file - file
        contentType - Optional content type of attachment (optional)
        filename - Optional name of file (optional)
        xFilename - Optional content type header of attachment (optional)