EmailController

Get email attachment as base64 encoded string as an alternative to binary responses. Decode the `base64FileContents` as a `utf-8` encoded string or array of bytes depending on the `contentType`.

Returns attachment payload as base64 in JSON. Useful for clients that cannot reliably consume binary streaming responses.

get/emails/{emailId}/attachments/{attachmentId}/base64

Request

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

Path parameters

emailIdstring uuid required

ID of email

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.