【发布时间】:2021-08-10 11:27:08
【问题描述】:
如何使其与只能订阅一个文件夹的 Microsoft Graph SDK(.Net 和 C#)一起使用? (我想基于此编写一个 webhook)。
public async Task<ActionResult<string>> Get() {
var graphServiceClient = GetGraphClient();
var sub = new Microsoft.Graph.Subscription();
sub.ChangeType = "updated";
sub.NotificationUrl = config.Ngrok + "/api/notifications";
sub.Resource = "/drives/{driveID}/root/";
sub.ExpirationDateTime = DateTime.UtcNow.AddMinutes(5);
sub.ClientState = "SecretClientState";
var newSubscription = await graphServiceClient.Subscriptions.Request().AddAsync(sub);
到目前为止,我只能订阅根目录中的所有内容,但不能订阅 Onedrive 中的特定文件夹。
【问题讨论】:
标签: c# .net asp.net-core microsoft-graph-api onedrive