Microsoft Graph不会检索组的计划ID

问题描述 投票:1回答:1

使用POST /v1.0/groups与身体创建一个组后:

{
    "description": "hello",
    "displayName": "group_for_restore",
    "groupTypes": [
        "Unified"
    ],
    "mailEnabled": true,
    "mailNickname": "group_for_restore",
    "securityEnabled": false,
    "visibility": "Public"
}

GET /v1.0/groups/{group-id}/planner/plans的请求不会检索任何计划。

据我所知,创建一个集团后,也会创建一个计划。在Web界面上,您可以看到此计划已正确创建并显示,但它不会出现在JSON响应中:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(microsoft.graph.plannerPlan)",
    "@odata.count": 0,
    "value": []
}

在Web界面中单击后,您可以使用上面的请求轻松获取计划。

是否可以通过这些神奇的步骤来获取计划ID?

json microsoft-graph
1个回答
2
投票

Web App在您第一次尝试访问它时正在配置组计划。但是,通过API创建组时,您需要自己创建一个新计划:

POST https://graph.microsoft.com/v1.0/planner/plans
Content-type: application/json

{
  "owner": "group-id",
  "title": "title-value"
}

请记住documentation的这个重要说明:

创建新计划时,只需在计划对象上设置owner属性,即可将组作为其所有者。

© www.soinside.com 2019 - 2024. All rights reserved.