Hello @Pradyut Sinha ,
You can use /beta
, permission: revokeGrants, revoke access to a listItem
or driveItem
granted via a sharing link by removing the specified recipient from the link.
POST /drives/{drive-id}/items/{item-id}/permissions/{perm-id}/revokeGrants
Note: This functionality is only available for sharing links scoped to users.
GraphServiceClient graphClient = new GraphServiceClient( authProvider );
var grantees = new List<DriveRecipient>()
{
new DriveRecipient
{
Email = "ryan@contoso.com"
}
};
await graphClient.Me.Drive.Items["{driveItem-id}"].Permissions["{permission-id}"]
.RevokeGrants(grantees)
.Request()
.PostAsync();
APIs under the /beta
version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported.
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have extra questions about this answer, please click Comment.