Office 365 REST API - Outlook用户照片

时间:2015-07-28 20:26:08

标签: c# rest azure office365 office365api

我正在尝试使用Office 365 REST API(预览版)检索其他用户的Outlook展示照片。该文档位于此页面:https://msdn.microsoft.com/en-us/office/office365/api/photo-rest-operations

通过进行以下休息呼叫,我可以使用访问令牌成功检索自己的照片:

GET https://outlook.office365.com/api/beta/me/userphoto/$value

但是,尝试使用此REST调用检索组织中其他人的照片时:

GET https://outlook.office365.com/api/beta/Users('{user_id}')/userphotos('{size}')/$value

我收到以下错误:

{
     "error": {
        "code": "ErrorAccessDenied",
        "message": "Access is denied. Check credentials and try again."
     }
}

据我所知,此错误未在文档中的任何位置列出。我怀疑这与Azure中的权限有关,但这只是猜测。也许它在预览API中不受支持?有人有什么想法吗?

1 个答案:

答案 0 :(得分:3)

nkorai, you are right, the current permission set does not allow you to see others photo. We are adding a new oauth permission to the exchange online application endpoint which will allow you to do this. We are in the process of getting this permission enabled. Hopefully in a few weeks.