1

Is there a way to get the email aliases address to which an email was originally sent from Microsoft Graph?

We have a single email account like main@company.com along with the multiple other associated email addresses (email aliases). Emails send to any of the aliases go to a to the same inbox as main@company.com.

If we send an email to alias@company.com and look at the message using https://graph.microsoft.com/v1.0/me/messages, it shows mail@company.com as the email address. We need to detect if it was sent to alias@company.com.

The information for the allies can be found in the email header and there is a potential workaround in the Outlook API:

https://outlook.office.com/api/v2.0/me/mailfolders/inbox/messages/{messageId}?$select=Subject,SingleValueExtendedProperties &$expand=SingleValueExtendedProperties($filter=PropertyId eq 'String 0x7D') 

This returns an unstructured result which needs to be parsed and it is not very convenient. We are looking if there is a more direct way to get this from Microsoft Graph.

4

1 回答 1

1

You can use the same $filter with Microsoft Graph. You simply need to switch PropertyId to simply id:

?$select=subject&$expand=singleValueExtendedProperties($filter=id eq 'String 0x7D')

Also note that don't need to both select and expand the singleValueExtendedProperties collection. Expanding will ensure it gets included.

于 2019-09-29T22:06:53.937 回答