Skip to content

Latest commit

 

History

History
199 lines (157 loc) · 6.86 KB

user-list-usagerights.md

File metadata and controls

199 lines (157 loc) · 6.86 KB
title description author ms.localizationpriority ms.subservice doc_type
List user usageRights
Retrieve a list of usageRights objects for a user.
jeeshnair
medium
entra-users
apiPageType

List user usageRights

Namespace: microsoft.graph

[!INCLUDE beta-disclaimer]

Retrieve a list of usageRight objects for a given user.

[!INCLUDE national-cloud-support]

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.

[!INCLUDE permissions-table]

HTTP request

GET /users/{userId}/usageRights

Optional query parameters

This API supports the $filter OData query parameter. The following patterns of $filter are supported:

  • $filter = state eq 'value'
  • $filter = serviceIdentifier eq 'value'
  • $filter = state eq 'value' and serviceIdentifier eq 'value'
  • $filter = state in ('value1', 'value2')
  • $filter = serviceIdentifier in ('value1', 'value2')
  • $filter = state in ('value1', 'value2') and serviceIdentifier in ('value1', 'value2')

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.
odata.maxpagesize Set the max result page size pereference. Optional.

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 usageRight objects in the response body.

Additionally, if there are more pages in the response an @odata.nextLink is returned.

Examples

Example 1: Get all usage rights for a user

Request

GET https://graph.microsoft.com/beta/users/{userId}/usageRights

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

Note: The response object shown here might be shortened for readability.

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

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#users('64952b80-51fd-4378-9ba5-589a840afb80')/usageRights",
  "@odata.nextLink": "https://graph.microsoft.com/beta/users/64952b80-51fd-4378-9ba5-589a840afb80/usageRights?$skiptoken=W4diD29cGKX1bX",
  "value": [
    {
      "id": "c2e034cb-3cbc-41be-a496-bfcd031e4cfc",
      "catalogId": "CFQ7TTC0KCRG:0001",
      "serviceIdentifier": "mscrm.f6d23ec7-255c-4bd8-8c99-dc041d5cb8b3.517f7ddd-df45-4f1c-83ec-a081a047f546",
      "state": "active"
    }
  ]
}

Example 2: Get usage rights for a user with specific service identifiers and states

Request

GET https://graph.microsoft.com/beta/users/{userId}/usageRights?$filter=state in ('active', 'suspended') and serviceIdentifier in ('ABCD')

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]

[!INCLUDE sample-code] [!INCLUDE sdk-documentation]


Response

Note: The response object shown here might be shortened for readability.

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

{
  "@odata.context": "https://graph.microsoft.com/beta/$metadata#users('64952b80-51fd-4378-9ba5-589a840afb80')/usageRights",
  "value": [
    {
      "id": "505261eb-b4ee-421c-8206-05529ae2c150",
      "catalogId": "CFQ7TTC0KCRG:0001",
      "serviceIdentifier": "ABCD",
      "state": "active"
    }
  ]
}