未收到已发送邮件文件夹的 Webhook 通知

Not getting Webhook Notifications for Sent Items folder

我正在使用 MS Graph API 设置一个网络挂钩,当消息到达用户的收件箱或已发送文件夹时通知我们的应用程序。收件箱通知效果很好,但我似乎无法收到发件箱或已发送邮件的通知。我正在使用以下代码获取有效的订阅 ID。我只是不确定为什么我没有看到任何通知。

        {
          "changeType": "created",
          "notificationUrl": "{myPath}",
          "resource": "/me/mailfolders('Sent Items')/messages",
          "expirationDateTime": "{myExp}",
          "clientState": "{usrEmail}"
        }

另外,是否可以一次订阅监控 2 个文件夹?通过做这样的事情...

        { 
          "changeType": "created",
          "notificationUrl": "{myPath}",
          "resource": "/me/mailfolders('Inbox','Sent Items')/messages",
          "expirationDateTime": "{myExp}",
          "clientState": "{usrEmail}"
        }

我也遇到了这个麻烦,不过我找到了解决办法: 在的官方文档中 mailFolder resource typeid 的描述 属性:

The mailFolder's unique identifier. You can use the following well-known names to access the corresponding folder: Inbox, Drafts, SentItems, DeletedItems.

通过实验方式,我找到了邮件文件夹的下一个工作 ID:

Inbox
Drafts
SentItems
DeletedItems
JunkEmail