編輯

共用方式為


List people

Namespace: microsoft.graph

Retrieve a collection of person objects ordered by their relevance to the user, which is determined by the user's communication and collaboration patterns, and business relationships.

You can get this information via the People API. For examples, see the Examples section and the article Use the People API to get information about the people most relevant to you.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

Choose the permission or permissions marked as least privileged for this API. Use a higher privileged permission or permissions only if your app requires it. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) People.Read People.Read.All
Delegated (personal Microsoft account) People.Read Not available.
Application People.Read.All Not available.

HTTP request

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

Optional query parameters

This method supports the OData query parameters to help customize the response.

Name Value Description
$filter string Limits the response to only those people whose record contains the specified criteria.
$orderby string By default the people in the response are sorted by their relevance to your query. You can change the order of the people in the response using the $orderby parameter.
$search string Search for people by name or alias. Supports Fuzzy matching. Parameter only works for searching the signed-in user's relevant people, not for searching people relevant to other users. Also supports the topic keyword to find people based on topics extracted from e-mail conversations with that person. For information and examples, see the Perform a fuzzy search section at Use the People API to get information about the people most relevant to you.
$select string Comma-separated list of properties to include in the response. For optimal performance, only select the subset of properties needed.
$skip int Skip the first n results, useful for paging. This is not supported when using $search.
$top int The maximum number of results to be returned on a results page. For more information, see top parameter.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
Accept application/json

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a collection of person objects in the response body. The response can contain one person object or a collection of person objects.

Examples

Request

The following example shows a request.

GET https://graph.microsoft.com/v1.0/me/people

Response

The following example shows the response.

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

{
    "value": [
        {
            "id": "33b43a5b-87d6-41ec-91f8-a2610048105f",
            "displayName": "Marketing",
            "givenName": null,
            "surname": null,
            "birthday": "",
            "personNotes": "",
            "isFavorite": false,
            "jobTitle": null,
            "companyName": null,
            "yomiCompany": "",
            "department": null,
            "officeLocation": null,
            "profession": "",
            "userPrincipalName": "",
            "imAddress": null,
            "scoredEmailAddresses": [
                {
                    "address": "Marketing@contoso.com",
                    "relevanceScore": 30.0
                }
            ],
            "phones": [],
            "postalAddresses": [],
            "websites": [],
            "personType": {
                "class": "Group",
                "subclass": "UnifiedGroup"
            }
        },
        {
            "id": "e3d0513b-449e-4198-ba6f-bd97ae7cae85",
            "displayName": "Isaiah Langer",
            "givenName": "Isaiah",
            "surname": "Langer",
            "birthday": "",
            "personNotes": "",
            "isFavorite": false,
            "jobTitle": "Web Marketing Manager",
            "companyName": null,
            "yomiCompany": "",
            "department": "Sales & Marketing",
            "officeLocation": "20/1101",
            "profession": "",
            "userPrincipalName": "IsaiahL@contoso.com",
            "imAddress": "sip:isaiahl@contoso.com",
            "scoredEmailAddresses": [
                {
                    "address": "IsaiahL@contoso.com",
                    "relevanceScore": 20.0
                }
            ],
            "phones": [
                {
                    "type": "business",
                    "number": "+1 918 555 0101"
                }
            ],
            "postalAddresses": [],
            "websites": [],
            "personType": {
                "class": "Person",
                "subclass": "OrganizationUser"
            }
        }
    ]
}