简体   繁体   中英

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 )

It is possible to get contacts using the next query: 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

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. Users are Active Directory objects, Contacts are objects created by a user and stored in their Outlook mailbox. You fetch Contacts using the /me/contacts endpoint.

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 . The list is returned as application/json while the image is returned as image/{image-type} .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM