有没有一种方法可以使用Graph API创建订阅到另一个用户的邮箱?

huangapple go评论54阅读模式
英文:

Is there a way to create a subscription to another user's mailbox using Graph API?

问题

我已阅读了官方的Graph API文档,根据我了解的情况,似乎没有直接的方法可以使用Microsoft Graph API创建订阅以跟踪另一个用户的Outlook邮箱中的传入邮件/消息,只能针对已登录用户的邮箱进行操作。
请问是否能提供一些关于是否有可能完成上述任务以及是否有相关文档的见解?

英文:

I've gone thorugh the official Graph API documentation, and from what I've gathered, there is no direct way to create a subscription to another user's Outlook mailbox using the Microsoft Graph API, to keep track of incoming mails/messages, but is only possible for the signed-in user's mailbox.
Could I be given any insights on whether there's a way to do the aforesaid task and if its documented anywhere?

答案1

得分: 1

如果您使用委托权限,那么是正确的,您只能订阅已登录用户的邮箱。如果您使用应用程序权限https://learn.microsoft.com/en-us/graph/outlook-share-messages-folders

请注意,这两个权限不支持订阅共享或委托文件夹中项目的更改通知。要在租户中的共享、委托或任何其他用户的邮件文件夹中设置更改通知订阅,请使用应用程序权限Mail.Read。

然后它将正常工作。您可以在共享文件夹上执行Delta操作,例如https://graph.microsoft.com/v1.0/users/shared@mailbox.com/mailfolders/inbox/messages/delta,然后定期轮询它。

英文:

If your using delegate permissions than that's correct, you can only subscribe to the signed in user's mailbox. If you use Application permissions https://learn.microsoft.com/en-us/graph/outlook-share-messages-folders

> Note that those two permissions do not support subscribing to change notifications on items in shared or delegated folders. To set up change notification subscriptions on messages in a shared, delegated, or any other user's mail folder in the tenant, use the application permission, Mail.Read.

Then it will work okay. You can do Delta's on a shared folder eg https://graph.microsoft.com/v1.0/users/shared@mailbox.com/mailfolders/inbox/messages/delta and then poll it at intervals .

huangapple
  • 本文由 发表于 2023年7月17日 18:34:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/76703615.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定