question

DharnikShah-8386 avatar image
0 Votes"
DharnikShah-8386 asked

Microsoft Graph API - /drive/root/children always empty, even though I have files in my onedrive

I am getting access token from user with the scopes that I need which are Files.Read as shown below
stdClass Object
(
[token_type] => Bearer
[scope] => Files.Read Files.Read.All Files.ReadWrite.All Mail.Read Sites.Read.All User.Read profile openid email
[expires_in] => 3599
[ext_expires_in] => 3599
[access_token] => eyJ0eXAiOiJKV1QiLCJub25j // i have shorten this access token
[refresh_token] => 0.AWQA4RhkkXBq2kqvIbqr05RTbr8vC // i have shorten this refresh token
)

My problem is when I call /me/drive/root/children API it gives me empty result as shown below,

stdClass Object
(
[@odata.context] => https://graph.microsoft.com/v1.0/$metadata#users('ae496a8e-f1b1-4e1c-83df-xxxxxxxxxxxx')/drive/root/children
[value] => Array
(
)

)

From the portal, I have given permission for Files.Read Files.Read.All Files.ReadWrite.All. But then also getting empty value. I have files in my one drive.


microsoft-authenticator
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers