この API を呼び出すには、次のいずれかのアクセス許可が必要です。アクセス許可の選択方法などの詳細については、「アクセス許可」を参照してください。
アクセス許可の種類
アクセス許可 (特権の小さいものから大きいものへ)
委任 (職場または学校のアカウント)
Calendars.ReadWrite
委任 (個人用 Microsoft アカウント)
Calendars.ReadWrite
アプリケーション
Calendars.ReadWrite
HTTP 要求
POST /me/events/{id}/cancel
POST /users/{id | userPrincipalName}/events/{id}/cancel
POST /groups/{id}/events/{id}/cancel
POST /me/calendar/events/{id}/cancel
POST /users/{id | userPrincipalName}/calendar/events/{id}/cancel
POST /groups/{id}/calendar/events/{id}/cancel
POST /me/calendars/{id}/events/{id}/cancel
POST /users/{id | userPrincipalName}/calendars/{id}/events/{id}/cancel
POST /me/calendargroups/{id}/calendars/{id}/events/{id}/cancel
POST /users/{id | userPrincipalName}/calendargroups/{id}/calendars/{id}/events/{id}/cancel
POST https://graph.microsoft.com/v1.0/me/events/{id}/cancel
Content-type: application/json
{
"Comment": "Cancelling for this week due to all hands"
}
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var comment = "Cancelling for this week due to all hands";
await graphClient.Me.Events["{event-id}"]
.Cancel(comment)
.Request()
.PostAsync();
GraphServiceClient graphClient = GraphServiceClient.builder().authenticationProvider( authProvider ).buildClient();
String comment = "Cancelling for this week due to all hands";
graphClient.me().events("{id}")
.cancel(EventCancelParameterSet
.newBuilder()
.withComment(comment)
.build())
.buildRequest()
.post();
//THE GO SDK IS IN PREVIEW. NON-PRODUCTION USE ONLY
graphClient := msgraphsdk.NewGraphServiceClient(requestAdapter)
requestBody := msgraphsdk.NewCommentRequestBody()
comment := "Cancelling for this week due to all hands"
requestBody.SetComment(&comment)
eventId := "event-id"
graphClient.Me().EventsById(&eventId).Cancel(event-id).Post(requestBody)
Import-Module Microsoft.Graph.Users.Actions
$params = @{
Comment = "Cancelling for this week due to all hands"
}
# A UPN can also be used as -UserId.
Stop-MgUserEvent -UserId $userId -EventId $eventId -BodyParameter $params