All URIs are relative to https://api.mailslurp.com

MethodHTTP requestDescription
deleteAllAttachmentsDELETE /attachmentsDelete all attachments
deleteAttachmentDELETE /attachments/{attachmentId}Delete an attachment
downloadAttachmentAsBase64EncodedGET /attachments/{attachmentId}/base64Get email attachment as base64 encoded string as alternative to binary responses. To read the content decode the Base64 encoded contents.
downloadAttachmentAsBytesGET /attachments/{attachmentId}/bytesDownload attachments. Get email attachment bytes. If you have trouble with byte responses try the downloadAttachmentBase64 response endpoints.
getAttachmentGET /attachments/{attachmentId}Get an attachment entity
getAttachmentInfoGET /attachments/{attachmentId}/metadataGet email attachment metadata information
getAttachmentsGET /attachmentsGet email attachments
uploadAttachmentPOST /attachmentsUpload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.
uploadAttachmentBytesPOST /attachments/bytesUpload an attachment for sending using file byte stream input octet stream. Returns an array whose first element is the ID of the uploaded attachment.
uploadMultipartFormPOST /attachments/multipartUpload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment.

deleteAllAttachments()

Delete all attachments

Parameters

This endpoint does not need any parameter.

Return type

null (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

deleteAttachment(attachmentId)

Delete an attachment

Parameters

NameTypeDescriptionNotes
attachmentIdStringID of attachment[default to null]

Return type

null (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

DownloadAttachmentDto downloadAttachmentAsBase64Encoded(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

NameTypeDescriptionNotes
attachmentIdStringID of attachment[default to null]

Return type

DownloadAttachmentDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

byte[] downloadAttachmentAsBytes(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

NameTypeDescriptionNotes
attachmentIdStringID of attachment[default to null]

Return type

**byte[]**

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/octet-stream

AttachmentEntity getAttachment(attachmentId)

Get an attachment entity

Parameters

NameTypeDescriptionNotes
attachmentIdStringID of attachment[default to null]

Return type

AttachmentEntity

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

AttachmentMetaData getAttachmentInfo(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

NameTypeDescriptionNotes
attachmentIdStringID of attachment[default to null]

Return type

AttachmentMetaData

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

PageAttachmentEntity getAttachments(page, size, sort, fileNameFilter, since, before)

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

NameTypeDescriptionNotes
pageIntegerOptional page event list pagination[optional] [default to 0]
sizeIntegerOptional page size event list pagination[optional] [default to 20]
sortStringOptional createdAt sort direction ASC or DESC[optional] [default to ASC] [enum: ASC, DESC]
fileNameFilterStringOptional file name and content type search filter[optional] [default to null]
sinceDateFilter by created at after the given timestamp[optional] [default to null]
beforeDateFilter by created at before the given timestamp[optional] [default to null]

Return type

PageAttachmentEntity

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

List uploadAttachment(UploadAttachmentOptions)

Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment.

Parameters

NameTypeDescriptionNotes
UploadAttachmentOptionsUploadAttachmentOptions

Return type

List

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: /

List uploadAttachmentBytes(ByteArray, contentType, filename)

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

NameTypeDescriptionNotes
ByteArrayList
contentTypeStringOptional contentType for file. For instance application/pdf[optional] [default to null]
filenameStringOptional filename to save upload with[optional] [default to null]

Return type

List

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/octet-stream
  • Accept: application/json

List uploadMultipartForm(contentType, filename, x-filename, InlineObject)

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

Parameters

NameTypeDescriptionNotes
contentTypeStringOptional content type of attachment[optional] [default to null]
filenameStringOptional name of file[optional] [default to null]
x-filenameStringOptional content type header of attachment[optional] [default to null]
InlineObjectInlineObject[optional]

Return type

List

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: /