简体   繁体   English

使用Microsoft Graph Api获取照片的Outlook联系人

[英]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. 您已经混淆了ContactsUsers ,这是两个不同的实体。 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.

相关问题 Microsoft Graph List Contacts API 返回的联系人超出了 Outlook UI 中的可见范围 - Microsoft Graph List Contacts API returns contacts beyond what are visible in the Outlook UI 使用Outlook或Graph Rest API撤消对Microsoft / Outlook帐户的访问 - Revoke access of microsoft/outlook account using outlook or graph rest API Microsoft Graph API - 删除联系人 - 在已删除项目中的 outlook 中创建空邮件 object - Microsoft Graph API - Delete contacts - create empty mail object in outlook in deleted itmes 如何通过 Microsoft Graph 获取我最喜欢的人(outlook 联系人) - How can I get my favorite people (outlook contacts) via Microsoft Graph Outlook / 交换 API(Microsoft Graph?) - Outlook / Exchange API (Microsoft Graph?) Microsoft Graph To Do API:如何只获取 Outlook 任务? - Microsoft Graph To Do API: How to get only Outlook tasks? Microsoft Graph API:GET Outlook日历事件:按组织者电子邮件过滤 - Microsoft Graph API: GET Outlook Calendar Event: Filter by Organizer Email 使用 Graph API (Microsoft Outlook) 在多个文件夹中插入消息 - Insert Message in many folders using Graph API (Microsoft Outlook) 使用 MS Microsoft Graph 按类别获取和过滤 Outlook 事件 - Get and Filter Outlook events by Category using MS Microsoft Graph 单个应用程序中的Microsoft Graph API和Outlook API - Microsoft Graph API and Outlook API in a Single App
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM