Search code examples
graphmicrosoft-graph-apiexchangewebservices

Create subscription for Inbox folder's subfolders and How do we perform Subscription for multiple folders in one request similar to EWS


With reference to the GRAPH API mentioned at https://learn.microsoft.com/en-us/graph/api/subscription-post-subscriptions?view=graph-rest-1.0&tabs=objc:

  1. How can I subscribe for new message notifications to Inbox's subfolder.(Let's say that I have a testFolder as subfolder inside Inbox.

  2. With EWS, I can specify all folder IDs for which I want to subscribe for new message Notifications in single request. Is there a way to achieve the same with Graph API i.e. subscribing for new messages in multiple folders in single request by passing all folders ids/names?


Solution

  • You have to subscribe to each folder separately, the notifications do not bubble up to the parent folder.

    To subscribe to the subfolder, the resource value should be something like: users/{a}/mailFolders/{b}/childFolders/{c}/messages

    Where a is the id or email of the user, b the is of the main folder and c the id of the subfolder