Can we setup Microsoft webhook change notifications on message resources with filters?

Umair Ahmed 56 Reputation points
2021-11-04T14:40:21.943+00:00

We're following this document: webhooks to setup webhook notifications to subscribe to any new emails in mailbox of a specific user. But we don't want to get notifications for new emails in certain folders e.g. Sent, Drafts. So, can we specify a filter to only give us notifications for certain folders by giving their IDs as shown below:

{  
  "changeType": "updated",  
  "notificationUrl": "https://webhook.azurewebsites.net/notificationClient",  
  "resource": "users/34efd5d6-e729-44b8-b109-4f3e5274cdda/messages$filter=parentFolderId eq 'AQMkADY4N2YwYmQwLWQyNTEtNGFhAGItYWVmYi0zNDZmOGFjZTljNGIALgAAA_5PEj-ru5tEoSQhNZMolB0BANwG7UKC_KZBtlthtZP2hSQAAAIBCQAAAA=='",  
  "expirationDateTime": "2016-03-20T11:00:00.0000000Z",  
  "clientState": "SecretClientState"  
}  
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shivam Dhiman 6,086 Reputation points
    2022-02-03T18:23:08.29+00:00

    Hi @Umair Ahmed ,

    To receive change notification subscription for particular folder in your outlook you can create a subscription for a specific Outlook folder using the below query.

    API Inbox: me/mailFolders('inbox')/messages
    171038-notification.png

    This will help you to create notification for particular folder from your mailbox so that you can receive the notification only for the required folder.

    You can refer to this link for further details .
    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have further questions about this answer, please click "Comment".

    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.