Skip to main content

documents

Creates, updates, deletes, gets or lists a documents resource.

Overview

Namedocuments
TypeResource
Idaws.workdocs.documents

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
custom_metadataobjectThe custom metadata on the document.
metadataobjectThe metadata details of the document.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_documentselectdocument_id, regionAuthentication, includeCustomMetadataRetrieves details of a document.
update_documentupdatedocument_id, regionAuthenticationUpdates the specified attributes of a document. The user must have access to both the document and its parent folder, if applicable.
delete_documentdeletedocument_id, regionAuthenticationPermanently deletes the specified document and its associated metadata.
abort_document_version_uploadexecdocument_id, version_id, regionAuthenticationAborts the upload of the specified document version that was previously initiated by InitiateDocumentVersionUpload. The client should make this call only when it no longer intends to upload the document version, or fails to do so.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
document_idstringThe ID of the document.
regionstringAWS region (default: us-east-1)
version_idstringThe ID of the version.
AuthenticationstringAmazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.
includeCustomMetadatabooleanSet this to TRUE to include custom metadata in the response.

SELECT examples

Retrieves details of a document.

SELECT
custom_metadata,
metadata
FROM aws.workdocs.documents
WHERE document_id = '{{ document_id }}' -- required
AND region = '{{ region }}' -- required
AND Authentication = '{{ Authentication }}'
AND includeCustomMetadata = '{{ includeCustomMetadata }}'
;

UPDATE examples

Updates the specified attributes of a document. The user must have access to both the document and its parent folder, if applicable.

UPDATE aws.workdocs.documents
SET
Name = '{{ Name }}',
ParentFolderId = '{{ ParentFolderId }}',
ResourceState = '{{ ResourceState }}'
WHERE
document_id = '{{ document_id }}' --required
AND region = '{{ region }}' --required
AND Authentication = '{{ Authentication}}';

DELETE examples

Permanently deletes the specified document and its associated metadata.

DELETE FROM aws.workdocs.documents
WHERE document_id = '{{ document_id }}' --required
AND region = '{{ region }}' --required
AND Authentication = '{{ Authentication }}'
;

Lifecycle Methods

Aborts the upload of the specified document version that was previously initiated by InitiateDocumentVersionUpload. The client should make this call only when it no longer intends to upload the document version, or fails to do so.

EXEC aws.workdocs.documents.abort_document_version_upload
@document_id='{{ document_id }}' --required,
@version_id='{{ version_id }}' --required,
@region='{{ region }}' --required,
@Authentication='{{ Authentication }}'
;