共享邮箱中的图形补丁类别

发布于 2025-01-23 06:54:23 字数 983 浏览 1 评论 0原文

我正在尝试通过MS Graph从Outlook Addin设置邮件类别。 当我调用用户邮箱的补丁程序时,这就像Charme一样工作。像这样:

补丁https://graph.microsoft.com/v1.0/users/ {some-users-mail-address}/message/{message -id-id-to-to-to-categorize}

如果我改用共享邮箱,我会收到错误403。 我已经添加了许可:

Mail.ReadWrite 
Application 
Read and write mail in all mailboxes

这应该足够了,对吗?从描述中,我希望这也包括共享的邮箱。

我发现有一个委派的权限mail.readwrite.shared,但是我无法使用它,因为我不在用户的上下文中,也不能作为应用程序许可。

发现了这一点: 生成的图表不是能够访问Graph API以读取共享的邮箱消息 所有范围均给予管理员同意。

编辑:如果我检查令牌时,湿婆keshav varma建议它打印:

"aud": "https://graph.microsoft.com",
"idtyp": "app",
"roles": [
  "Mail.ReadWrite",
  "User.ReadWrite.All",
  "Directory.Read.All",
  "User.Read.All",
  "Mail.Read",
  "MailboxSettings.ReadWrite"
],
"ver": "1.0",

I am trying to set mail categories from an Outlook AddIn, via MS Graph.
When I call the PATCH for a users mailbox, this is working like a charme. Like this:

PATCH https://graph.microsoft.com/v1.0/users/{some-users-mail-address}/messages/{message-id-to-categorize}

If I use a share mailbox instead I get an error 403.
I already added the permission:

Mail.ReadWrite 
Application 
Read and write mail in all mailboxes

This should be enough, right? From the description, I'd expect this to include the shared mailboxes, too.

I found there is a delegated permission Mail.ReadWrite.Shared, but I cannot use it since I am not in a context with a user and is not selectable as application permission.

Found this:
Generated token is not able to access Graph APi to read shared mailbox messages
Admin consent is given for all scopes.

EDIT: If I check the token as Shiva Keshav Varma suggested it prints:

"aud": "https://graph.microsoft.com",
"idtyp": "app",
"roles": [
  "Mail.ReadWrite",
  "User.ReadWrite.All",
  "Directory.Read.All",
  "User.Read.All",
  "Mail.Read",
  "MailboxSettings.ReadWrite"
],
"ver": "1.0",

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文