无法使用Microsoft.Graph Api发送文件夹的邀请

时间:2017-03-13 22:11:02

标签: c# uwp office365 microsoft-graph onedrive

我正在尝试发送该文件夹的邀请,但我一直收到此错误:

  

处理此请求时尝试了无效操作。

我的代码是:

var graphclient = AuthenticationHelper.GetGraphServiceClient();

List<DriveRecipient> recpient = new List<DriveRecipient>() {
    new DriveRecipient {
        Email = "abcd@hotmail.com",
        Alias="abcd" } };

// var info = await graphclient.Me.Request().GetAsync();
var invite = graphclient.Me.Drive.Root.ItemWithPath("trying").Invite(recpient, false, new List<string>() { "write" }, true, "inviation from xyz");
var done = await invite.Request().PostAsync();

请求正文是:

{"requireSignIn":false,
"roles":["write"],
"sendInvitation":true,
"message":"inviation from xyz",
"recipients":[{"email":"abcd@hotmail.com","alias":"abcd"}]}

请求网址:https://graph.microsoft.com:443/v1.0/me/drive/root:/trying:/microsoft.graph.invite

0 个答案:

没有答案