我正在尝试使用MS Graph API从OneDrive for Business获取文件/文件夹列表。我已经在Graph Explorer中成功执行了我需要的查询,现在我正在继续在我的项目中实现。
我的应用是Windows服务,因此我使用this method
获取令牌我已成功检索到令牌,但当我“获取”此网址时...
//graph.microsoft.com/v1.0/users('someuseraccount')/drive/items/somedriveitem/microsoft.graph.createLink
...我收到了错误回复:
令牌中需要存在scp或角色声明。
来自服务器的令牌响应如下:
{
"token_type": "Bearer",
"expires_in": "3600",
"scope": "Directory.AccessAsUser.All Files.Read Files.Read.Selected Files.ReadWrite Files.ReadWrite.AppFolder Files.ReadWrite.Selected profile Sites.Read.All User.Read",
"expires_on": "1457343736",
"not_before": "1457339836",
"resource": "https://graph.microsoft.com",
"access_token": "-the token-"
}