Is there a way to verify file integrity of Microsoft Graph messages?

74 Views Asked by At

We are downloading Microsoft Graph messages using the dotnet SDK.

For Drive Items we are checking the file hash where possible to confirm the file integrity after download.

Is there an equivalent hash that we can use to verify messages we download have come through as expected?

1

There are 1 best solutions below

2
user2250152 On

The message resource type doesn't have any hash or size property. There is a MAPI canonical property PidTagMessageSize but it's only an approximate size.

To read the value of PidTagMessageSize

GET https://graph.microsoft.com/v1.0/me/messages/{message_id}?$expand=singleValueExtendedProperties($filter=id eq 'Long 0x0E08')&$select=id

From my testing the message size doesn't match the size of raw value of message returned by

GET https://graph.microsoft.com/v1.0/me/messages/{message_id}/$value

Resources:

PidTagMessageSize