Share via

Get e-mail data from a Graph API subscription

Anonymous
2024-06-24T13:34:02.3366667+00:00

After creating a subscription/webhook like this:

{
  "changeType": "created,updated",
  "notificationUrl": "https://my.url/",
  "lifecycleNotificationUrl": "https://my.url/lifecycle",
  "resource": "/users/7e3c.../mailFolders('inbox')/messages",
  "expirationDateTime": "2024-06-25T11:00:00.0000000Z",
  "clientState": "SecretClientState"
}

The requests I receive from the Graph API look like this:

{
	"value": [
		{
			"subscriptionId": "8432...",
			"subscriptionExpirationDateTime": "2024-06-25T11:00:00+00:00",
			"changeType": "updated",
			"resource": "Users/7e3c.../Messages/AAMkAG...",
			"resourceData": {
				"@odata.type": "#Microsoft.Graph.Message",
				"@odata.id": "Users/7e3c.../Messages/AAMkAG...",
				"@odata.etag": "W/"CQAAAB..."",
				"id": "AAMkAG..."
			},
			"clientState": "SecretClientState",
			"tenantId": "23a7..."
		}
	]
}

What I want is to also receive the data of the e-mail (or message), such as the e-mail adresses of the sender and receiver, and the body, in the same json.

Or do I REALLY have to just send a request to /users/{id}/messages ?

Microsoft Security | Microsoft Graph
0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.