Redigera

Dela via


plannerRoster: assignSensitivityLabel

Namespace: microsoft.graph

Important

APIs under the /beta version in Microsoft Graph are subject to change. Use of these APIs in production applications is not supported. To determine whether an API is available in v1.0, use the Version selector.

Assign a sensitivity label to a plannerRoster object.

This API is available in the following national cloud deployments.

Global service US Government L4 US Government L5 (DOD) China operated by 21Vianet

Permissions

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.

Permission type Least privileged permissions Higher privileged permissions
Delegated (work or school account) Tasks.ReadWrite Not available.
Delegated (personal Microsoft account) Not supported. Not supported.
Application Tasks.ReadWrite.All Not available.

HTTP request

POST /planner/rosters/{rosterId}/assignSensitivityLabel

Request headers

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.

Request body

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. Possible values are: standard, privileged, auto, unknownFutureValue.
sensitivityLabelId String The ID of the label that's applied to the roster.

Response

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.

Examples

Request

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"
}

Response

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"
  }
}