1
votes

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?

1

1 Answers

2
votes

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}.