我正在尝试通过Graph api访问oneDrive,当我点击api时,我得到User's mysite not found.
GET https://graph.microsoft.com/beta/me/drive
{
"error": {
"code": "ResourceNotFound",
"message": "User's mysite not found.",
"innerError": {
"request-id": "13eb583d-c29a-42af-8868-bae06d554538",
"date": "2018-05-18T06:06:55"
}
}
}
所以,在寻找解决方案时,我看到了issue他们说要获得OneDrive for Business的位置,但这会返回UnauthorizedAccessException
GET https://graph.microsoft.com/beta/me?select=mySite
{
"error": {
"code": "-2147024891, System.UnauthorizedAccessException",
"message":
"Access denied. You do not have permission to perform this action or access this resource.",
"innerError": {
"request-id": "3489894e-faa0-42c6-9f3b-e76c4708ce15",
"date": "2018-05-18T06:10:00"
}
}
}
当我点击/me
端点时,我看到provisionedPlans
的空数组。
GET https://graph.microsoft.com/beta/me
{
"@odata.context": "https://graph.microsoft.com/beta/$metadata#users/$entity",
"id": "7e8397a6-b299-34a2-af06-d3487t5b5174",
//...
"onPremisesProvisioningErrors": [],
"provisionedPlans": []
}
我的访问令牌是
eyJ0eXAiOiJKV1QiLCJub25jZSI6IkFRQUJBQUFBQUFEWDhHQ2k2SnM2U0s4MlRzRDJQYjdySGc5dDJ4SmxkODFMRURNY1FuN3pMYVgyektLaDR2SF9FSFltd1JaQ3Y5TU55VDJOR250VmlDQVFmTXpiTWxoYkZWQ19nSEdtaWhfWlJfcVlpaGRyMHlBQSIsImFsZyI6IlJTMjU2IiwieDV0IjoiaUJqTDFSY3F6aGl5NGZweEl4ZFpxb2hNMllrIiwia2lkIjoiaUJqTDFSY3F6aGl5NGZweEl4ZFpxb2hNMllrIn0.eyJhdWQiOiJodHRwczovL2dyYXBoLm1pY3Jvc29mdC5jb20vIiwiaXNzIjoiaHR0cHM6Ly9zdHMud2luZG93cy5uZXQvM2FjMThiOGMtNjY4ZC00NzBhLWJhMDctYWU0MjdlMTkwZGEyLyIsImlhdCI6MTUyNzE0MDg2MCwibmJmIjoxNTI3MTQwODYwLCJleHAiOjE1MjcxNDQ3NjAsImFjciI6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cmVAcmF5a29yLmNvbSIsInV0aSI6IkxtTnJoX1FZbUVHbUtSY1JHcWtGQUEiLCJ2ZXIiOiIxLjAifQ.JtXMDO2Whs24ItQIIPBEZj93Go5z0QowyZCy-msAw7-heGu7yQZrppuvBfv-rrAS1bvFw_aBDBALzX7rlHwsiU9KaEzrRdzUgc9lciDhuGsPZddGEZrSpTuhBPvLa-xI8_1bLMhSChLECU63rMnBYHZJesenWqPL0w1DsmkUHeR01Ff7l8pgsH3jemRK2NAr4LD-wyQrumJxz2h45luO9dICqPOGjI9hwrjNpSDJnhienDkUsrcOA2ijnWglCJ3GRN9RfrJ93osCaO3WpUoTIy66NApYR__YDGzO4HsTk_MA9OSQCHcw5mOaOeRKZmRTDPIokyYpeNgXBK9FmZivBg
无法确定这是一个访问问题或配置问题。任何人都可以建议这里出了什么问题。