Namespace: microsoft.graph
Important
APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.
Reorder the sections in a user's teamwork. The sectionsOrder collection must contain every section ID returned by List sections, exactly once. If the collection contains the QuickViews system section, that section must be first.
Permissions
Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.
| Permission type |
Least privileged permissions |
Higher privileged permissions |
| Delegated (work or school account) |
TeamworkSection.ReadWrite |
Not available. |
| Delegated (personal Microsoft account) |
Not supported. |
Not supported. |
| Application |
TeamworkSection.ReadWrite.All |
Teamwork.Migrate.All |
HTTP request
POST /me/teamwork/sections/reorder
POST /users/{user-id}/teamwork/sections/reorder
| Header |
Value |
| Authorization |
****** Required. Learn more about authentication and authorization. |
| Content-Type |
application/json. Required. |
| If-Match |
The value of the @microsoft.graph.sectionsVersion annotation returned when you list sections, or the @odata.etag value from any previously retrieved section. Required for optimistic concurrency control. |
Request body
In the request body, supply a JSON representation of the parameters.
The following table lists the parameter that is required when you call this action.
| Parameter |
Type |
Description |
| sectionsOrder |
String collection |
The complete ordered list of section IDs. Include every section ID returned by List sections, exactly once. If the QuickViews system section is included, it must be the first ID. Required. |
Response
If successful, this action returns a 200 OK response code and a teamworkSection collection in the response body, in the requested order.
Note
Each returned section includes an updated @odata.etag value. Use this value as the If-Match header for any subsequent mutation operation.
The following errors are possible.
| Response code |
Message |
400 Bad Request |
The sectionsOrder property is missing, empty, exceeds the supported maximum, or contains null, empty, or duplicate IDs. |
400 Bad Request |
The reorder list doesn't contain every current section exactly once, contains an unknown section ID, or doesn't place the QuickViews system section first. |
404 Not Found |
The specified user wasn't found. |
409 Conflict |
A section in the reorder list was deleted concurrently with the reorder request. List sections again and retry with the current section IDs and version. |
412 Precondition Failed |
The If-Match header value doesn't match the current section hierarchy version. List sections again to retrieve the latest @microsoft.graph.sectionsVersion annotation and retry. |
428 Precondition Required |
The If-Match header is required for this operation. |
Examples
Request
The following example reorders three sections for a user.
POST https://graph.microsoft.com/beta/users/10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f/teamwork/sections/reorder
Content-Type: application/json
If-Match: "1742515200"
{
"sectionsOrder": [
"ce274158-f4f5-4ba7-bd18-0b2204dc1691~10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f~QuickViews",
"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"b2c3d4e5-f6a7-8901-bcde-f12345678901"
]
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Users.Item.Teamwork.Sections.Reorder;
var requestBody = new ReorderPostRequestBody
{
SectionsOrder = new List<string>
{
"ce274158-f4f5-4ba7-bd18-0b2204dc1691~10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f~QuickViews",
"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"b2c3d4e5-f6a7-8901-bcde-f12345678901",
},
};
// 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.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.ItemTeamworkSectionsReorderRequestBuilderPostRequestConfiguration{
Headers: headers,
}
requestBody := graphusers.NewReorderPostRequestBody()
sectionsOrder := []string {
"ce274158-f4f5-4ba7-bd18-0b2204dc1691~10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f~QuickViews",
"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"b2c3d4e5-f6a7-8901-bcde-f12345678901",
}
requestBody.SetSectionsOrder(sectionsOrder)
// 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().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.reorder.ReorderPostRequestBody reorderPostRequestBody = new com.microsoft.graph.beta.users.item.teamwork.sections.reorder.ReorderPostRequestBody();
LinkedList<String> sectionsOrder = new LinkedList<String>();
sectionsOrder.add("ce274158-f4f5-4ba7-bd18-0b2204dc1691~10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f~QuickViews");
sectionsOrder.add("a1b2c3d4-e5f6-7890-abcd-ef1234567890");
sectionsOrder.add("b2c3d4e5-f6a7-8901-bcde-f12345678901");
reorderPostRequestBody.setSectionsOrder(sectionsOrder);
var result = graphClient.users().byUserId("{user-id}").teamwork().sections().reorder().post(reorderPostRequestBody, requestConfiguration -> {
requestConfiguration.headers.add("If-Match", "\"1742515200\"");
});
const options = {
authProvider,
};
const client = Client.init(options);
const teamworkSection = {
sectionsOrder: [
'ce274158-f4f5-4ba7-bd18-0b2204dc1691~10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f~QuickViews',
'a1b2c3d4-e5f6-7890-abcd-ef1234567890',
'b2c3d4e5-f6a7-8901-bcde-f12345678901'
]
};
await client.api('/users/10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f/teamwork/sections/reorder')
.version('beta')
.post(teamworkSection);
<?php
use Microsoft\Graph\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\Generated\Users\Item\Teamwork\Sections\Reorder\ReorderRequestBuilderPostRequestConfiguration;
use Microsoft\Graph\Beta\Generated\Users\Item\Teamwork\Sections\Reorder\ReorderPostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new ReorderPostRequestBody();
$requestBody->setSectionsOrder(['ce274158-f4f5-4ba7-bd18-0b2204dc1691~10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f~QuickViews', 'a1b2c3d4-e5f6-7890-abcd-ef1234567890', 'b2c3d4e5-f6a7-8901-bcde-f12345678901', ]);
$requestConfiguration = new ReorderRequestBuilderPostRequestConfiguration();
$headers = [
'If-Match' => '"1742515200"',
];
$requestConfiguration->headers = $headers;
$result = $graphServiceClient->users()->byUserId('user-id')->teamwork()->sections()->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.reorder.reorder_request_builder import ReorderRequestBuilder
from kiota_abstractions.base_request_configuration import RequestConfiguration
from msgraph_beta.generated.users.item.teamwork.sections.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(
sections_order = [
"ce274158-f4f5-4ba7-bd18-0b2204dc1691~10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f~QuickViews",
"a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"b2c3d4e5-f6a7-8901-bcde-f12345678901",
],
)
request_configuration = RequestConfiguration()
request_configuration.headers.add("If-Match", "\"1742515200\"")
result = await graph_client.users.by_user_id('user-id').teamwork.sections.reorder.post(request_body, request_configuration = request_configuration)
Response
The following example shows the response.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"value": [
{
"@odata.type": "#microsoft.graph.teamworkSection",
"@odata.etag": "\"1742515210\"",
"id": "ce274158-f4f5-4ba7-bd18-0b2204dc1691~10f8c3a6-3e2a-4e8b-9c7d-5a4b6c8d9e0f~QuickViews",
"displayName": "QuickViews",
"sectionType": "systemDefined",
"sortType": "nameAlphabetical"
},
{
"@odata.type": "#microsoft.graph.teamworkSection",
"@odata.etag": "\"1742515210\"",
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"displayName": "Project Alpha",
"sectionType": "userDefined",
"sortType": "userDefinedCustomOrder"
},
{
"@odata.type": "#microsoft.graph.teamworkSection",
"@odata.etag": "\"1742515210\"",
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"displayName": "Customer Escalations",
"sectionType": "userDefined",
"sortType": "mostRecent"
}
]
}