Код: Выделить всё
public async Task GetAccessTokenAsync()
{
string[] scopes = { "https://graph.microsoft.com/.default" };
var clientSecretCredential = new ClientSecretCredential(
tenantId, clientId, clientSecret);
var graphClient = new GraphServiceClient(clientSecretCredential, scopes);
// Retrieve the files from the "My Files" folder (OneDrive root)
var document = await graphClient.Users["XXXXXX@XXX.com"].GetAsync();
var driveItems = await graphClient.Sites["XXXX-my.sharepoint.com"].GetAsync();
foreach (var items in document.Drive.Items)
{
Console.WriteLine(items.Name);
}
}
Подробнее здесь: https://stackoverflow.com/questions/787 ... oint-drive