AttachmentController

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.

get/attachments/{attachmentId}/base64

Request

  • Base URL: https://api.mailslurp.com
  • URL: https://api.mailslurp.com/attachments/{attachmentId}/base64
  • Auth: API key in header x-api-key

Path parameters

attachmentIdstring required

ID of attachment

Response

OK

base64FileContentsstring required

Base64 encoded string of attachment bytes. Decode the base64 encoded string to get the raw contents. If the file has a content type such as text/html you can read the contents directly by converting it to string using utf-8 encoding.

contentTypestring required

Content type of attachment. Examples are image/png, application/msword, text/csv etc.

sizeBytesinteger required

Size in bytes of attachment content

Changes

No recorded changes to this operation across all 1 revision of this API.