I cannot find a MS Graph SDK c# example for how to use the "user" scope parameter. The source docs gives no examples how to use this "user" parameter. Do you put the email addresses in string format or some other format?
https://learn.microsoft.com/en-us/graph/api/driveitem-createlink?view=graph-rest-1.0&tabs=http
public async Task<Permission> GetFilePreviewLinkAsync(string DriveID, string DriveItemID, string Scope, string Type)
{
Permission response = null;
try
{
response = await _graphServiceClient.Me.Drives[DriveID].Items[DriveItemID]
.CreateLink(Type, Scope, null, null, null, true)
.Request()
.PostAsync();
}
catch (ServiceException ex)
{
Console.WriteLine($"Error uploading: {ex.ToString()}");
}
return response;
}