GetRawMessageContent
Retrieves the raw content of an in-transit email message, in MIME format.
Request Syntax
GET /messages/messageId
HTTP/1.1
URI Request Parameters
The request uses the following URI parameters.
- messageId
-
The identifier of the email message to retrieve.
Length Constraints: Minimum length of 1. Maximum length of 120.
Pattern:
[a-z0-9\-]*
Required: Yes
Request Body
The request does not have a request body.
Response Syntax
HTTP/1.1 200
messageContent
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The response returns the following as the HTTP body.
- messageContent
-
The raw content of the email message, in MIME format.
Errors
For information about the errors that are common to all actions, see Common Errors.
- ResourceNotFoundException
-
The requested email message is not found.
HTTP Status Code: 404
Examples
In the following examples, the Authorization header contents
(AUTHPARAMS
) must be replaced with an AWS Signature Version 4
signature. For more information about creating these signatures, see Signature
Version 4 Signing Process in the AWS General
Reference.
You only need to learn how to sign HTTP requests if you intend to manually
create them. When you use the AWS Command Line
Interface (AWS CLI)
Example
This example gets the raw content of an in-transit email message and sends it to a text file named "test".
Sample Request
GET /messages/a1b2cd34-ef5g-6h7j-kl8m-npq9012345rs HTTP/1.1
Host: workmailmessageflow.us-east-1.amazonaws.com
Accept-Encoding: identity
User-Agent: aws-cli/1.16.273 Python/3.6.0 Windows/10 botocore/1.13.9
X-Amz-Date: 20191107T195012Z
Authorization: AUTHPARAMS
Sample Response
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Type: application/json
Date: Thu, 07 Nov 2019 19:50:12 GMT
x-amzn-RequestId: ea71f214-79c5-4f89-9d4e-1ab4c43ae0df
Content-Length: 1344
Connection: keep-alive
Subject: Hello World
From: =?UTF-8?Q?marymajor_marymajor?= <marymajor@example.com>
To: =?UTF-8?Q?mateojackson=40example=2Enet?= <mateojackson@example.net>
Date: Thu, 7 Nov 2019 19:22:46 +0000
Mime-Version: 1.0
Content-Type: multipart/alternative;
boundary="=_EXAMPLE+"
References: <mail.1ab23c45.5de6.7f890g123hj45678@storage.wm.amazon.com>
X-Priority: 3 (Normal)
X-Mailer: Amazon WorkMail
Thread-Index: EXAMPLE
Thread-Topic: Hello World
Message-Id: <mail.1ab23c45.5de6.7f890g123hj45678@storage.wm.amazon.com>
This is a multi-part message in MIME format. Your mail reader does not
understand MIME message format.
--=_EXAMPLE+
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
hello world
--=_EXAMPLE+
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML><html>
<head>
<meta name=3D"Generator" content=3D"Amazon WorkMail v3.0-4510">
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dutf-8">=
<title>testing</title>
</head>
<body>
<p style=3D"margin: 0px; font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: small;">hello world</p>
</body>
</html>
--=_EXAMPLE+--
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: