POST https://graph.microsoft.com/beta/me/outlook/tasks
Prefer: outlook.timezone="Pacific Standard Time"
Content-type: application/json
{
"subject": "Shop for children's weekend",
"startDateTime": {
"dateTime": "2016-05-03T09:00:00",
"timeZone": "Eastern Standard Time"
},
"dueDateTime": {
"dateTime": "2016-05-05T16:00:00",
"timeZone": "Eastern Standard Time"
}
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Beta.Models;
var requestBody = new OutlookTask
{
Subject = "Shop for children's weekend",
StartDateTime = new DateTimeTimeZone
{
DateTime = "2016-05-03T09:00:00",
TimeZone = "Eastern Standard Time",
},
DueDateTime = new DateTimeTimeZone
{
DateTime = "2016-05-05T16:00:00",
TimeZone = "Eastern Standard Time",
},
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
var result = await graphClient.Me.Outlook.Tasks.PostAsync(requestBody, (requestConfiguration) =>
{
requestConfiguration.Headers.Add("Prefer", "outlook.timezone=\"Pacific Standard Time\"");
});
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
// THE CLI IS IN PREVIEW. NON-PRODUCTION USE ONLY
mgc-beta users outlook tasks create --user-id {user-id} --body '{\
"subject": "Shop for children's weekend",\
"startDateTime": {\
"dateTime": "2016-05-03T09:00:00",\
"timeZone": "Eastern Standard Time"\
},\
"dueDateTime": {\
"dateTime": "2016-05-05T16:00:00",\
"timeZone": "Eastern Standard Time"\
}\
}\
'
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
OutlookTask outlookTask = new OutlookTask();
outlookTask.setSubject("Shop for children's weekend");
DateTimeTimeZone startDateTime = new DateTimeTimeZone();
startDateTime.setDateTime("2016-05-03T09:00:00");
startDateTime.setTimeZone("Eastern Standard Time");
outlookTask.setStartDateTime(startDateTime);
DateTimeTimeZone dueDateTime = new DateTimeTimeZone();
dueDateTime.setDateTime("2016-05-05T16:00:00");
dueDateTime.setTimeZone("Eastern Standard Time");
outlookTask.setDueDateTime(dueDateTime);
OutlookTask result = graphClient.me().outlook().tasks().post(outlookTask, requestConfiguration -> {
requestConfiguration.headers.add("Prefer", "outlook.timezone=\"Pacific Standard Time\"");
});
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Users\Item\Outlook\Tasks\TasksRequestBuilderPostRequestConfiguration;
use Microsoft\Graph\Generated\Models\OutlookTask;
use Microsoft\Graph\Generated\Models\DateTimeTimeZone;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new OutlookTask();
$requestBody->setSubject('Shop for children\'s weekend');
$startDateTime = new DateTimeTimeZone();
$startDateTime->setDateTime('2016-05-03T09:00:00');
$startDateTime->setTimeZone('Eastern Standard Time');
$requestBody->setStartDateTime($startDateTime);
$dueDateTime = new DateTimeTimeZone();
$dueDateTime->setDateTime('2016-05-05T16:00:00');
$dueDateTime->setTimeZone('Eastern Standard Time');
$requestBody->setDueDateTime($dueDateTime);
$requestConfiguration = new TasksRequestBuilderPostRequestConfiguration();
$headers = [
'Prefer' => 'outlook.timezone="Pacific Standard Time"',
];
$requestConfiguration->headers = $headers;
$result = $graphServiceClient->me()->outlook()->tasks()->post($requestBody, $requestConfiguration)->wait();
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
Import-Module Microsoft.Graph.Beta.Users
$params = @{
subject = "Shop for children's weekend"
startDateTime = @{
dateTime = "2016-05-03T09:00:00"
timeZone = "Eastern Standard Time"
}
dueDateTime = @{
dateTime = "2016-05-05T16:00:00"
timeZone = "Eastern Standard Time"
}
}
# A UPN can also be used as -UserId.
New-MgBetaUserOutlookTask -UserId $userId -BodyParameter $params
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。
from msgraph import GraphServiceClient
from msgraph.generated.users.item.outlook.tasks.tasks_request_builder import TasksRequestBuilder
from msgraph.generated.models.outlook_task import OutlookTask
from msgraph.generated.models.date_time_time_zone import DateTimeTimeZone
graph_client = GraphServiceClient(credentials, scopes)
request_body = OutlookTask(
subject = "Shop for children's weekend",
start_date_time = DateTimeTimeZone(
date_time = "2016-05-03T09:00:00",
time_zone = "Eastern Standard Time",
),
due_date_time = DateTimeTimeZone(
date_time = "2016-05-05T16:00:00",
time_zone = "Eastern Standard Time",
),
)
request_configuration = TasksRequestBuilder.TasksRequestBuilderPostRequestConfiguration()
request_configuration.headers.add("Prefer", "outlook.timezone=\"Pacific Standard Time\"")
result = await graph_client.me.outlook.tasks.post(request_body, request_configuration = request_configuration)
重要
Microsoft Graph SDK では、既定で v1.0 バージョンの API が使用され、ベータ版で使用可能なすべての型、プロパティ、API がサポートされているわけではありません。 SDK を使用してベータ API にアクセスする方法の詳細については、「ベータ API で Microsoft Graph SDK を使用する」を参照してください。