|
| 1 | +--- |
| 2 | +title: "Get usageRight" |
| 3 | +description: "Get the properties and relationships of a usageRight for a user or group." |
| 4 | +author: "patrick-starrin" |
| 5 | +ms.localizationpriority: medium |
| 6 | +ms.subservice: "cloud-licensing" |
| 7 | +doc_type: apiPageType |
| 8 | +--- |
| 9 | + |
| 10 | +# Get usageRight |
| 11 | + |
| 12 | +Namespace: microsoft.graph.cloudLicensing |
| 13 | + |
| 14 | +[!INCLUDE [beta-disclaimer](../../includes/beta-disclaimer.md)] |
| 15 | + |
| 16 | +Get the properties and relationships of a [usageRight](../resources/cloudlicensing-usageright.md) for a [user](../resources/user.md) or [group](../resources/group.md). |
| 17 | + |
| 18 | +## Permissions |
| 19 | + |
| 20 | +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](/graph/permissions-overview#best-practices-for-using-microsoft-graph-permissions). For details about delegated and application permissions, see [Permission types](/graph/permissions-overview#permission-types). To learn more about these permissions, see the [permissions reference](/graph/permissions-reference). |
| 21 | + |
| 22 | +Permissions to get a **usageRight** for a user: |
| 23 | + |
| 24 | +<!-- { "blockType": "ignored"} --> |
| 25 | +``` http |
| 26 | +GET /me/cloudLicensing/usageRights/{usageRightId} |
| 27 | +GET /users/{userId}/cloudLicensing/usageRights/{usageRightId} |
| 28 | +``` |
| 29 | + |
| 30 | +<!-- { "blockType": "permissions", "name": "cloudlicensing_usageright_get" } --> |
| 31 | +[!INCLUDE [permissions-table](../includes/permissions/cloudlicensing-usageright-get-permissions.md)] |
| 32 | + |
| 33 | +Permissions to get a **usageRight** for a group: |
| 34 | + |
| 35 | +<!-- { "blockType": "ignored"} --> |
| 36 | +``` http |
| 37 | +GET /groups/{groupId}/cloudLicensing/usageRights/{usageRightId} |
| 38 | +``` |
| 39 | + |
| 40 | +<!-- { "blockType": "permissions", "name": "cloudlicensing_usageright_get", "requestUrls": "GET /groups/{groupId}/cloudLicensing/usageRights/{usageRightId}" } --> |
| 41 | +|Permission type|Least privileged permissions|Higher privileged permissions| |
| 42 | +|:---|:---|:---| |
| 43 | +|Delegated (work or school account)|Group-UsageRight.Read.All|Directory.Read.All, Directory.ReadWrite.All, Group-CloudLicensing.Read, Group-CloudLicensing.Read.All, Group.Read.All, Group.ReadWrite.All, User.Read.All, User.ReadWrite.All| |
| 44 | +|Delegated (personal Microsoft account)|Not supported.|Not supported.| |
| 45 | +|Application|Group-UsageRight.Read.All|Directory.Read.All, Directory.ReadWrite.All, Group-CloudLicensing.Read.All, Group.Read.All, Group.ReadWrite.All, User.Read.All, User.ReadWrite.All| |
| 46 | + |
| 47 | +## HTTP request |
| 48 | + |
| 49 | +<!-- { |
| 50 | + "blockType": "ignored" |
| 51 | +} |
| 52 | +--> |
| 53 | +``` http |
| 54 | +GET /groups/{groupId}/cloudLicensing/usageRights/{usageRightId} |
| 55 | +GET /me/cloudLicensing/usageRights/{usageRightId} |
| 56 | +GET /users/{userId}/cloudLicensing/usageRights/{usageRightId} |
| 57 | +``` |
| 58 | + |
| 59 | +## Optional query parameters |
| 60 | + |
| 61 | +This method supports the `$select` OData query parameter to help customize the response. For general information, see [OData query parameters](/graph/query-parameters). |
| 62 | + |
| 63 | +## Request headers |
| 64 | + |
| 65 | +|Name|Description| |
| 66 | +|:---|:---| |
| 67 | +|Authorization|Bearer {token}. Required. Learn more about [authentication and authorization](/graph/auth/auth-concepts).| |
| 68 | + |
| 69 | +## Request body |
| 70 | + |
| 71 | +Don't supply a request body for this method. |
| 72 | + |
| 73 | +## Response |
| 74 | + |
| 75 | +If successful, this method returns a `200 OK` response code and a [microsoft.graph.cloudLicensing.usageRight](../resources/cloudlicensing-usageright.md) object in the response body. |
| 76 | + |
| 77 | +## Examples |
| 78 | + |
| 79 | +### Example 1: Get a usageRight for a user |
| 80 | + |
| 81 | +The following example shows how to get a usage right for a user. |
| 82 | + |
| 83 | +#### Request |
| 84 | + |
| 85 | +The following example shows a request. |
| 86 | +<!-- { |
| 87 | + "blockType": "request", |
| 88 | + "name": "cloudlicensing-usageright-get-example", |
| 89 | + "sampleKeys": ["48fbdf70-9e09-40df-9dbe-17af483ab113","i6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby3"] |
| 90 | +} |
| 91 | +--> |
| 92 | +``` http |
| 93 | +GET https://graph.microsoft.com/beta/users/48fbdf70-9e09-40df-9dbe-17af483ab113/cloudLicensing/usageRights/i6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby3 |
| 94 | +``` |
| 95 | + |
| 96 | +#### Response |
| 97 | + |
| 98 | +The following example shows the response. |
| 99 | +>**Note:** The response object shown here might be shortened for readability. |
| 100 | +<!-- { |
| 101 | + "blockType": "response", |
| 102 | + "truncated": true, |
| 103 | + "@odata.type": "microsoft.graph.cloudLicensing.usageRight" |
| 104 | +} |
| 105 | +--> |
| 106 | +``` http |
| 107 | +HTTP/1.1 200 OK |
| 108 | +Content-Type: application/json |
| 109 | +
|
| 110 | +{ |
| 111 | + "@odata.type": "#microsoft.graph.cloudLicensing.usageRight", |
| 112 | + "id": "i6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby3", |
| 113 | + "skuId": "639dec6b-bb19-468b-871c-c5c441c4b0cb", |
| 114 | + "skuPartNumber": "Microsoft_365_Copilot", |
| 115 | + "services": [ |
| 116 | + { |
| 117 | + "@odata.type": "microsoft.graph.cloudLicensing.service", |
| 118 | + "assignableTo": "user,group", |
| 119 | + "planId": "fe6c28b3-d468-44ea-bbd0-a10a5167435c", |
| 120 | + "planName": "COPILOT_STUDIO_IN_COPILOT_FOR_M365" |
| 121 | + } |
| 122 | + ] |
| 123 | +} |
| 124 | +``` |
| 125 | + |
| 126 | +### Example 2: Get a usageRight for a group |
| 127 | + |
| 128 | +The following example shows how to get a usage right for a group. |
| 129 | + |
| 130 | +#### Request |
| 131 | + |
| 132 | +The following example shows a request. |
| 133 | +<!-- { |
| 134 | + "blockType": "request", |
| 135 | + "name": "cloudlicensing-usageright-get-2-example", |
| 136 | + "sampleKeys": ["1003985b-dfc1-4f42-97d4-65f70a335ca8","j6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby4"] |
| 137 | +} |
| 138 | +--> |
| 139 | +``` http |
| 140 | +GET https://graph.microsoft.com/beta/groups/1003985b-dfc1-4f42-97d4-65f70a335ca8/cloudLicensing/usageRights/j6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby4 |
| 141 | +``` |
| 142 | + |
| 143 | +#### Response |
| 144 | + |
| 145 | +The following example shows the response. |
| 146 | +>**Note:** The response object shown here might be shortened for readability. |
| 147 | +<!-- { |
| 148 | + "blockType": "response", |
| 149 | + "truncated": true, |
| 150 | + "@odata.type": "microsoft.graph.cloudLicensing.usageRight" |
| 151 | +} |
| 152 | +--> |
| 153 | +``` http |
| 154 | +HTTP/1.1 200 OK |
| 155 | +Content-Type: application/json |
| 156 | +
|
| 157 | +{ |
| 158 | + "@odata.type": "#microsoft.graph.cloudLicensing.usageRight", |
| 159 | + "id": "j6sq63x2vd3esbkifv7m42xdaugc6lfpqf3ozgvdlvk3ttnamby4", |
| 160 | + "skuId": "639dec6b-bb19-468b-871c-c5c441c4b0cb", |
| 161 | + "skuPartNumber": "Microsoft_365_Copilot", |
| 162 | + "services": [ |
| 163 | + { |
| 164 | + "@odata.type": "microsoft.graph.cloudLicensing.service", |
| 165 | + "assignableTo": "user,group", |
| 166 | + "planId": "fe6c28b3-d468-44ea-bbd0-a10a5167435c", |
| 167 | + "planName": "COPILOT_STUDIO_IN_COPILOT_FOR_M365" |
| 168 | + } |
| 169 | + ] |
| 170 | +} |
| 171 | +``` |
0 commit comments