我正在尝试使用图表创建一个规划器计划 http://graph.microsoft.io/en-us/docs/api-reference/beta/api/user_post_plans
但我始终收到以下 BadRequest 响应:
"error": {
"code": "BadRequest",
"message": "Write requests are only supported on contained entities",
"innerError": {
"request-id": "eae08944-6f47-477e-9950-ade31c473dd7",
"date": "2016-03-07T11:59:04"
}
根据我发布到 https://graph.microsoft.com/beta/me/plans 的文档具有以下主体:
"createdBy": "<my uuid>",
"owner": "<a previously generated group uuid>",
"title": "Blah Plan"
没有运气。之前生成的组如下所示:
{
"id": "<uuid>",
"classification": null,
"createdDateTime": "2016-03-07T09:53:26Z",
"description": "Int Test",
"displayName": "Int Test",
"groupTypes": [
"Unified"
],
"mail": "<email_address>",
"mailEnabled": true,
"mailNickname": "IntTest",
"onPremisesLastSyncDateTime": null,
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"proxyAddresses": [
"SMTP:<email_address>"
],
"renewedDateTime": "2016-03-07T09:53:26Z",
"securityEnabled": false,
"visibility": "Public"
}
我尝试了请求主体的各种组合。有和没有createdBy值。有或没有所有者值(value)。似乎没有任何作用。
有什么想法我哪里出错了吗?该错误在我的集成测试以及图形浏览器中都是一致的。
谢谢
最佳答案
正如 Sriram 提到的,这是一个文档错误。它刚刚被修复。更新后的网址为:https://graph.microsoft.io/en-us/docs/api-reference/beta/api/plan_post_plans
问题在于调用哪个端点来创建计划。 您应该调用“/plans”而不是“/me/plans”。您还应该注意,您传入的某些数据是只读的。您不应包含“createdBy”,因为这是由服务而不是您设置的只读属性。 plan resource documentation将向您显示可以在计划中设置的所有属性。
最后要记住的是,每个组只能有一个计划。如果您尝试制定第二个计划,您将从 API 收到有关此问题的错误。
关于microsoft-graph-api - 创建计划(BETA)似乎不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35843556/