命名空间:microsoft.graph
重要
Microsoft Graph /beta
版本下的 API 可能会发生更改。 不支持在生产应用程序中使用这些 API。 若要确定 API 是否在 v1.0 中可用,请使用 版本 选择器。
取消存档 plannerPlan 对象。 取消存档计划,还会取消存档 计划中的 plannerTasks 和 plannerBuckets 。
只有 存档 的计划才能取消存档。
此 API 可用于以下国家级云部署。
全局服务 |
美国政府 L4 |
美国政府 L5 (DOD) |
由世纪互联运营的中国 |
✅ |
✅ |
✅ |
❌ |
权限
要调用此 API,需要以下权限之一。 若要了解详细信息,包括如何选择权限的信息,请参阅权限。
权限类型 |
最低特权权限 |
更高特权权限 |
委派(工作或学校帐户) |
Tasks.ReadWrite |
不可用。 |
委派(个人 Microsoft 帐户) |
不支持。 |
不支持。 |
应用程序 |
Tasks.ReadWrite.All |
不可用。 |
HTTP 请求
POST /planner/plans/{planId}/unarchive
名称 |
说明 |
Authorization |
持有者 {token}。 必填。 |
Content-Type |
application/json. 必需。 |
If-Match |
要取消存档 plannerPlan 的最后已知 ETag 值。 必填。 |
请求正文
在请求正文中,提供参数的 JSON 表示形式。
下表列出了调用此操作时所需的参数。
参数 |
类型 |
说明 |
理由 |
String |
取消计划存档的原因。 |
响应
如果成功,此操作返回 204 No Content
响应代码。
此方法可以返回任何 HTTP 状态代码。 应用应对此方法处理的最常见错误是 400 和 403 响应。 有关这些错误的详细信息,请参阅 Common Planner 错误条件。
示例
请求
以下示例显示了一个请求。
POST https://graph.microsoft.com/beta/planner/plans/{planId}/unarchive
Content-Type: application/json
{
"justification": "String"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Planner.Plans.Item.Unarchive;
var requestBody = new UnarchivePostRequestBody
{
Justification = "String",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Planner.Plans["{plannerPlan-id}"].Unarchive.PostAsync(requestBody);
mgc-beta planner plans unarchive post --planner-plan-id {plannerPlan-id} --body '{\
"justification": "String"\
}\
'
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphplanner "github.com/microsoftgraph/msgraph-beta-sdk-go/planner"
//other-imports
)
requestBody := graphplanner.NewUnarchivePostRequestBody()
justification := "String"
requestBody.SetJustification(&justification)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Planner().Plans().ByPlannerPlanId("plannerPlan-id").Unarchive().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.planner.plans.item.unarchive.UnarchivePostRequestBody unarchivePostRequestBody = new com.microsoft.graph.beta.planner.plans.item.unarchive.UnarchivePostRequestBody();
unarchivePostRequestBody.setJustification("String");
graphClient.planner().plans().byPlannerPlanId("{plannerPlan-id}").unarchive().post(unarchivePostRequestBody);
const options = {
authProvider,
};
const client = Client.init(options);
const unarchive = {
justification: 'String'
};
await client.api('/planner/plans/{planId}/unarchive')
.version('beta')
.post(unarchive);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Planner\Plans\Item\Unarchive\UnarchivePostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new UnarchivePostRequestBody();
$requestBody->setJustification('String');
$graphServiceClient->planner()->plans()->byPlannerPlanId('plannerPlan-id')->unarchive()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Beta.Planner
$params = @{
justification = "String"
}
Invoke-MgBetaUnarchivePlannerPlan -PlannerPlanId $plannerPlanId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.planner.plans.item.unarchive.unarchive_post_request_body import UnarchivePostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = UnarchivePostRequestBody(
justification = "String",
)
await graph_client.planner.plans.by_planner_plan_id('plannerPlan-id').unarchive.post(request_body)
响应
以下示例显示了相应的响应。
注意:为了提高可读性,可能缩短了此处显示的响应对象。
HTTP/1.1 204 No Content