Upload a file to https://graph.microsoft.com/v1.0/sites/xxx.sharepoint.com/xxx/folder

Netra Jyothi 0 Reputation points
2023-11-19T03:36:57.04+00:00

Hi, I am trying to upload the file from .net7 app to sharepoint site https://graph.microsoft.com/v1.0/sites/xxx.sharepoint.com/xxx/folder. I am not sure how to do that.

I did this following authentication process and after this how can I get to the specific site xxx.sharepoint.com/xxx/folder to upload yyy.xlsx file? Please let me know. Any help will be greatly appricated.

   var scopes = new[] { "https://graph.microsoft.com/.default" };

        // Values from app registration
        var clientId = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
        var tenantId = "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
        var clientSecret = "ccccccccccccccccccccccccccccccccc";



        var options = new ClientSecretCredentialOptions
        {
            AuthorityHost = AzureAuthorityHosts.AzurePublicCloud,

        };
var clientSecretCredential = new ClientSecretCredential( tenantId, clientId, clientSecret, options);
var graphClient = new GraphServiceClient(clientSecretCredential, scopes);
.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,597 questions
ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,360 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,317 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,404 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,211 questions
{count} votes