Skip to content

Commit ea9e20e

Browse files
authored
Match examples for assignLicense APIs
1 parent 0941f83 commit ea9e20e

File tree

4 files changed

+76
-81
lines changed

4 files changed

+76
-81
lines changed

api-reference/beta/api/group-assignlicense.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ In the request body, provide a JSON object with the following parameters.
5656
| Parameter | Type | Description |
5757
| :------------- | :------------------------------------------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5858
| addLicenses | [assignedLicense](../resources/assignedlicense.md) collection | A collection of [assignedLicense](../resources/assignedlicense.md) objects that specify the licenses to add. You can disable servicePlans associated with a license by setting the **disabledPlans** property on an [assignedLicense](../resources/assignedlicense.md) object. |
59-
| removeLicenses | Guid collection | A collection of skuIds that identify the licenses to remove. Required. |
59+
| removeLicenses | Guid collection | A collection of skuIds that identify the licenses to remove. Required. Can be an empty collection. |
6060

6161
## Response
6262

@@ -156,7 +156,7 @@ location: https://graph.microsoft.com/v2/e8e96c2a-d787-4eb1-98d7-9e57c965f1de/di
156156
"id": "1132b215-826f-42a9-8cfe-1643d19d17fd",
157157
"createdDateTime": "2021-03-12T11:15:03Z",
158158
"groupTypes": [],
159-
"securityEnabled": true,
159+
"securityEnabled": true
160160
}
161161
```
162162

@@ -241,7 +241,7 @@ location: https://graph.microsoft.com/v2/e8e96c2a-d787-4eb1-98d7-9e57c965f1de/di
241241
"id": "1132b215-826f-42a9-8cfe-1643d19d17fd",
242242
"createdDateTime": "2021-03-12T11:15:03Z",
243243
"groupTypes": [],
244-
"securityEnabled": true,
244+
"securityEnabled": true
245245
}
246246
```
247247

api-reference/beta/api/user-assignlicense.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ In the request body, provide a JSON object with the following parameters.
4848
| Parameter | Type |Description|
4949
|:---------------|:--------|:----------|
5050
|addLicenses|[assignedLicense](../resources/assignedlicense.md) collection|A collection of [assignedLicense](../resources/assignedlicense.md) objects that specify the licenses to add. You can disable servicePlans associated with a license by setting the **disabledPlans** property on an [assignedLicense](../resources/assignedlicense.md) object.|
51-
|removeLicenses|Guid collection|A collection of skuIds that identify the licenses to remove. Required.|
51+
|removeLicenses|Guid collection|A collection of skuIds that identify the licenses to remove. Required. Can be an empty collection.|
5252

5353

5454
## Response

api-reference/v1.0/api/group-assignlicense.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ In the request body, provide a JSON object with the following parameters.
5454
| Parameter | Type | Description |
5555
| :------------- | :------------------------------------------------------------ | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5656
| addLicenses | [assignedLicense](../resources/assignedlicense.md) collection | A collection of [assignedLicense](../resources/assignedlicense.md) objects that specify the licenses to add. You can disable servicePlans associated with a license by setting the **disabledPlans** property on an [assignedLicense](../resources/assignedlicense.md) object. |
57-
| removeLicenses | Guid collection | A collection of skuIds that identify the licenses to remove. Required. |
57+
| removeLicenses | Guid collection | A collection of skuIds that identify the licenses to remove. Required. Can be an empty collection. |
5858

5959
## Response
6060

@@ -154,7 +154,7 @@ location: https://graph.microsoft.com/v2/e8e96c2a-d787-4eb1-98d7-9e57c965f1de/di
154154
"id": "1132b215-826f-42a9-8cfe-1643d19d17fd",
155155
"createdDateTime": "2021-03-12T11:15:03Z",
156156
"groupTypes": [],
157-
"securityEnabled": true,
157+
"securityEnabled": true
158158
}
159159
```
160160

@@ -241,7 +241,7 @@ location: https://graph.microsoft.com/v2/d056d009-17b3-4106-8173-cd3978ada898/di
241241
"deletedDateTime": null,
242242
"classification": null,
243243
"createdDateTime": "2018-04-18T22:05:03Z",
244-
"securityEnabled": true,
244+
"securityEnabled": true
245245
246246
}
247247
```

api-reference/v1.0/api/user-assignlicense.md

Lines changed: 69 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,18 @@ In the request body, provide a JSON object with the following parameters.
4444
| Parameter | Type |Description|
4545
|:---------------|:--------|:----------|
4646
|addLicenses|[assignedLicense](../resources/assignedlicense.md) collection|A collection of [assignedLicense](../resources/assignedlicense.md) objects that specify the licenses to add. You can disable servicePlans associated with a license by setting the **disabledPlans** property on an [assignedLicense](../resources/assignedlicense.md) object.|
47-
|removeLicenses|Guid collection|A collection of skuIds that identify the licenses to remove. Required.|
47+
|removeLicenses|Guid collection|A collection of skuIds that identify the licenses to remove. Required. Can be an empty collection.|
4848

4949
## Response
5050

5151
If successful, this method returns `200 OK` response code and [user](../resources/user.md) object in the response body.
5252

53-
## Example
54-
Here is an example of how to call this API.
55-
##### Request
56-
The following example shows a request.
53+
## Examples
54+
55+
### Example 1: Assign licenses to the signed-in user
56+
57+
#### Request
5758

58-
# [HTTP](#tab/http)
5959
<!-- {
6060
"blockType": "request",
6161
"name": "user_assignlicense"
@@ -65,52 +65,75 @@ POST https://graph.microsoft.com/v1.0/me/assignLicense
6565
Content-type: application/json
6666
6767
{
68-
"addLicenses": [
69-
{
70-
"disabledPlans": [ "11b0131d-43c8-4bbb-b2c8-e80f9a50834a" ],
71-
"skuId": "45715bb8-13f9-4bf6-927f-ef96c102d394"
72-
}
73-
],
74-
"removeLicenses": [ "bea13e0c-3828-4daa-a392-28af7ff61a0f" ]
68+
"addLicenses": [
69+
{
70+
"disabledPlans": [
71+
"8a256a2b-b617-496d-b51b-e76466e88db0"
72+
],
73+
"skuId": "84a661c4-e949-4bd2-a560-ed7766fcaf2b"
74+
},
75+
{
76+
"disabledPlans": [],
77+
"skuId": "f30db892-07e9-47e9-837c-80727f46fd3d"
78+
}
79+
],
80+
"removeLicenses": []
7581
}
7682
```
7783

78-
# [C#](#tab/csharp)
79-
[!INCLUDE [sample-code](../includes/snippets/csharp/user-assignlicense-csharp-snippets.md)]
80-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
81-
82-
# [CLI](#tab/cli)
83-
[!INCLUDE [sample-code](../includes/snippets/cli/user-assignlicense-cli-snippets.md)]
84-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
85-
86-
# [Go](#tab/go)
87-
[!INCLUDE [sample-code](../includes/snippets/go/user-assignlicense-go-snippets.md)]
88-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
89-
90-
# [Java](#tab/java)
91-
[!INCLUDE [sample-code](../includes/snippets/java/user-assignlicense-java-snippets.md)]
92-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
84+
#### Response
85+
>**Note:** The response object shown here might be shortened for readability.
86+
<!-- {
87+
"blockType": "response",
88+
"truncated": true,
89+
"@odata.type": "microsoft.graph.user"
90+
} -->
91+
```http
92+
HTTP/1.1 200 OK
93+
Content-type: application/json
9394
94-
# [JavaScript](#tab/javascript)
95-
[!INCLUDE [sample-code](../includes/snippets/javascript/user-assignlicense-javascript-snippets.md)]
96-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
95+
{
96+
"accountEnabled": true,
97+
"assignedLicenses": [
98+
{
99+
"disabledPlans": [
100+
"8a256a2b-b617-496d-b51b-e76466e88db0"
101+
],
102+
"skuId": "84a661c4-e949-4bd2-a560-ed7766fcaf2b"
103+
},
104+
{
105+
"disabledPlans": [],
106+
"skuId": "f30db892-07e9-47e9-837c-80727f46fd3d"
107+
}
108+
],
109+
"city": "Nairobi",
110+
"companyName": "Contoso"
111+
}
112+
```
97113

98-
# [PHP](#tab/php)
99-
[!INCLUDE [sample-code](../includes/snippets/php/user-assignlicense-php-snippets.md)]
100-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
114+
### Example 2: Remove licenses from the signed-in user
101115

102-
# [PowerShell](#tab/powershell)
103-
[!INCLUDE [sample-code](../includes/snippets/powershell/user-assignlicense-powershell-snippets.md)]
104-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
116+
#### Request
105117

106-
# [Python](#tab/python)
107-
[!INCLUDE [sample-code](../includes/snippets/python/user-assignlicense-python-snippets.md)]
108-
[!INCLUDE [sdk-documentation](../includes/snippets/snippets-sdk-documentation-link.md)]
118+
<!-- {
119+
"blockType": "request",
120+
"name": "user_assignlicense_removelicenses"
121+
}-->
122+
```http
123+
POST https://graph.microsoft.com/v1.0/me/assignLicense
124+
Content-type: application/json
109125
110-
---
126+
{
127+
"addLicenses": [],
128+
"removeLicenses": [
129+
"f30db892-07e9-47e9-837c-80727f46fd3d",
130+
"84a661c4-e949-4bd2-a560-ed7766fcaf2b"
131+
]
132+
}
133+
```
111134

112-
##### Response
113-
The following example shows the response. Note: The response object shown here might be shortened for readability.
135+
#### Response
136+
>**Note:** The response object shown here might be shortened for readability.
114137
<!-- {
115138
"blockType": "response",
116139
"truncated": true,
@@ -122,36 +145,8 @@ Content-type: application/json
122145
123146
{
124147
"accountEnabled": true,
125-
"assignedLicenses": [
126-
{
127-
"disabledPlans": [ "11b0131d-43c8-4bbb-b2c8-e80f9a50834a" ],
128-
"skuId": "0118A350-71FC-4EC3-8F0C-6A1CB8867561"
129-
}
130-
],
131-
"assignedPlans": [
132-
{
133-
"assignedDateTime": "2016-10-02T12:13:14Z",
134-
"capabilityStatus": "capabilityStatus-value",
135-
"service": "service-value",
136-
"servicePlanId": "bea13e0c-3828-4daa-a392-28af7ff61a0f"
137-
}
138-
],
139-
"businessPhones": [
140-
"businessPhones-value"
141-
],
142-
"city": "city-value",
143-
"companyName": "companyName-value"
148+
"assignedLicenses": [],
149+
"city": "Nairobi",
150+
"companyName": "Contoso"
144151
}
145152
```
146-
147-
<!-- uuid: 8fcb5dbc-d5aa-4681-8e31-b001d5168d79
148-
2015-10-25 14:57:30 UTC -->
149-
<!-- {
150-
"type": "#page.annotation",
151-
"description": "user: assignLicense",
152-
"keywords": "",
153-
"section": "documentation",
154-
"tocPath": "",
155-
"suppressions": [
156-
]
157-
}-->

0 commit comments

Comments
 (0)