| title | plannerRoster: assignSensitivityLabel |
|---|---|
| description | Assign a sensitivity label to a plannerRoster object. |
| ms.localizationpriority | medium |
| author | WiRawlinWork |
| ms.subservice | planner |
| doc_type | apiPageType |
| ms.date | 07/11/2024 |
Namespace: microsoft.graph
[!INCLUDE beta-disclaimer]
Assign a sensitivity label to a plannerRoster object.
[!INCLUDE national-cloud-support]
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]
POST /planner/rosters/{rosterId}/assignSensitivityLabel| Name | Description |
|---|---|
| Authorization | Bearer {token}. Required. Learn more about authentication and authorization. |
| Content-Type | application/json. Required. |
| If-Match | If-match: {etag}. Last known ETag value for the plannerRoster to be updated. Required. |
In the request body, provide a JSON object with the following parameters.
| Parameter | Type | Description |
|---|---|---|
| assignmentMethod | sensitivityLabelAssignmentMethod | The method that is used to apply the sensitivity label to the roster. The possible values are: standard, privileged, auto, unknownFutureValue. |
| sensitivityLabelId | String | The ID of the label that's applied to the roster. |
If successful, this method returns a 200 OK response code and a plannerRoster object in the response body.
This method fails in the following situations, each with a respective response code. The code property in the error response indicates the specific error.
| Response code | Description | Code property value |
|---|---|---|
400 Bad Request |
If the label has sublabels, it can't be applied to the roster. Only labels without sublabels can be applied. The request fails. | sensitivityLabelHasSublabels |
403 Forbidden |
If labels are mandatory for the user and the user tries to remove the sensitivity label, the request fails. | sensitivityLabelsAreMandatory |
403 Forbidden |
If a previously existing label assignment was applied with sensitivityLabelAssignmentMethod.privileged and an app attempts to overwrite the label with sensitivityLabelAssignmentMethod.standard, the request fails. |
existingSensitivityLabelWasAppliedWithPrivilegedMethod |
404 Not Found |
If a label can't be found or the label isn't in scope for the user, the request fails. | sensitivityLabelNotFound |
For more information, see Microsoft Graph error responses and resource types.
The following example shows a request.
POST https://graph.microsoft.com/beta/planner/rosters/3e34de02-b01d-423b-b2ae-ca0ccd1fab05/assignSensitivityLabel
Content-type: application/json
If-Match: "W/\"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc=\""
{
"assignmentMethod" : "standard",
"sensitivityLabelId": "7a4d7cc1-f72b-46a3-9831-02680eaf56f9"
}[!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]
The following example shows the response to the updated roster.
Note: The response object shown here might be shortened for readability.
HTTP/1.1 200 OK
Content-Type: application/json
{
"@odata.type": "#microsoft.graph.plannerRoster",
"id": "6519868f-868f-6519-8f86-19658f861965",
"assignedSensitivityLabel": {
"assignmentMethod" : "standard",
"sensitivityLabelId": "720b42d7-d945-46cd-81f8-8dd825d01960",
"tenantId": "88397d78-d160-4545-a01f-cceda28d3fe3"
}
}