Unable to send an invitation of the folder using Microsoft.Graph Api

牧云@^-^@ 提交于 2019-12-24 07:36:13

问题


I am trying to send an invitation for the folder but I keep getting this error:

An invalid operation was attempted while processing this request.

My code is:

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();

Request Body is:

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

Request Url: https://graph.microsoft.com:443/v1.0/me/drive/root:/trying:/microsoft.graph.invite

来源:https://stackoverflow.com/questions/42774367/unable-to-send-an-invitation-of-the-folder-using-microsoft-graph-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!