Eine der nachfolgenden Berechtigungen ist erforderlich, um diese API aufrufen zu können. Weitere Informationen, unter anderem zur Auswahl von Berechtigungen, finden Sie unter Berechtigungen.
Berechtigungstyp
Berechtigungen (von der Berechtigung mit den wenigsten Rechten zu der mit den meisten Rechten)
Delegiert (Geschäfts-, Schul- oder Unikonto)
Tasks.ReadWrite
Delegiert (persönliches Microsoft-Konto)
Tasks.ReadWrite
Anwendung
Tasks.ReadWrite.All
HTTP-Anforderung
POST /me/todo/lists
POST /users/{id|userPrincipalName}/todo/lists
POST https://graph.microsoft.com/v1.0/me/todo/lists
Content-Type: application/json
{
"displayName": "Travel items"
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Models;
var requestBody = new TodoTaskList
{
DisplayName = "Travel items",
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.Todo.Lists.PostAsync(requestBody);
// Code snippets are only available for the latest major version. Current major version is $v1.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-sdk-go/models"
//other-imports
)
requestBody := graphmodels.NewTodoTaskList()
displayName := "Travel items"
requestBody.SetDisplayName(&displayName)
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
lists, err := graphClient.Me().Todo().Lists().Post(context.Background(), requestBody, nil)
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
TodoTaskList todoTaskList = new TodoTaskList();
todoTaskList.setDisplayName("Travel items");
TodoTaskList result = graphClient.me().todo().lists().post(todoTaskList);
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Models\TodoTaskList;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new TodoTaskList();
$requestBody->setDisplayName('Travel items');
$result = $graphServiceClient->me()->todo()->lists()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Users
$params = @{
displayName = "Travel items"
}
# A UPN can also be used as -UserId.
New-MgUserTodoList -UserId $userId -BodyParameter $params
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.models.todo_task_list import TodoTaskList
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = TodoTaskList(
display_name = "Travel items",
)
result = await graph_client.me.todo.lists.post(request_body)