如何加载People API返回的PersonalContact的照片?

时间:2019-01-04 01:19:35

标签: json microsoft-graph

我正在使用Microsoft Graph People API在我的个人联系人和组织目录中搜索人员。

https://graph.microsoft.com/v1.0/me/people/?$search=username

例如返回

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('123456789')/people",
    "@odata.nextLink": "https://graph.microsoft.com/v1.0/me/people/?$search=username&$skip=10",
    "value": [
        {
            "id": "1234567890",
            ...
            "personType": {
                "class": "Person",
                "subclass": "OrganizationUser"
            }
        },
        {
            "id": "0987654321",
            ...
            "personType": {
                "class": "Person",
                "subclass": "PersonalContact"
            }
        }
    ]
}

当我请求内部组织用户的照片("subclass": "OrganizationUser")时,一切正常。

当我请求一些个人联系人("subclass": "PersonalContact")照片服务时,/me/contacts/{id}/photo/$value返回:

{
    "error": {
        "code": "ErrorInvalidOperation",
        "message": "ConversationId isn't supported in the context of this operation.",
        "innerError": {
            "request-id": "1b55eca0-f83f-4e66-9006-b728373ad747",
            "date": "2019-01-04T01:06:27"
        }
    }
}

0 个答案:

没有答案