:doc:`WorkDocs <../../workdocs>` / Client / initiate_document_version_upload

********************************
initiate_document_version_upload
********************************



.. py:method:: 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 <https://docs.aws.amazon.com/goto/WebAPI/workdocs-2016-05-01/InitiateDocumentVersionUpload>`_  


  **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'
    )
    
  :type AuthenticationToken: string
  :param AuthenticationToken: 

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

    

  
  :type Id: string
  :param Id: 

    The ID of the document.

    

  
  :type Name: string
  :param Name: 

    The name of the document.

    

  
  :type ContentCreatedTimestamp: datetime
  :param ContentCreatedTimestamp: 

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

    

  
  :type ContentModifiedTimestamp: datetime
  :param ContentModifiedTimestamp: 

    The timestamp when the content of the document was modified.

    

  
  :type ContentType: string
  :param ContentType: 

    The content type of the document.

    

  
  :type DocumentSizeInBytes: integer
  :param DocumentSizeInBytes: 

    The size of the document, in bytes.

    

  
  :type ParentFolderId: string
  :param ParentFolderId: 

    The ID of the parent folder.

    

  
  
  :rtype: 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**
  
  *   :py:class:`WorkDocs.Client.exceptions.EntityNotExistsException`

  
  *   :py:class:`WorkDocs.Client.exceptions.EntityAlreadyExistsException`

  
  *   :py:class:`WorkDocs.Client.exceptions.StorageLimitExceededException`

  
  *   :py:class:`WorkDocs.Client.exceptions.StorageLimitWillExceedException`

  
  *   :py:class:`WorkDocs.Client.exceptions.LimitExceededException`

  
  *   :py:class:`WorkDocs.Client.exceptions.ProhibitedStateException`

  
  *   :py:class:`WorkDocs.Client.exceptions.UnauthorizedOperationException`

  
  *   :py:class:`WorkDocs.Client.exceptions.UnauthorizedResourceAccessException`

  
  *   :py:class:`WorkDocs.Client.exceptions.FailedDependencyException`

  
  *   :py:class:`WorkDocs.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`WorkDocs.Client.exceptions.DraftUploadOutOfSyncException`

  
  *   :py:class:`WorkDocs.Client.exceptions.ResourceAlreadyCheckedOutException`

  
  *   :py:class:`WorkDocs.Client.exceptions.InvalidPasswordException`

  
  *   :py:class:`WorkDocs.Client.exceptions.InvalidArgumentException`

  