The following code segment using Microsoft Graph Client Library fails while trying to access One Drive contents
var items = Graphclient.Me.Drive.Root.Children.Request().GetAsync().Result;
It throws the exception
Code: BadRequest Message: Unable to retrieve user's mysite URL.
Fiddler shows an HTTP 400 for the request header. GET /v1.0/me/drives
I checked in Graph explorer and the tenant does work for the same request so why does it fail in code.
I have set the following admin level app permissions Directory.ReadWrite.All, Files.ReadWrite.All, Sites.ReadWrite.All, User.ReadWrite.All
The following sections of code do work
IGraphServiceDrivesCollectionPage drives =
Graphclient.Drives.Request().GetAsync().Result;
Fiddler request - GET /v1.0/drives HTTP/1.1
So what am I missing when I am trying to access Graphclient.Me