I'm using subscriptions using below.
https://graph.microsoft.com/v1.0/subscriptions
{
"changeType": "created",
"resource": "users/email address removed for privacy reasons/messages",
"expirationDateTime": "2023-08-05T13:39:18.2257768+00:00",
"clientState": "secretClientValue"
}
Now with this I get notification for both when a new message comes into the mailbox and also when an email is sent out from the mailbox. Following are some of the options I have tried to differentiate between sent email vs received email.
1. During subscription use users/email address removed for privacy reasons/mailFolders('inbox')/messages . This sends notification only when there is a new email in the inbox. If any folders are inside inbox, then we'll need to subscribe for all those folders which may be tedious when you have lots of mailboxes.
"singleValueExtendedProperties": [
{
"id": "String {630b1eb6-293a-4c92-ba78-a40aadad5ae7} Name SendMailId",
"value": "TEST-3001"
}
]
I get everything but singleValueExtendedProperties doesn't appear. Is it because the message is from the sentItems?
3. I tried extensions as well but I can't get that either.
So just trying to find if there is any option available to differentiate between these 2.