【发布时间】:2020-12-22 15:39:26
【问题描述】:
我在通过 Microsoft Graph API 将 security 组(通过 API 创建)更新为 mail enabled 安全组时遇到错误。
{
"error": {
"code": "Request_BadRequest",
"message": "The service does not currently support writes of mail-enabled groups. Please ensure that the mail-enablement property is unset and the security-enablement property is set.",
"innerError": {
"request-id": "34bc9a4d-9e52-4c2e-b847-99f8dbf43518",
"date": "2018-04-09T13:05:10"
},
"details": [
{
"target": "mailEnabled",
"code": "InvalidValue"
}
]
}
}
根据https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/group_update#request-body 文档,我相信有一个启用邮件功能的安全组是可能的。
这是原始请求(通过 Fiddler 捕获)。
PATCH https://graph.microsoft.com/v1.0/groups<<groupId>> HTTP/1.1
Accept: application/json
Authorization: Bearer <<Authorization Token>>
Content-Type: application/json; charset=utf-8
Host: graph.microsoft.com
Content-Length: 96
Expect: 100-continue
Connection: Keep-Alive
{"mailEnabled":true,"mailNickname":"<<mailNickName>>"}
请建议请求是否需要以不同的格式形成?
【问题讨论】: