Class MessageApi

java.lang.Object
software.xdev.mailpit.client.BaseApi
software.xdev.mailpit.api.MessageApi

public class MessageApi extends BaseApi
  • Constructor Details

    • MessageApi

      public MessageApi()
    • MessageApi

      public MessageApi(ApiClient apiClient)
  • Method Details

    • attachmentParams

      public String attachmentParams(@Nonnull String ID, @Nonnull String partID) throws ApiException
      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 ApiException
      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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      String
      Throws:
      ApiException - if fails to make API call
    • downloadRawParams

      public String downloadRawParams(@Nonnull String ID) throws ApiException
      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 ApiException
      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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      String
      Throws:
      ApiException - if fails to make API call
    • getHeadersParams

      public Map<String,List<String>> getHeadersParams(@Nonnull String ID) throws ApiException
      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 ApiException
      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)
      additionalHeaders - additionalHeaders for this call
      Returns:
      Map<String, List<String>>
      Throws:
      ApiException - if fails to make API call
    • getMessageParams

      public Message getMessageParams(@Nonnull String ID) throws ApiException
      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 ApiException
      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)
      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 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)
      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 ApiException
      Send 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

      public String thumbnailParams(@Nonnull String ID, @Nonnull String partID) throws ApiException
      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 ApiException
      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)
      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 ApiException
      Description copied from class: BaseApi
      Directly invoke the API for the given URL. Useful if the API returns direct links/URLs for subsequent requests.
      Specified by:
      invokeAPI in class BaseApi
      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.