Skip to content

Latest commit

 

History

History
323 lines (259 loc) · 10.1 KB

File metadata and controls

323 lines (259 loc) · 10.1 KB
title Get usageRight
description Get the properties and relationships of a usageRight for a user or group.
author patrick-starrin
ms.localizationpriority medium
ms.subservice cloud-licensing
doc_type apiPageType
ms.date 10/22/2024

Get usageRight

Namespace: microsoft.graph.cloudLicensing

[!INCLUDE beta-disclaimer]

Get the properties and relationships of a usageRight for a user or group.

Permissions

The following tables show the least privileged permission or permissions required to call this API on each supported resource type. Follow best practices to request least privileged permissions. For details about delegated and application permissions, see Permission types. To learn more about these permissions, see the permissions reference.

Permissions to get a usageRight for a user:

GET /me/cloudLicensing/usageRights/{usageRightId}
GET /users/{userId}/cloudLicensing/usageRights/{usageRightId}

[!INCLUDE permissions-table]

Permissions to get a usageRight for a group:

GET /groups/{groupId}/cloudLicensing/usageRights/{usageRightId}

[!INCLUDE permissions-table]

HTTP request

To get a usage right for the signed-in user using delegated (/me) permissions:

GET /me/cloudLicensing/usageRights/{usageRightId}

To get a usage right for a specific user or group using either delegated or application permissions:

GET /users/{userId}/cloudLicensing/usageRights/{usageRightId}
GET /groups/{groupId}/cloudLicensing/usageRights/{usageRightId}

Optional query parameters

This method supports the $select and $expand OData query parameters to help customize the response. For general information, see OData query parameters.

Request headers

Name Description
Authorization Bearer {token}. Required. Learn more about authentication and authorization.

Request body

Don't supply a request body for this method.

Response

If successful, this method returns a 200 OK response code and a microsoft.graph.cloudLicensing.usageRight object in the response body.

Examples

Example 1: Get a usageRight for a user

The following example shows how to get a usage right for a user.

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/users/48fbdf70-9e09-40df-9dbe-17af483ab113/cloudLicensing/usageRights/i6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby3

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


Response

The following example shows the response.

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

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

{
  "@odata.type": "#microsoft.graph.cloudLicensing.usageRight",
  "id": "i6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby3",
  "skuId": "639dec6b-bb19-468b-871c-c5c441c4b0cb",
  "skuPartNumber": "Microsoft_365_Copilot",
  "services": [
    {
      "@odata.type": "microsoft.graph.cloudLicensing.service",
      "assignableTo": "user,group",
      "planId": "fe6c28b3-d468-44ea-bbd0-a10a5167435c",
      "planName": "COPILOT_STUDIO_IN_COPILOT_FOR_M365"
    }
  ]
}

Example 2: Get a usageRight for a group

The following example shows how to get a usage right for a group.

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/groups/1003985b-dfc1-4f42-97d4-65f70a335ca8/cloudLicensing/usageRights/j6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby4

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


Response

The following example shows the response.

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

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

{
  "@odata.type": "#microsoft.graph.cloudLicensing.usageRight",
  "id": "j6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby4",
  "skuId": "639dec6b-bb19-468b-871c-c5c441c4b0cb",
  "skuPartNumber": "Microsoft_365_Copilot",
  "services": [
    {
      "@odata.type": "microsoft.graph.cloudLicensing.service",
      "assignableTo": "user,group",
      "planId": "fe6c28b3-d468-44ea-bbd0-a10a5167435c",
      "planName": "COPILOT_STUDIO_IN_COPILOT_FOR_M365"
    }
  ]
}

Example 3: Get a usageRight with assignments for a user

The following example shows how to get a usage right and its assignments for a user.

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/users/48fbdf70-9e09-40df-9dbe-17af483ab113/cloudLicensing/usageRights/i6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby3?$expand=assignments($select=id)

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


Response

The following example shows the response.

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

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

{
  "@odata.type": "#microsoft.graph.cloudLicensing.usageRight",
  "id": "i6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby3",
  "skuId": "639dec6b-bb19-468b-871c-c5c441c4b0cb",
  "skuPartNumber": "Microsoft_365_Copilot",
  "services": [
    {
      "@odata.type": "microsoft.graph.cloudLicensing.service",
      "assignableTo": "user,group",
      "planId": "fe6c28b3-d468-44ea-bbd0-a10a5167435c",
      "planName": "COPILOT_STUDIO_IN_COPILOT_FOR_M365"
    }
  ],
  "assignments": [
    {
      "@odata.type": "#microsoft.graph.cloudLicensing.assignment",
      "id": "405ee855-dd74-f695-8d7e-be35a6788fe8"
    }
  ]
}

Example 4: Get a usageRight with allotments for a user

The following example shows how to get a usage right and its allotments for a user.

Request

The following example shows a request.

GET https://graph.microsoft.com/beta/users/48fbdf70-9e09-40df-9dbe-17af483ab113/cloudLicensing/usageRights/i6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby3?$expand=allotments($select=id,allottedUnits,consumedUnits,subscriptions)

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


Response

The following example shows the response.

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

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

{
  "@odata.type": "#microsoft.graph.cloudLicensing.usageRight",
  "id": "i6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby3",
  "skuId": "639dec6b-bb19-468b-871c-c5c441c4b0cb",
  "skuPartNumber": "Microsoft_365_Copilot",
  "services": [
    {
      "@odata.type": "microsoft.graph.cloudLicensing.service",
      "assignableTo": "user,group",
      "planId": "fe6c28b3-d468-44ea-bbd0-a10a5167435c",
      "planName": "COPILOT_STUDIO_IN_COPILOT_FOR_M365"
    }
  ],
  "allotments": [
    {
      "@odata.type": "#microsoft.graph.cloudLicensing.allotment",
      "id": "405ee855-dd74-f695-8d7e-be35a6788fe8",
      "allottedUnits": 100,
      "consumedUnits": 50,
      "subscriptions": [
        {
          "@odata.type": "#microsoft.graph.cloudLicensing.subscription",
          "subscriptionId": "f196adf8-75fa-8e4f-c61d-42d8114de4f4",
          "nextLifecycleDate": "2025-09-30T00:00:00.000Z",
          "startDate": "2025-07-18T00:00:00.000Z",
          "state": "active",
          "tags": "none"
        }
      ]
    }
  ]
}