[英]Get outlook contacts with photo using Microsoft Graph Api
I'm trying to get the list of outlook contacts using MS Graph api ( https://developer.microsoft.com/en-us/graph/graph-explorer ) 我正在尝试使用MS Graph api( https://developer.microsoft.com/en-us/graph/graph-explorer )获取Outlook联系人的列表
It is possible to get contacts using the next query: https://graph.microsoft.com/v1.0/users 可以使用下一个查询获取联系人: https : //graph.microsoft.com/v1.0/users
Also I can get a photo for a particular contact using, for example: https://graph.microsoft.com/v1.0/users/ {id}/photo/$value 另外,我还可以使用以下方式为特定联系人获取照片: https : //graph.microsoft.com/v1.0/users/ {id} / photo / $ value
but how can I get the list of contacts with photo in one query? 但是如何在一个查询中获取带有照片的联系人列表?
You've confusing Contacts
and Users
, these are two distinct entities. 您已经混淆了
Contacts
和Users
,这是两个不同的实体。 Users
are Active Directory objects, Contacts
are objects created by a user and stored in their Outlook mailbox. Users
是Active Directory对象, Contacts
是用户创建并存储在其Outlook邮箱中的对象。 You fetch Contacts using the /me/contacts
endpoint. 您可以使用
/me/contacts
端点获取联系人。
As to your question regarding photos. 关于您的照片问题。 No, you cannot retrieve the photo inline with the contact list results.
不可以,您不能内联联系人列表结果检索照片。 Photos must be queried separately due to the result having a different
content-type
. 由于结果的
content-type
不同,必须分别查询照片。 The list is returned as application/json
while the image is returned as image/{image-type}
. 该列表以
application/json
而图像以image/{image-type}
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.