LoginSignup
0
0

More than 5 years have passed since last update.

Microsoft Graph SDK でイベントID指定でイベント取得

Last updated at Posted at 2017-03-13

1.Microsoft Graph API

REST APIでO365などを操れたりするAPI。SDKも提供されている。
https://developer.microsoft.com/ja-jp/graph

2.問題

Outlookに入っている特定のイベント(予定)をイベントIDで取得しようとしたとき、HTTPリクエストURIは
https://graph.microsoft.com/v1.0/me/calendar/events/[eventId]

これをSDKを使ってC#でリクエストしようとすると、

var result = await graphClient.Me.Calendar.Events.Request().GetAsync();

・・・で、イベントIDをどう指定するかわからない。

3.解決

てっきりRequest()の引数オプションとかで指定するのかと数時間ハマっていたら、Githubのサンプルにこう書いてあった。

var result = await graphClient.Me.Calendar.Events[eventId].Request().GetAsync();
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0