I m using Microsoft Graph API to get a list of all available shares as follows.
GraphServiceClient _graphClient = new GraphServiceClient(myAuthProvider);
var shares = _graphClient.Shares.Request().GetAsync().Result;
I get the following error.
The request is malformed or incorrect
Other API calls for drives, sites, users, groups etc. work fine. Only this request fails. Why? How to find all available shares?
You have to specify shareId
or sharing URL
.
GraphServiceClient graphClient = new GraphServiceClient(authProvider);
var sharedDriveItem = await graphClient.Shares["{sharedDriveItem-id}"]
.Request()
.GetAsync();
To encode a sharing URL, use base64 encode the URL
Reference: