名前空間: microsoft.graph
ユーザー予定表で指定したイベントを受け入れます。
この API は、次の国内クラウド展開で使用できます。
| グローバル サービス | 
米国政府機関 L4 | 
米国政府機関 L5 (DOD) | 
21Vianet が運営する中国 | 
| ✅ | 
✅ | 
✅ | 
✅ | 
アクセス許可
この API の最小特権としてマークされているアクセス許可またはアクセス許可を選択します。 
              アプリで必要な場合にのみ、より高い特権のアクセス許可またはアクセス許可を使用します。 委任されたアクセス許可とアプリケーションのアクセス許可の詳細については、「アクセス許可の種類」を参照してください。 これらのアクセス許可の詳細については、「アクセス許可のリファレンス」を参照してください。
| アクセス許可の種類 | 
最小特権アクセス許可 | 
より高い特権のアクセス許可 | 
| 委任 (職場または学校のアカウント) | 
Calendars.ReadWrite | 
注意事項なし。 | 
| 委任 (個人用 Microsoft アカウント) | 
Calendars.ReadWrite | 
注意事項なし。 | 
| アプリケーション | 
Calendars.ReadWrite | 
注意事項なし。 | 
HTTP 要求
POST /me/events/{id}/accept
POST /users/{id | userPrincipalName}/events/{id}/accept
POST /me/calendar/events/{id}/accept
POST /users/{id | userPrincipalName}/calendar/events/{id}/accept
POST /me/calendars/{id}/events/{id}/accept
POST /users/{id | userPrincipalName}/calendars/{id}/events/{id}/accept
POST /me/calendarGroups/{id}/calendars/{id}/events/{id}/accept
POST /users/{id | userPrincipalName}/calendarGroups/{id}/calendars/{id}/events/{id}/accept
| 名前 | 
型 | 
説明 | 
| Authorization | 
string | 
ベアラー {token}。 必須です。 
              認証と認可についての詳細をご覧ください。 | 
| Content-Type | 
string | 
エンティティ本文内のデータの性質です。 必須です。 | 
要求本文
要求本文で、次のパラメーターを含む JSON オブジェクトを指定します。
| パラメーター | 
型 | 
説明 | 
| comment | 
String | 
応答に含まれるテキスト。 省略可能。 | 
| sendResponse | 
ブール値 | 
              true 応答が開催者に送信される場合。それ以外の場合は、 false。 省略可能です。 既定値は true です。 | 
応答
成功した場合、このメソッドは 202 Accepted 応答コードを返します。 応答本文では何も返されません。
例
以下は、この API を呼び出す方法の例です。
要求
次の例は要求を示しています。
POST https://graph.microsoft.com/v1.0/me/events/{id}/accept
Content-type: application/json
{
  "comment": "comment-value",
  "sendResponse": true
}
// Code snippets are only available for the latest version. Current version is 5.x
// Dependencies
using Microsoft.Graph.Me.Events.Item.Accept;
var requestBody = new AcceptPostRequestBody
{
	Comment = "comment-value",
	SendResponse = true,
};
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=csharp
await graphClient.Me.Events["{event-id}"].Accept.PostAsync(requestBody);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// 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"
	  graphusers "github.com/microsoftgraph/msgraph-sdk-go/users"
	  //other-imports
)
requestBody := graphusers.NewItemAcceptPostRequestBody()
comment := "comment-value"
requestBody.SetComment(&comment) 
sendResponse := true
requestBody.SetSendResponse(&sendResponse) 
// To initialize your graphClient, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=go
graphClient.Me().Events().ByEventId("event-id").Accept().Post(context.Background(), requestBody, nil)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
// Code snippets are only available for the latest version. Current version is 6.x
GraphServiceClient graphClient = new GraphServiceClient(requestAdapter);
com.microsoft.graph.users.item.events.item.accept.AcceptPostRequestBody acceptPostRequestBody = new com.microsoft.graph.users.item.events.item.accept.AcceptPostRequestBody();
acceptPostRequestBody.setComment("comment-value");
acceptPostRequestBody.setSendResponse(true);
graphClient.me().events().byEventId("{event-id}").accept().post(acceptPostRequestBody);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
const options = {
	authProvider,
};
const client = Client.init(options);
const accept = {
  comment: 'comment-value',
  sendResponse: true
};
await client.api('/me/events/{id}/accept')
	.post(accept);
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
<?php
use Microsoft\Graph\GraphServiceClient;
use Microsoft\Graph\Generated\Users\Item\Events\Item\Accept\AcceptPostRequestBody;
$graphServiceClient = new GraphServiceClient($tokenRequestContext, $scopes);
$requestBody = new AcceptPostRequestBody();
$requestBody->setComment('comment-value');
$requestBody->setSendResponse(true);
$graphServiceClient->me()->events()->byEventId('event-id')->accept()->post($requestBody)->wait();
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
Import-Module Microsoft.Graph.Calendar
$params = @{
	comment = "comment-value"
	sendResponse = $true
}
# A UPN can also be used as -UserId.
Invoke-MgAcceptUserEvent -UserId $userId -EventId $eventId -BodyParameter $params
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
# Code snippets are only available for the latest version. Current version is 1.x
from msgraph import GraphServiceClient
from msgraph.generated.users.item.events.item.accept.accept_post_request_body import AcceptPostRequestBody
# To initialize your graph_client, see https://learn.microsoft.com/en-us/graph/sdks/create-client?from=snippets&tabs=python
request_body = AcceptPostRequestBody(
	comment = "comment-value",
	send_response = True,
)
await graph_client.me.events.by_event_id('event-id').accept.post(request_body)
プロジェクトに SDK を追加し、authProvider インスタンスを作成する方法の詳細については、SDK のドキュメントを参照してください。
 
応答
次の例は応答を示しています。
HTTP/1.1 202 Accepted