Package software.xdev.mailpit.api
Class MessageApi
java.lang.Object
software.xdev.mailpit.client.BaseApi
software.xdev.mailpit.api.MessageApi
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattachmentParams(String ID, String partID) Get message attachment This will return the attachment part using the appropriate Content-Type.Get message attachment This will return the attachment part using the appropriate Content-Type.Get message source Returns the full email source as plain text.downloadRawParams(String ID, Map<String, String> additionalHeaders) Get message source Returns the full email source as plain text.Get message headers Returns the message headers as an array.getHeadersParams(String ID, Map<String, String> additionalHeaders) Get message headers Returns the message headers as an array.Get message summary Returns the summary of a message, marking the message as read.getMessageParams(String ID, Map<String, String> additionalHeaders) Get message summary Returns the summary of a message, marking the message as read.<T> TinvokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String, String> additionalHeaders) Directly invoke the API for the given URL.Release message Release a message via a pre-configured external SMTP server.releaseMessageParams(String ID, ReleaseMessageParamsRequest body, Map<String, String> additionalHeaders) Release message Release a message via a pre-configured external SMTP server.Send a message Send a message via the HTTP API.sendMessageParams(SendMessageParamsRequest body, Map<String, String> additionalHeaders) Send a message Send a message via the HTTP API.thumbnailParams(String ID, String partID) Get an attachment image thumbnail This will return a cropped 180x120 JPEG thumbnail of an image attachment.Get an attachment image thumbnail This will return a cropped 180x120 JPEG thumbnail of an image attachment.Methods inherited from class software.xdev.mailpit.client.BaseApi
getApiClient, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, invokeAPI, setApiClient
-
Constructor Details
-
MessageApi
public MessageApi() -
MessageApi
-
-
Method Details
-
attachmentParams
Get message attachment This will return the attachment part using the appropriate Content-Type. The ID can be set to `latest` to reference the latest message.- Parameters:
ID- Message database ID or \"latest\" (required)partID- Attachment part ID (required)- Returns:
- String
- Throws:
ApiException- if fails to make API call
-
attachmentParams
public String attachmentParams(@Nonnull String ID, @Nonnull String partID, Map<String, String> additionalHeaders) throws ApiExceptionGet message attachment This will return the attachment part using the appropriate Content-Type. The ID can be set to `latest` to reference the latest message.- Parameters:
ID- Message database ID or \"latest\" (required)partID- Attachment part ID (required)additionalHeaders- additionalHeaders for this call- Returns:
- String
- Throws:
ApiException- if fails to make API call
-
downloadRawParams
Get message source Returns the full email source as plain text. The ID can be set to `latest` to return the latest message source.- Parameters:
ID- Message database ID or \"latest\" (required)- Returns:
- String
- Throws:
ApiException- if fails to make API call
-
downloadRawParams
public String downloadRawParams(@Nonnull String ID, Map<String, String> additionalHeaders) throws ApiExceptionGet message source Returns the full email source as plain text. The ID can be set to `latest` to return the latest message source.- Parameters:
ID- Message database ID or \"latest\" (required)additionalHeaders- additionalHeaders for this call- Returns:
- String
- Throws:
ApiException- if fails to make API call
-
getHeadersParams
Get message headers Returns the message headers as an array. Note that header keys are returned alphabetically. The ID can be set to `latest` to return the latest message headers.- Parameters:
ID- Message database ID or \"latest\" (required)- Returns:
- Map<String, List<String>>
- Throws:
ApiException- if fails to make API call
-
getHeadersParams
public Map<String,List<String>> getHeadersParams(@Nonnull String ID, Map<String, String> additionalHeaders) throws ApiExceptionGet message headers Returns the message headers as an array. Note that header keys are returned alphabetically. The ID can be set to `latest` to return the latest message headers.- Parameters:
ID- Message database ID or \"latest\" (required)additionalHeaders- additionalHeaders for this call- Returns:
- Map<String, List<String>>
- Throws:
ApiException- if fails to make API call
-
getMessageParams
Get message summary Returns the summary of a message, marking the message as read. The ID can be set to `latest` to return the latest message.- Parameters:
ID- Message database ID or \"latest\" (required)- Returns:
- Message
- Throws:
ApiException- if fails to make API call
-
getMessageParams
public Message getMessageParams(@Nonnull String ID, Map<String, String> additionalHeaders) throws ApiExceptionGet message summary Returns the summary of a message, marking the message as read. The ID can be set to `latest` to return the latest message.- Parameters:
ID- Message database ID or \"latest\" (required)additionalHeaders- additionalHeaders for this call- Returns:
- Message
- Throws:
ApiException- if fails to make API call
-
releaseMessageParams
public String releaseMessageParams(@Nonnull String ID, @Nullable ReleaseMessageParamsRequest body) throws ApiException Release message Release a message via a pre-configured external SMTP server. This is only enabled if message relaying has been configured. The ID can be set to `latest` to reference the latest message.- Parameters:
ID- Message database ID (required)body- (optional)- Returns:
- String
- Throws:
ApiException- if fails to make API call
-
releaseMessageParams
public String releaseMessageParams(@Nonnull String ID, @Nullable ReleaseMessageParamsRequest body, Map<String, String> additionalHeaders) throws ApiExceptionRelease message Release a message via a pre-configured external SMTP server. This is only enabled if message relaying has been configured. The ID can be set to `latest` to reference the latest message.- Parameters:
ID- Message database ID (required)body- (optional)additionalHeaders- additionalHeaders for this call- Returns:
- String
- Throws:
ApiException- if fails to make API call
-
sendMessageParams
public SendMessageParams200Response sendMessageParams(@Nullable SendMessageParamsRequest body) throws ApiException Send a message Send a message via the HTTP API.- Parameters:
body- (optional)- Returns:
- SendMessageParams200Response
- Throws:
ApiException- if fails to make API call
-
sendMessageParams
public SendMessageParams200Response sendMessageParams(@Nullable SendMessageParamsRequest body, Map<String, String> additionalHeaders) throws ApiExceptionSend a message Send a message via the HTTP API.- Parameters:
body- (optional)additionalHeaders- additionalHeaders for this call- Returns:
- SendMessageParams200Response
- Throws:
ApiException- if fails to make API call
-
thumbnailParams
Get an attachment image thumbnail This will return a cropped 180x120 JPEG thumbnail of an image attachment. If the image is smaller than 180x120 then the image is padded. If the attachment is not an image then a blank image is returned. The ID can be set to `latest` to return the latest message.- Parameters:
ID- Message database ID or \"latest\" (required)partID- Attachment part ID (required)- Returns:
- String
- Throws:
ApiException- if fails to make API call
-
thumbnailParams
public String thumbnailParams(@Nonnull String ID, @Nonnull String partID, Map<String, String> additionalHeaders) throws ApiExceptionGet an attachment image thumbnail This will return a cropped 180x120 JPEG thumbnail of an image attachment. If the image is smaller than 180x120 then the image is padded. If the attachment is not an image then a blank image is returned. The ID can be set to `latest` to return the latest message.- Parameters:
ID- Message database ID or \"latest\" (required)partID- Attachment part ID (required)additionalHeaders- additionalHeaders for this call- Returns:
- String
- Throws:
ApiException- if fails to make API call
-
invokeAPI
public <T> T invokeAPI(String url, String method, Object request, com.fasterxml.jackson.core.type.TypeReference<T> returnType, Map<String, String> additionalHeaders) throws ApiExceptionDescription copied from class:BaseApiDirectly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.- Specified by:
invokeAPIin classBaseApi- Parameters:
url- The URL for the request, either full URL or only the path.method- The HTTP method for the request.request- The request object.returnType- The return type.additionalHeaders- Additional headers for the request.- Returns:
- The API response in the specified type.
- Throws:
ApiException- if fails to make API call.
-