WorkDocs / Client / initiate_document_version_upload

initiate_document_version_upload#

WorkDocs.Client.initiate_document_version_upload(**kwargs)#

Creates a new document object and version object.

The client specifies the parent folder ID and name of the document to upload. The ID is optionally specified when creating a new version of an existing document. This is the first step to upload a document. Next, upload the document to the URL returned from the call, and then call UpdateDocumentVersion.

To cancel the document upload, call AbortDocumentVersionUpload.

See also: AWS API Documentation

Request Syntax

response = client.initiate_document_version_upload(
    AuthenticationToken='string',
    Id='string',
    Name='string',
    ContentCreatedTimestamp=datetime(2015, 1, 1),
    ContentModifiedTimestamp=datetime(2015, 1, 1),
    ContentType='string',
    DocumentSizeInBytes=123,
    ParentFolderId='string'
)
Parameters:
  • AuthenticationToken (string) – Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.

  • Id (string) – The ID of the document.

  • Name (string) – The name of the document.

  • ContentCreatedTimestamp (datetime) – The timestamp when the content of the document was originally created.

  • ContentModifiedTimestamp (datetime) – The timestamp when the content of the document was modified.

  • ContentType (string) – The content type of the document.

  • DocumentSizeInBytes (integer) – The size of the document, in bytes.

  • ParentFolderId (string) – The ID of the parent folder.

Return type:

dict

Returns:

Response Syntax

{
    'Metadata': {
        'Id': 'string',
        'CreatorId': 'string',
        'ParentFolderId': 'string',
        'CreatedTimestamp': datetime(2015, 1, 1),
        'ModifiedTimestamp': datetime(2015, 1, 1),
        'LatestVersionMetadata': {
            'Id': 'string',
            'Name': 'string',
            'ContentType': 'string',
            'Size': 123,
            'Signature': 'string',
            'Status': 'INITIALIZED'|'ACTIVE',
            'CreatedTimestamp': datetime(2015, 1, 1),
            'ModifiedTimestamp': datetime(2015, 1, 1),
            'ContentCreatedTimestamp': datetime(2015, 1, 1),
            'ContentModifiedTimestamp': datetime(2015, 1, 1),
            'CreatorId': 'string',
            'Thumbnail': {
                'string': 'string'
            },
            'Source': {
                'string': 'string'
            }
        },
        'ResourceState': 'ACTIVE'|'RESTORING'|'RECYCLING'|'RECYCLED',
        'Labels': [
            'string',
        ]
    },
    'UploadMetadata': {
        'UploadUrl': 'string',
        'SignedHeaders': {
            'string': 'string'
        }
    }
}

Response Structure

  • (dict) –

    • Metadata (dict) –

      The document metadata.

      • Id (string) –

        The ID of the document.

      • CreatorId (string) –

        The ID of the creator.

      • ParentFolderId (string) –

        The ID of the parent folder.

      • CreatedTimestamp (datetime) –

        The time when the document was created.

      • ModifiedTimestamp (datetime) –

        The time when the document was updated.

      • LatestVersionMetadata (dict) –

        The latest version of the document.

        • Id (string) –

          The ID of the version.

        • Name (string) –

          The name of the version.

        • ContentType (string) –

          The content type of the document.

        • Size (integer) –

          The size of the document, in bytes.

        • Signature (string) –

          The signature of the document.

        • Status (string) –

          The status of the document.

        • CreatedTimestamp (datetime) –

          The timestamp when the document was first uploaded.

        • ModifiedTimestamp (datetime) –

          The timestamp when the document was last uploaded.

        • ContentCreatedTimestamp (datetime) –

          The timestamp when the content of the document was originally created.

        • ContentModifiedTimestamp (datetime) –

          The timestamp when the content of the document was modified.

        • CreatorId (string) –

          The ID of the creator.

        • Thumbnail (dict) –

          The thumbnail of the document.

          • (string) –

            • (string) –

        • Source (dict) –

          The source of the document.

          • (string) –

            • (string) –

      • ResourceState (string) –

        The resource state.

      • Labels (list) –

        List of labels on the document.

        • (string) –

    • UploadMetadata (dict) –

      The upload metadata.

      • UploadUrl (string) –

        The URL of the upload.

      • SignedHeaders (dict) –

        The signed headers.

        • (string) –

          • (string) –

Exceptions

  • WorkDocs.Client.exceptions.EntityNotExistsException

  • WorkDocs.Client.exceptions.EntityAlreadyExistsException

  • WorkDocs.Client.exceptions.StorageLimitExceededException

  • WorkDocs.Client.exceptions.StorageLimitWillExceedException

  • WorkDocs.Client.exceptions.LimitExceededException

  • WorkDocs.Client.exceptions.ProhibitedStateException

  • WorkDocs.Client.exceptions.UnauthorizedOperationException

  • WorkDocs.Client.exceptions.UnauthorizedResourceAccessException

  • WorkDocs.Client.exceptions.FailedDependencyException

  • WorkDocs.Client.exceptions.ServiceUnavailableException

  • WorkDocs.Client.exceptions.DraftUploadOutOfSyncException

  • WorkDocs.Client.exceptions.ResourceAlreadyCheckedOutException

  • WorkDocs.Client.exceptions.InvalidPasswordException

  • WorkDocs.Client.exceptions.InvalidArgumentException