使用 Graph API 订阅邮件文件夹及其所有子文件夹中的更改

Subscribe to changes in mail folder and all it's subfolders using Graph API

我的收件箱文件夹结构如下:

Inbox
 >>Subfolder1
 >>Subfolder2
 ..
 >>SubfolderN

我预计在我订阅时会收到所有消息的通知,包括 收件箱:

子文件夹中的消息
{
  "changeType": "created",
  "notificationUrl": "https://webhookurl",
  "resource": "/users/{id}/mailFolders('Inbox')/messages",
  "expirationDateTime": "2020-04-03T11:00:00.0000000Z",
  "clientState": "SecretClientState"
}

但通知仅针对父 收件箱 文件夹。

How can I specify in a subscription to receive notifications for subfolders too?

为了接收所有消息的通知,您应该使用资源路径:/users/{id}/messages。这应该为用户邮箱中的所有邮件提供通知。