List contacts

Important: APIs under the /beta version in Microsoft Graph are in preview and are subject to change. Use of these APIs in production applications is not supported.

Get contacts in the user's mailbox.

Prerequisites

One of the following scopes is required to execute this API: Contacts.Read; Contacts.ReadWrite

HTTP request

To get all the contacts in a user's mailbox:

GET /me/contacts
GET /users/{id | userPrincipalName}/contacts

To get contacts in a specific folder in the user's mailbox:

GET /me/contactfolders/{Id}/contacts
GET /users/{id | userPrincipalName}/contactfolders/{id}/contacts

GET /me/contactFolder/{id}/childFolders/{id}/.../contacts
GET /users/{id | userPrincipalName}/contactFolders/{id}/childFolders/{id}/contacts

Optional query parameters

This method supports the OData Query Parameters to help customize the response.

For example, you can use the $filter query parameter to filter contacts based on the domain of their email addresses:

https://graph.microsoft.com/v1.0/me/contacts?$filter=emailAddresses/any(a:a/address eq '@domain.com')

Request headers

Header Value
Authorization Bearer {token}. Required.
Content-Type application/json

Request body

Do not supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and collection of Contact objects in the response body.

Example

Request

Here is an example of the request.

GET https://graph.microsoft.com/beta/me/contacts
Response

Here is an example of the response. Note: The response object shown here may be truncated for brevity. All of the properties will be returned from an actual call.

HTTP/1.1 200 OK
Content-type: application/json
Content-length: 263

{
  "value": [
    {
      "parentFolderId": "parentFolderId-value",
      "birthday": "2016-10-19T10:37:00Z",
      "fileAs": "fileAs-value",
      "displayName": "displayName-value",
      "givenName": "givenName-value",
      "initials": "initials-value"
    }
  ]
}