Skip to content

Instantly share code, notes, and snippets.

@gscales
Created April 20, 2021 05:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gscales/abe8e16ef4a6a05c37161551de1b1d6c to your computer and use it in GitHub Desktop.
Save gscales/abe8e16ef4a6a05c37161551de1b1d6c to your computer and use it in GitHub Desktop.
Tag for external email messages received Microsoft Graph examples
Include the IsExternalSender property in Results
https://graph.microsoft.com/v1.0/users('user@dom.com')/MailFolders('Inbox')/messages/?
$Top=10&$expand=SingleValueExtendedProperties($filter=(Id eq 'Boolean {41F28F13-83F4-4114-A584-EEDB5A6B0BFF} Name IsExternalSender'))
Filter for only External Senders
https://graph.microsoft.com/v1.0/users('user@dom.com')/MailFolders('Inbox')/messages/?
$Top=10&$filter=singleValueExtendedProperties/Any(ep:+ep/id+eq+'Boolean+{41F28F13-83F4-4114-A584-EEDB5A6B0BFF}+Name+IsExternalSender'+and+cast(ep/value,+Edm.Boolean)+eq+true)&$expand=SingleValueExtendedProperties($filter=(Id eq 'Boolean {41F28F13-83F4-4114-A584-EEDB5A6B0BFF} Name IsExternalSender'))
Filter for only Internal Senders
https://graph.microsoft.com/v1.0/users('user@dom.com')/MailFolders('Inbox')/messages/?
$Top=10&$filter=singleValueExtendedProperties/Any(ep:+ep/id+eq+'Boolean+{41F28F13-83F4-4114-A584-EEDB5A6B0BFF}+Name+IsExternalSender'+and+cast(ep/value,+Edm.Boolean)+ne+true)&$expand=SingleValueExtendedProperties($filter=(Id eq 'Boolean {41F28F13-83F4-4114-A584-EEDB5A6B0BFF} Name IsExternalSender'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment