“ErrorAccessDenied” when getting user photos with Microsoft Graph API v1.0

核能气质少年 提交于 2019-12-11 00:08:48

问题


I'm getting an "ErrorAccessDenied" when attempting to get user photos with the Microsoft Graph API v1.0. I have approx 200 users, and I'm getting this error for around 1 in 10 user photos (the others work fine).

I can get user profile info fine with:

https://graph.microsoft.com/v1.0/tenantID.onmicrosoft.com/users/someUserId/

But for some users, attempting to get a photo:

https://graph.microsoft.com/v1.0/tenantID.onmicrosoft.com/users/someUserId/photo
https://graph.microsoft.com/v1.0/tenantID.onmicrosoft.com/users/someUserId/photo/$value

returns "ErrorAccessDenied":

{
  "error": {
    "code": "ErrorAccessDenied",
    "message": "Access is denied. Check credentials and try again.",
    "innerError": {
      "request-id": "ea95a205-23c1-4f3c-b8d5-6ab1dcff0a2e",
      "date": "2015-11-26T00:02:11"
    }
  }
}

It works fine if I switch back to the beta endpoint, it's only an issue on v1.0.


回答1:


Your requests are correct. You are getting errors on some users due to those users not having the right build with a fix that is rolling out. Apologies for the inconvenience, the deployment should complete in a few days. Note, this issue was captured in the release notes: https://graph.microsoft.io/docs/overview/release_notes



来源:https://stackoverflow.com/questions/33928681/erroraccessdenied-when-getting-user-photos-with-microsoft-graph-api-v1-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!