-
Notifications
You must be signed in to change notification settings - Fork 252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OneDrive API calls doesnot have any provision for Delegated and Apponly authentication types. #2211
Comments
Thanks for raising this @Neelabhra08 Taking a look at your url, the
|
@andrueastman Hey, thanks for responding. The call works fine in the graph explorer but doesnot have support for C# or Dotnet SDK. Can you suggest what will be the call if we are implementing it in C#. |
Thanks for the feedback, the path missing in the SDK is due to what is explained in the guidance at the link below. To resolve this you can either get the drive id and use the available requestbuilders as below. //get the user drive id
var userDrive = await graphClient.Users["user-id"].Drive.GetAsync();
await graphClient.Drives[userDrive.Id].Items["item-id"].PermanentDelete.PostAsync();// delete the item or override the url as you desire using the //use the url to override
await graphClient.Drives[""].Items[""].PermanentDelete.WithUrl("https://graph.microsoft.com/v1.0/users/{userId}/drive/items/{item-d}/permanentDelete").PostAsync();// delete the item |
@andrueastman the method worked fine. Thanks for quick response. |
https://graph.microsoft.com/v1.0/drives/Me/items/01J4YTV6BO73AXJWFW3JEZU3DYNCXMCWA7/permanentDelete - This call requires a DriveID which is "Me" here. I bypassed this call by modifying the the request URI - https://graph.microsoft.com/v1.0/me/drive/items/01J4YTV6BO73AXJWFW3JEZU3DYNCXMCWA7/permanentDelete and this works fine.
But cannot find any way around to work with the Apponly access where userID is needed as https://graph.microsoft.com/v1.0/{userID}/drive/items/01J4YTV6BO73AXJWFW3JEZU3DYNCXMCWA7/permanentDelete isn't working.
The main goal is to not do a extra call for fetching the driveId to execute OneDrive calls. Can anyone help with these please.
The text was updated successfully, but these errors were encountered: