POST https://graph.microsoft.com/v1.0/me/calendars
Content-type: application/json
{
"name": "Volunteer"
}
// Code snippets are only available for the latest version. Current version is 5.x
var graphClient = new GraphServiceClient(requestAdapter);
var requestBody = new Calendar
{
Name = "Volunteer",
};
var result = await graphClient.Me.Calendars.PostAsync(requestBody);
<?php
// THIS SNIPPET IS A PREVIEW VERSION OF THE SDK. NON-PRODUCTION USE ONLY
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new Calendar();
$requestBody->setName('Volunteer');
$result = $graphServiceClient->me()->calendars()->post($requestBody)->wait();
Import-Module Microsoft.Graph.Calendar
$params = @{
name = "Volunteer"
}
# A UPN can also be used as -UserId.
New-MgUserCalendar -UserId $userId -BodyParameter $params
# THE PYTHON SDK IS IN PREVIEW. FOR NON-PRODUCTION USE ONLY
graph_client = GraphServiceClient(request_adapter)
request_body = Calendar(
name = "Volunteer",
)
result = await graph_client.me.calendars.post(body = request_body)