【发布时间】:2018-08-14 07:18:34
【问题描述】:
我正在使用 python 脚本从用户 office 365 onedrive 备份文件。我使用 Graph API 从用户 onedrive 获取对象列表。 我从用户的根驱动器获取所有子对象的查询在 Graph Explorer 中返回了预期值。在 python 脚本中使用相同的查询时,Graph 返回一个空值。脚本中的其他查询正在返回正确的值。
返回正确值的查询示例: https://graph.microsoft.com/v1.0/users/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx/drives 脚本从返回值中提取 drive-id 以从下一个查询中获取子对象列表: https://graph.microsoft.com/v1.0/users('xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx')/drives('xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx')/root/children
从 API 调用返回空值,但从 Graph explorer 返回正确的值。
有什么建议吗?
【问题讨论】:
-
您是否正在针对 OneDrive 商业用户拨打电话?您在令牌中请求了哪些范围?
标签: api sharepoint graph onedrive