[英]MS Graph API Group which contains a Plan
Basically I want to know which group contains the plan I am using.基本上我想知道哪个组包含我正在使用的计划。 I know how to get which plans are in a group:
我知道如何获得一组中的计划:
GET https://graph.microsoft.com/v1.0/groups/{group-id}/planner/plans
But not, given a plan, how to know which group contains it.但不是,给定一个计划,如何知道哪个组包含它。
Why do I need it?为什么我需要它? Because I have a plan, with its planner tasks, and I want to add a comment in it programatically.
因为我有一个计划,它有计划任务,我想以编程方式在其中添加评论。 To add a comment we must do this:
要添加评论,我们必须这样做:
POST /groups/{id}/conversations/{id}/threads
So, I need the GroupId, but I only have the PlanId (well, and the Plan object).所以,我需要 GroupId,但我只有 PlanId(嗯,还有 Plan 对象)。
Does anybody know how can I get the GroupId from the Plan?有人知道如何从计划中获取 GroupId 吗?
Thank you谢谢
In Beta, Plan has a container
property.在 Beta 中,Plan 有一个
container
属性。 Looking at that you can tell when the Plan is in a group (vs. something else) and the id of the group.查看它,您可以知道计划何时在组中(相对于其他内容)以及组的 ID。 You also get the URL to the group itself.
您还可以将 URL 发送给群组本身。 Reference: https://learn.microsoft.com/en-us/graph/api/resources/plannerplan?view=graph-rest-beta https://learn.microsoft.com/en-us/graph/api/resources/plannerplancontainer?view=graph-rest-beta
参考: https://learn.microsoft.com/en-us/graph/api/resources/plannerplan?view=graph-rest-beta https://learn.microsoft.com/en-us/graph/api/resources /plannerplancontainer?view=graph-rest-beta
In V1.在 V1. The group id is available in the
owner
property of the plan.组 ID 在计划的
owner
属性中可用。 However, please note that we're deprecating this property in favor of the container
property from beta, since a single id is not capable of expressing different kinds of objects that can contain a Plan anymore.但是,请注意,我们正在弃用此属性以支持 beta 中的
container
属性,因为单个 id 不再能够表达可以包含计划的不同类型的对象。 So I'd highly recommend using the beta API for the Plan, and not take a dependency on the owner
.所以我强烈建议使用测试版 API 作为计划,而不是依赖
owner
。 In V1, if the plan is not contained by a group, trying to get a group with the value of owner
property will result in a 404.在 V1 中,如果计划不包含在组中,则尝试获取具有
owner
属性值的组将导致 404。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.