Create an environment share in Dynatrace with the Document API, granting read or read-write access to a document for users who claim the share.
| POST | SaaS | https://{your-environment-id}.apps.dynatrace.com/platform/document/v1/environment-shares |
Create an environment-share, which can be used to give one or multiple other users access to this document. This is only possible for documents you own, as well as for reshareable documents owned by other users to which you have write access.
A share can be created with either read or read-write access.
A document can have maximally one share per access type, therefore it's impossible to create multiple read-shares or multiple 'read-write'-shares for a single document.
This means, that you can create one read-share for a document, and this single read-share can be used to give read-access to an arbitrary number of users. The same applies to a 'read-write'-share.
Creating a share does not automatically allow users to access the document - only those users who explicitly claim the share gain access to the document.
Revoking access from users can be done by deleting the share.
To execute this request, you need a platform token or OAuth access token with document:environment-shares:write scope. To learn how to obtain and use it, see Tokens and authentication.
| Parameter | Type | Description | In | Required |
|---|---|---|---|---|
| body | Create | Input required to create a environment-share. | body | Optional |
CreateEnvShare objectInput required to create a environment-share.
| Element | Type | Description | Required |
|---|---|---|---|
| documentId | string | Document id. | Required |
| access | string | Specifies which permissions shall be granted via the share:
| Required |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
{"documentId": "string","access": "string"}
| Code | Type | Description |
|---|---|---|
| 201 | Environment | A new environment-share for the specified document has been created. |
| 400 | - | - |
| 401 | - | - |
| 403 | - | - |
| 404 | - | - |
| 409 | - | - |
| 500 | - | - |
| 503 | - | - |
| default | - | - |
EnvironmentShare object| Element | Type | Description |
|---|---|---|
| id | string | System-generated id of a share resource. |
| documentId | string | The shared document's id. |
| access | string[] | Indicates which operations you may apply to this document. For example, if you own the document, this array contains the values ['read', 'write', 'delete'].
|
| claimCount | integer | Number of users who have claimed this share and therefore can access the document and collaborate on it. |
{"id": "af21cc73-bb1c-45f1-ad1b-12e8f91b9fbc","documentId": "1d1cf013-fd4c-463e-a8ad-912485daf711","access": ["read","write"],"claimCount": 0}