AddResourcePermissions - Amazon WorkDocs

AddResourcePermissions

Creates a set of permissions for the specified folder or document. The resource permissions are overwritten if the principals already have different permissions.

Request Syntax

POST /api/v1/resources/ResourceId/permissions HTTP/1.1 Authentication: AuthenticationToken Content-type: application/json { "NotificationOptions": { "EmailMessage": "string", "SendEmail": boolean }, "Principals": [ { "Id": "string", "Role": "string", "Type": "string" } ] }

URI Request Parameters

The request uses the following URI parameters.

AuthenticationToken

Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

Length Constraints: Minimum length of 1. Maximum length of 8199.

ResourceId

The ID of the resource.

Length Constraints: Minimum length of 1. Maximum length of 128.

Pattern: [\w+-.@]+

Required: Yes

Request Body

The request accepts the following data in JSON format.

NotificationOptions

The notification options.

Type: NotificationOptions object

Required: No

Principals

The users, groups, or organization being granted permission.

Type: Array of SharePrincipal objects

Required: Yes

Response Syntax

HTTP/1.1 201 Content-type: application/json { "ShareResults": [ { "InviteePrincipalId": "string", "PrincipalId": "string", "Role": "string", "ShareId": "string", "Status": "string", "StatusMessage": "string" } ] }

Response Elements

If the action is successful, the service sends back an HTTP 201 response.

The following data is returned in JSON format by the service.

ShareResults

The share results.

Type: Array of ShareResult objects

Errors

For information about the errors that are common to all actions, see Common Errors.

FailedDependencyException

The AWS Directory Service cannot reach an on-premises instance. Or a dependency under the control of the organization is failing, such as a connected Active Directory.

HTTP Status Code: 424

ProhibitedStateException

The specified document version is not in the INITIALIZED state.

HTTP Status Code: 409

ServiceUnavailableException

One or more of the dependencies is unavailable.

HTTP Status Code: 503

UnauthorizedOperationException

The operation is not permitted.

HTTP Status Code: 403

UnauthorizedResourceAccessException

The caller does not have access to perform the action on the resource.

HTTP Status Code: 404

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: