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