# MailSlurp\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

[]string UploadAttachment(ctx, 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.

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
uploadOptions UploadAttachmentOptions uploadOptions

# Return type

[]string

# Authorization

API_KEY

# HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

# UploadAttachmentBytes

[]string UploadAttachmentBytes(ctx, optional)

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.

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
optional *UploadAttachmentBytesOpts optional parameters nil if no parameters

# Optional Parameters

Optional parameters are passed through a pointer to a UploadAttachmentBytesOpts struct

Name Type Description Notes
string_ optional.String Optional contentType for file. For instance `application/pdf`
filename optional.String Optional filename to save upload with
byteArray optional.String Byte array request body

# Return type

[]string

# Authorization

API_KEY

# HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

# UploadMultipartForm

[]string UploadMultipartForm(ctx, file, optional)

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.

# Required Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
file os.Fileos.File file
optional *UploadMultipartFormOpts optional parameters nil if no parameters

# Optional Parameters

Optional parameters are passed through a pointer to a UploadMultipartFormOpts struct

Name Type Description Notes

contentType | optional.String| Optional content type of attachment | filename | optional.String| Optional name of file | xFilename | optional.String| Optional content type header of attachment |

# Return type

[]string

# Authorization

API_KEY

# HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]