Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

108
Views
Subscribe to a folder with MS graph SDK

How can I make it work with the Microsoft Graph SDK (.Net and C#) that I can only subscribe to one folder ? (I want to code a webhook based on this).

public async Task<ActionResult<string>> Get() {
      var graphServiceClient = GetGraphClient();
      var sub = new Microsoft.Graph.Subscription();
      
      sub.ChangeType = "updated";
      sub.NotificationUrl = config.Ngrok + "/api/notifications";

      sub.Resource = "/drives/{driveID}/root/";
      sub.ExpirationDateTime = DateTime.UtcNow.AddMinutes(5);
      sub.ClientState = "SecretClientState";

      var newSubscription = await graphServiceClient.Subscriptions.Request().AddAsync(sub);

So far I can only subscribe to everything in the root but not to a specific folder in Onedrive.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Yes, On personal OneDrive you could subscribe to the root folder or any subfolder within that drive but in OneDrive for business, you could only subscribe to root folder. Let me know if you required further assistance on this.

Note: You cannot subscribe to drive or driveItem instances that are not folders, such as individual files. You could refer to our official document here.

So you can create folder within the root, in that case you could allow your user to create folder where they can upload their files.

Hope it would helps

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!