Get eventMessage

Retrieve the properties and relationships of the eventMessage object.

Get the event message body in HTML or text format

Event message bodies can be in HTML or text format.

You can use the Prefer: outlook.body-content-type header to specify the desired format returned in the body and uniqueBody properties in a GET request:

  • Specify Prefer: outlook.body-content-type="text" to get a event message body returned in text format.
  • Specify Prefer: outlook.body-content-type="html", or just skip the header, to return the event message body in HTML format.

If you specify either header, the response will include the corresponding Preference-Applied header as confirmation:

  • For text format requests: Preference-Applied: outlook.body-content-type="text"
  • For HTML format requests: Preference-Applied: outlook.body-content-type="html"

Prerequisites

One of the following scopes is required to execute this API: Mail.Read

HTTP request

GET /me/messages/{id}
GET /users/{id | userPrincipalName}/messages/{id}

GET /me/mailFolders/{id}/messages/{id}
GET /users/{id | userPrincipalName}/mailFolders/{id}/messages/{id}

Optional query parameters

This method supports the OData Query Parameters to help customize the response.

Request headers

Name Type Description
Authorization string Bearer {token}. Required.

Request body

Do not supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and eventMessage object in the response body.

Example

Request

Here is an example of the request.

GET https://graph.microsoft.com/beta/me/messages/{id}
Response

Here is an example of the response. Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.

HTTP/1.1 200 OK
Content-type: application/json
Content-length: 248

{
  "receivedDateTime": "2016-10-19T10:37:00Z",
  "sentDateTime": "2016-10-19T10:37:00Z",
  "hasAttachments": true,
  "subject": "subject-value",
  "body": {
    "contentType": "html",
    "content": "content-value"
  },
  "bodyPreview": "bodyPreview-value",
  "meetingMessageType": "meetingMessageType-value"
}