Les API sous la version /beta dans Microsoft Graph sont susceptibles d’être modifiées. L’utilisation de ces API dans des applications de production n’est pas prise en charge. Pour déterminer si une API est disponible dans v1.0, utilisez le sélecteur Version .
L’une des autorisations suivantes est nécessaire pour appeler cette API. Pour plus d’informations, notamment sur la façon de choisir les autorisations, voir Autorisations.
Type d’autorisation
Autorisations (de celle qui offre le plus de privilèges à celle qui en offre le moins)
Déléguée (compte professionnel ou scolaire)
Tasks.ReadWrite
Déléguée (compte Microsoft personnel)
Tasks.ReadWrite
Application
Tasks.ReadWrite.All
Requête HTTP
POST /me/todo/lists
POST /users/{id|userPrincipalName}/todo/lists
POST https://graph.microsoft.com/beta/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.Beta.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 $v0.*
// Dependencies
import (
"context"
msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
graphmodels "github.com/microsoftgraph/msgraph-beta-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\Beta\GraphServiceClient;
use Microsoft\Graph\Beta\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.Beta.Users
$params = @{
displayName = "Travel items"
}
# A UPN can also be used as -UserId.
New-MgBetaUserTodoList -UserId $userId -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.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)