Export (0) Print
Expand All

Get User's Direct Reports

Updated: October 27, 2014

The Get User’s Direct Reports operation returns a list of the user’s direct reports. These are users and contacts that have their manager navigation property set to the user on which the operation is performed. You can either request that links to the objects or that the objects themselves be returned in the response.

The request may be constructed as follows. Replace mytenantdomain with the domain of your Azure Active Directory tenant, such as contoso.onmicrosoft.com. The api-version query string parameter is required. If “$links” is included in the URI, then the response will contain only links to the relevant directory objects. If “$links” is omitted from the URI, the objects themselves are returned. Either objectId or userPrincipalName may be used to specify the target user. The examples in this topic use the tenant domain to address the tenant. For other ways of addressing the tenant, see Addressing Entities and Operations in the Graph API.

 

HTTP Method Request URI HTTP Version

GET

https://graph.windows.net/mytenantdomain/users/<objectId||userPrincipalName>/$links/directReports?api-version=2013-04-05

HTTP 1.1

noteNote
To retrieve the direct reports for a contact, specify “contacts” as the resource set. You can also specify “directoryObjects” as the resource set in the request URI; for example, https://graph.windows.net/contoso.onmicrosoft.com/directoryObjects/5e624f44-d38d-4943-b07c-2bad078f52ff/directReports?api-version=2013-04-05. Only objectId can be used when the resource set is “contacts” or “directoryObjects”.

 

Request Header Description

Authorization

Required. A bearer token issued by Azure Active Directory. See Authentication Scenarios for Azure AD for more information.

Content-Type

Required. The media type of the content in the request body.

Content-Length

Required. The length of the request in bytes.

There is no body required for this request.

The following sample request gets the direct reports for the specified user.

GET https://graph.windows.net/contoso.onmicrosoft.com/users/Isabel@contoso.onmicrsoft.com/directReports?api-version=2013-04-05 HTTP/1.1
Authorization: Bearer eyJ0eX ... FWSXfwtQ
Content-Type: application/json
Host: graph.windows.net

A successful operation returns status code 200 OK.

 

Response Header Description

ocp-aad-diagnostics-server-name

The identifier for the server that performed the requested operation.

ocp-aad-session-key

The key that identifies the current session with the directory service.

The following sample response is received when the sample request above is sent. The user has two direct reports.

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 1787
Content-Type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
Server: Microsoft-IIS/7.5
ocp-aad-diagnostics-server-name: wByDmqOAuV8t6pYQ6JlEvztwcfHFDpgbEASm4svTq80=
request-id: bf2a14ca-e217-4f5c-bcb4-816b2c1c9078
client-request-id: c1c5a8cc-9519-451e-8423-693983437689
x-ms-dirapi-data-contract-version: 1.0
ocp-aad-session-key: A80FnwJkd6BwiQwgCUahs_sFzaq50E8iCqhfdnrs_bgf2dFwESSBbCQR7zF8ulaT8YchlngLsVPsHDBw5A_m0YSbKr8amdqT7IxXaBJOrJU.a1L1R_2uEGvSMmZ9jhWQa8RT_eEUTxiJ-liZ-TqsQkc
X-Content-Type-Options: nosniff
DataServiceVersion: 3.0;
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ARR/2.5
X-Powered-By: ASP.NET
Date: Fri, 05 Apr 2013 22:44:30 GMT

{
    "odata.metadata": "https://graph.windows.net/contoso.onmicrosoft.com/$metadata#directoryObjects",
    "value": [
        {
            "odata.type": "Microsoft.WindowsAzure.ActiveDirectory.User",
            "objectType": "User",
            "objectId": "ea59e4d3-a7a1-4b5b-b65f-a25fcc0c0f99",
            "accountEnabled": true,
            "assignedLicenses": [],
            "assignedPlans": [],
            "city": null,
            "country": null,
            "department": null,
            "dirSyncEnabled": null,
            "displayName": "Mohamed Elkugia",
            "facsimileTelephoneNumber": null,
            "givenName": null,
            "jobTitle": null,
            "lastDirSyncTime": null,
            "mail": null,
            "mailNickname": "MohamedE",
            "mobile": null,
            "otherMails": [],
            "passwordPolicies": null,
            "passwordProfile": null,
            "physicalDeliveryOfficeName": null,
            "postalCode": null,
            "preferredLanguage": null,
            "provisionedPlans": [],
            "provisioningErrors": [],
            "proxyAddresses": [],
            "state": null,
            "streetAddress": null,
            "surname": null,
            "telephoneNumber": null,
            "thumbnailPhoto@odata.mediaContentType": "image",
            "usageLocation": null,
            "userPrincipalName": "Mohamed@contoso.onmicrosoft.com"
        },
        {
            "odata.type": "Microsoft.WindowsAzure.ActiveDirectory.User",
            "objectType": "User",
            "objectId": "f260bbc4-c254-447b-94cf-293b5ec434dd",
            "accountEnabled": true,
            "assignedLicenses": [],
            "assignedPlans": [],
            "city": null,
            "country": null,
            "department": null,
            "dirSyncEnabled": null,
            "displayName": "Karen Berg",
            "facsimileTelephoneNumber": null,
            "givenName": null,
            "jobTitle": null,
            "lastDirSyncTime": null,
            "mail": null,
            "mailNickname": "KarenB",
            "mobile": null,
            "otherMails": [],
            "passwordPolicies": null,
            "passwordProfile": null,
            "physicalDeliveryOfficeName": null,
            "postalCode": null,
            "preferredLanguage": null,
            "provisionedPlans": [],
            "provisioningErrors": [],
            "proxyAddresses": [],
            "state": null,
            "streetAddress": null,
            "surname": null,
            "telephoneNumber": null,
            "thumbnailPhoto@odata.mediaContentType": "image",
            "usageLocation": null,
            "userPrincipalName": "Karen@contoso.onmicrosoft.com"
        }
    ]
}

The following shows the request and response if links are requested in the URI:

GET https://graph.windows.net/contoso.onmicrosoft.com/users/Isabel@contoso.onmicrsoft.com/$links/directReports?api-version=2013-04-05 HTTP/1.1
Authorization: Bearer eyJ0eX ... FWSXfwtQ
Content-Type: application/json
Host: graph.windows.net

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Length: 465
Content-Type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8
Server: Microsoft-IIS/7.5
ocp-aad-diagnostics-server-name: GpZBqv1HpLKoq8DomLBjVg0qidYJApbIcc5XfQ74dc8=
request-id: 778cf212-2afe-4205-9f55-a9543842be39
client-request-id: dd6a91c9-25c5-4445-aa68-3e8a95ade133
x-ms-dirapi-data-contract-version: 1.0
ocp-aad-session-key: pq-6_vtvYt-Dpw2E3v4BQm9PhukELjFHz_xo0iwJjq1UR6cIA-OpgbK0FvXshMmEO2IBkwtX_qX_gNWgFh1QEi_e1qZHca79_GB9jTkXq6KDL69hnZWpgntWc53o2_QU6GspmNmKbY7uAbSceyJTug.NKNte6QwTMC5Nuat6vBYUs0Bd4dtmSyuqWHadetgcpk
X-Content-Type-Options: nosniff
DataServiceVersion: 3.0;
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
X-Powered-By: ARR/2.5
X-Powered-By: ASP.NET
Date: Fri, 29 Mar 2013 22:51:30 GMT

{
    "odata.metadata": "https://graph.windows.net/contoso.onmicrosoft.com/$metadata#directoryObjects/$links/directReports",
    "value": [
        {
            "url": "https://graph.windows.net/contoso.onmicrosoft.com/directoryObjects/ea59e4d3-a7a1-4b5b-b65f-a25fcc0c0f99/Microsoft.WindowsAzure.ActiveDirectory.User"
        },
        {
            "url": "https://graph.windows.net/contoso.onmicrosoft.com/directoryObjects/f260bbc4-c254-447b-94cf-293b5ec434dd/Microsoft.WindowsAzure.ActiveDirectory.User"
        }
    ]
}

See Also

Concepts

User

Show:
© 2014 Microsoft