# AttachmentControllerApi
All URIs are relative to https://api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
uploadAttachment | POST /attachments | Upload an attachment for sending using base64 file encoding. Returns an array whose first element is the ID of the uploaded attachment. |
uploadAttachmentBytes | POST /attachments/bytes | 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. |
uploadMultipartForm | POST /attachments/multipart | Upload an attachment for sending using a Multipart Form request. Returns an array whose first element is the ID of the uploaded attachment. |
# uploadAttachment
List uploadAttachment(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 `SendEmailOptions` when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
uploadOptions | UploadAttachmentOptions | uploadOptions |
# Return type
List
# Authorization
# HTTP request headers
- Content-Type: application/json
- Accept: application/json
# uploadAttachmentBytes
List uploadAttachmentBytes(string, filename, 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 `SendEmailOptions` when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
string | String | Optional contentType for file. For instance `application/pdf` | [optional] [default to null] |
filename | String | Optional filename to save upload with | [optional] [default to null] |
byteArray | byte[] | Byte array request body | [optional] |
# Return type
List
# Authorization
# HTTP request headers
- Content-Type: application/octet-stream
- Accept: application/json
# uploadMultipartForm
List uploadMultipartForm(file, contentType, filename, 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 `SendEmailOptions` when sending an email. Using the upload endpoints prior to sending mean attachments can easily be reused.
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
file | File | file | [default to null] |
contentType | String | Optional content type of attachment | [optional] [default to null] |
filename | String | Optional name of file | [optional] [default to null] |
xFilename | String | Optional content type header of attachment | [optional] [default to null] |
# Return type
List
# Authorization
# HTTP request headers
- Content-Type: multipart/form-data
- Accept: application/json