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

Umair Ahmed 46 Reputation points

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": "",  
  "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 Graph Change Notifications API
Microsoft Graph Mail API
Microsoft Graph Mail API
A Microsoft API that supports accessing data in users' primary mailboxes and in shared mailboxes.
683 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shivam Dhiman-MSFT 4,406 Reputation points Microsoft Employee

    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

    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".

    No comments