
Hi @Roman Gavrilov
There seems to be a same thread on SO, now posting the solution into Q&A:
This depends on which authentication flow you use, because you are only granting application permissions, which are only supported in the client credentials flow. So if you're using the client credentials flow, your permissions are sufficient. However, if you are using auth code flow or ROPC flow, you also need to grant
Files.ReadWrite.All
andSites.ReadWrite.All
delegated permissions.
By the way, if you want to get more error information, then you can try using try-catch
capture:
try
{
//code snippet......
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".