修补共享收件箱中的邮件不起作用



我的用例是,我想创建一个从共享收件箱读取消息的应用程序,然后我可以将用户分配给消息。为此,我添加了一个schemaExtension for Messages

POST https://graph.microsoft.com/v1.0/schemaExtensions
{
"id":"message_responsibility",
"description": "Sets a users email to a message to indicate a messages responsibility",
"targetTypes": [
"Message"
],
"owner": "<redacted>",
"properties": [
{
"name": "responsibility",
"type": "String"
},
]
}

在创建schemaExtension之后,我使它可用:

PATCH https://graph.microsoft.com/v1.0/schemaExtensions/{id}
{
"status": "Available",
"owner": "<redacted>",
}

然后,我尝试将责任添加到共享收件箱中的现有邮件中:

POST https://graph.microsoft.com/v1.0/users('shared@inbox.com')/messages/<messageId>
{
"extr5f2qmdk_responsibility": {
"responsibility": "someone@inbox.com"
}
}

但我得到的只是这样的回应:

{
"error": {
"code": "ErrorAccessDenied",
"message": "Access is denied. Check credentials and try again.",
"innerError": {
"request-id": "73cc3cb2-37e4-4003-833b-b2348804c045",
"date": "2018-11-28T10:50:36"
}
}
}

甚至试图用$select语句,将使返回服务器错误500:

https://graph.microsoft.com/v1.0/users('shared@inbox.com')/messages?$select=extr5f2qmdk_responsibility

非常感谢任何帮助

根据您的描述,我假设您想为消息资源创建一个schemaExtensions。

根据您发布的错误响应,您没有正确的权限。在此文档中,权限应为Delegated (work or school account) Directory.AccessAsUser.All

其次,您已经创建了一个名为responsibility的schemaExtensions,但是,当您添加一个名称为extr5f2qmdk_responsibility的架构扩展时

最新更新