名前空間: microsoft.graph
重要
Microsoft Graph の /beta バージョンの API は変更される可能性があります。 実稼働アプリケーションでこれらの API を使用することは、サポートされていません。 v1.0 で API を使用できるかどうかを確認するには、Version セレクターを使用します。
ユーザーのチームワークのユーザー定義セクション内の項目を並べ替えます。 セクションでは sortType を userDefinedCustomOrder に設定する必要があります。 itemsOrder コレクションには、 リスト アイテムによって返されるすべてのアイテム ID を 1 回だけ含める必要があります。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス |
米国政府機関 L4 |
米国政府機関 L5 (DOD) |
21Vianet が運営する中国 |
| ✅ |
❌ |
❌ |
❌ |
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。
アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 |
最小特権アクセス許可 |
より高い特権のアクセス許可 |
| 委任 (職場または学校のアカウント) |
TeamworkSection.ReadWrite |
注意事項なし。 |
| 委任 (個人用 Microsoft アカウント) |
サポートされていません。 |
サポートされていません。 |
| アプリケーション |
TeamworkSection.ReadWrite.All |
Teamwork.Migrate.All |
HTTP 要求
POST /me/teamwork/sections/{teamworkSection-id}/items/reorder
POST /users/{user-id}/teamwork/sections/{teamworkSection-id}/items/reorder
| ヘッダー |
値 |
| Authorization |
必須。
認証と認可についての詳細をご覧ください。 |
| Content-Type |
application/json. Required. |
| If-Match |
セクションを一覧表示するときに返される @microsoft.graph.sectionsVersion 注釈の値、または以前に取得したセクションの @odata.etag 値。 オプティミスティック同時実行制御に必要です。 |
要求本文
要求本文で、パラメーターの JSON 表現を指定します。
次の表に、このアクションを呼び出すときに必要なパラメータを示します。
| パラメーター |
型 |
説明 |
| itemsOrder |
String collection |
セクション内の項目 ID の完全な順序付きリスト。
リスト アイテムによって返されるすべての ID を 1 回だけ含めます。 必須です。 |
応答
成功した場合、このアクションは要求された順序で、 200 OK 応答コードと teamworkSectionItem コレクションを応答本文で返します。
注:
返される各項目には、更新された @odata.etag 値が含まれます。 この値は、後続の変更操作の If-Match ヘッダーとして使用します。
次のエラーが発生する可能性があります。
| 応答コード |
メッセージ |
400 Bad Request |
itemsOrder プロパティが見つからないか、空であるか、サポートされている最大値を超えているか、ID が null、空、または重複しています。 |
400 Bad Request |
並べ替えリストには、セクション内のすべてのアイテムが 1 回だけ含まれているわけではないか、セクションにないアイテム ID が含まれています。 |
403 Forbidden |
このセクションはシステムによって生成されたものであり、変更できません。 ユーザー定義セクション内の項目のみを並べ替えます。 |
404 Not Found |
指定されたセクションが見つかりませんでした。 |
409 Conflict |
並べ替えは、セクション sortType が userDefinedCustomOrder の場合にのみサポートされます。 この並べ替えの種類を使用するようにセクションを更新してから、再試行してください。 |
409 Conflict |
ターゲット セクションは、再注文要求と同時に削除されました。
セクションを再度一覧表示 し、現在のセクション ID とバージョンで再試行します。 |
412 Precondition Failed |
If-Match ヘッダー値が現在のセクション階層バージョンと一致しません。 セクションを再度一覧表示して、最新の @microsoft.graph.sectionsVersion 注釈を取得して再試行します。 |
428 Precondition Required |
この操作には If-Match ヘッダーが必要です。 |
例
要求
次の例では、"Project Alpha" セクションの 3 つの項目を並べ替えます。
POST https://graph.microsoft.com/beta/users/10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f/teamwork/sections/a1b2c3d4-e5f6-7890-abcd-ef1234567890/items/reorder
Content-Type: application/json
If-Match: "1742515200"
{
"itemsOrder": [
"19:meeting_MTUxMjg0OGItZTY3MC00NTkyLTg1NzMtZTVkZTcyZDU5ZGVi@thread.v2",
"19:978e3806-38a4-4104-a07f-57abfa8cdf9a_bdf9c93b-12ea-4e8f-8383-d0ca66d5ff48@unq.gbl.spaces",
"19:94961b6eacc04e2392e34709c66cb610@thread.v2"
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Users.Item.Teamwork.Sections.Item.Items.Reorder;
var requestBody = new ReorderPostRequestBody
{
ItemsOrder = new List<string>
{
"19:meeting_MTUxMjg0OGItZTY3MC00NTkyLTg1NzMtZTVkZTcyZDU5ZGVi@thread.v2",
"19:978e3806-38a4-4104-a07f-57abfa8cdf9a_bdf9c93b-12ea-4e8f-8383-d0ca66d5ff48@unq.gbl.spaces",
"19:94961b6eacc04e2392e34709c66cb610@thread.v2",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Users["{user-id}"].Teamwork.Sections["{teamworkSection-id}"].Items.Reorder.PostAsReorderPostResponseAsync(requestBody, (requestConfiguration) =>
{
requestConfiguration.Headers.Add("If-Match", "\"1742515200\"");
});
// Code snippets are only available for the latest major version. Current major version is $v0.*
// Dependencies
import (
"context"
abstractions "github.com/microsoft/kiota-abstractions-go"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphusers "github.com/microsoftgraph/msgraph-beta-sdk-go/users"
//other-imports
)
headers := abstractions.NewRequestHeaders()
headers.Add("If-Match", "\"1742515200\"")
configuration := &graphusers.ItemTeamworkSectionsItemItemsReorderRequestBuilderPostRequestConfiguration{
Headers: headers,
}
requestBody := graphusers.NewReorderPostRequestBody()
itemsOrder := []string {
"19:meeting_MTUxMjg0OGItZTY3MC00NTkyLTg1NzMtZTVkZTcyZDU5ZGVi@thread.v2",
"19:978e3806-38a4-4104-a07f-57abfa8cdf9a_bdf9c93b-12ea-4e8f-8383-d0ca66d5ff48@unq.gbl.spaces",
"19:94961b6eacc04e2392e34709c66cb610@thread.v2",
}
requestBody.SetItemsOrder(itemsOrder)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
reorder, err := graphClient.Users().ByUserId("user-id").Teamwork().Sections().ByTeamworkSectionId("teamworkSection-id").Items().Reorder().PostAsReorderPostResponse(context.Background(), requestBody, configuration)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.beta.users.item.teamwork.sections.item.items.reorder.ReorderPostRequestBody reorderPostRequestBody = new com.microsoft.graph.beta.users.item.teamwork.sections.item.items.reorder.ReorderPostRequestBody();
LinkedList<String> itemsOrder = new LinkedList<String>();
itemsOrder.add("19:meeting_MTUxMjg0OGItZTY3MC00NTkyLTg1NzMtZTVkZTcyZDU5ZGVi@thread.v2");
itemsOrder.add("19:978e3806-38a4-4104-a07f-57abfa8cdf9a_bdf9c93b-12ea-4e8f-8383-d0ca66d5ff48@unq.gbl.spaces");
itemsOrder.add("19:94961b6eacc04e2392e34709c66cb610@thread.v2");
reorderPostRequestBody.setItemsOrder(itemsOrder);
var result = graphClient.users().byUserId("{user-id}").teamwork().sections().byTeamworkSectionId("{teamworkSection-id}").items().reorder().post(reorderPostRequestBody, requestConfiguration -> {
requestConfiguration.headers.add("If-Match", "\"1742515200\"");
});
const options = {
authProvider,
};
const client = Client.init(options);
const teamworkSectionItem = {
itemsOrder: [
'19:meeting_MTUxMjg0OGItZTY3MC00NTkyLTg1NzMtZTVkZTcyZDU5ZGVi@thread.v2',
'19:978e3806-38a4-4104-a07f-57abfa8cdf9a_bdf9c93b-12ea-4e8f-8383-d0ca66d5ff48@unq.gbl.spaces',
'19:94961b6eacc04e2392e34709c66cb610@thread.v2'
]
};
await client.api('/users/10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f/teamwork/sections/a1b2c3d4-e5f6-7890-abcd-ef1234567890/items/reorder')
.version('beta')
.post(teamworkSectionItem);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Users\Item\Teamwork\Sections\Item\Items\Reorder\ReorderRequestBuilderPostRequestConfiguration;
use Microsoft\Graph\Beta\Generated\Users\Item\Teamwork\Sections\Item\Items\Reorder\ReorderPostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ReorderPostRequestBody();
$requestBody->setItemsOrder(['19:meeting_MTUxMjg0OGItZTY3MC00NTkyLTg1NzMtZTVkZTcyZDU5ZGVi@thread.v2', '19:978e3806-38a4-4104-a07f-57abfa8cdf9a_bdf9c93b-12ea-4e8f-8383-d0ca66d5ff48@unq.gbl.spaces', '19:94961b6eacc04e2392e34709c66cb610@thread.v2', ]);
$requestConfiguration = new ReorderRequestBuilderPostRequestConfiguration();
$headers = [
'If-Match' => '"1742515200"',
];
$requestConfiguration->headers = $headers;
$result = $graphServiceClient->users()->byUserId('user-id')->teamwork()->sections()->byTeamworkSectionId('teamworkSection-id')->items()->reorder()->post($requestBody, $requestConfiguration)->wait();
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph_beta import GraphServiceClient
from msgraph_beta.generated.users.item.teamwork.sections.item.items.reorder.reorder_request_builder import ReorderRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
from msgraph_beta.generated.users.item.teamwork.sections.item.items.reorder.reorder_post_request_body import ReorderPostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = ReorderPostRequestBody(
items_order = [
"19:meeting_MTUxMjg0OGItZTY3MC00NTkyLTg1NzMtZTVkZTcyZDU5ZGVi@thread.v2",
"19:978e3806-38a4-4104-a07f-57abfa8cdf9a_bdf9c93b-12ea-4e8f-8383-d0ca66d5ff48@unq.gbl.spaces",
"19:94961b6eacc04e2392e34709c66cb610@thread.v2",
],
)
request_configuration = RequestConfiguration()
request_configuration.headers.add("If-Match", "\"1742515200\"")
result = await graph_client.users.by_user_id('user-id').teamwork.sections.by_teamwork_section_id('teamworkSection-id').items.reorder.post(request_body, request_configuration = request_configuration)
応答
次の例は応答を示しています。
注: ここに示す応答オブジェクトは、読みやすさのために短縮されている場合があります。
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.teamworkSectionItem",
"@odata.etag": "\"1742515210\"",
"id": "19:meeting_MTUxMjg0OGItZTY3MC00NTkyLTg1NzMtZTVkZTcyZDU5ZGVi@thread.v2",
"itemType": "meeting",
"lastModifiedDateTime": "2026-08-06T14:40:00Z"
},
{
"@odata.type": "#microsoft.graph.teamworkSectionItem",
"@odata.etag": "\"1742515210\"",
"id": "19:978e3806-38a4-4104-a07f-57abfa8cdf9a_bdf9c93b-12ea-4e8f-8383-d0ca66d5ff48@unq.gbl.spaces",
"itemType": "channel",
"lastModifiedDateTime": "2026-08-06T14:40:00Z"
},
{
"@odata.type": "#microsoft.graph.teamworkSectionItem",
"@odata.etag": "\"1742515210\"",
"id": "19:94961b6eacc04e2392e34709c66cb610@thread.v2",
"itemType": "chat",
"lastModifiedDateTime": "2026-08-06T14:40:00Z"
}
]
}