クライアント側ライブラリを使用してプッシュ サブスクリプションを含む office365 休止通知サービスを作成するためのコードが記述されたサンプル コードはありますか?
このリンクは情報を提供していますが、残りの呼び出しを使用しています。Notification クラスや Push サブスクリプション クラスを使用するなど、クライアント ライブラリを使用するものはありますか?
サブスクリプションを作成するために次のコードのように記述できますが、この add メソッドは void !!! であるため、応答が得られず、サブスクリプション ID も取得されません。
OutlookServicesClient client = new OutlookServicesClient(new Uri("https--//outlook.office.com/api/v2.0"), async () => { // セッションからローカルに持っているので、ここで返すだけです. トークンを返します; });
client.Context.SendingRequest2 += new EventHandler<Microsoft.OData.Client.SendingRequest2EventArgs>(
(sender, e) => InsertXAnchorMailboxHeader(sender, e, email));
PushSubscription subscribeme = new PushSubscription();
subscribeme.NotificationURL = "https://mywebhook.azurewebsites.net/api/send/myNotifyClient";
subscribeme.ChangeType = ChangeType.Deleted;
subscribeme.ClientState = "AJFromPushSubcribtion_" + DateTime.Now.ToString();
subscribeme.Resource = "https://outlook.office.com/api/v2.0/me/Events";
subscribeme.SubscriptionExpirationDateTime = DateTime.Now.AddDays(1);
await client.Me.Subscriptions.AddSubscriptionAsync(subscribeme);