首页 > 解决方案 > Microsoft Graph API - /drive/root/children 始终为空,我不明白我做错了什么

问题描述

我从用户那里获得访问令牌,其范围是 Files.Read,如下所示

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
)

我的问题是当我调用 /me/drive/root/children API 时,它给了我空的结果,如下所示,

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

在门户中,我已授予 Files.Read Files.Read.All Files.ReadWrite.All 的权限。但随后也获得了空值。我的一个驱动器中有文件。

标签: microsoft-graph-apimicrosoft-graph-files

解决方案


推荐阅读