:doc:`QConnect <../../qconnect>` / Client / start_content_upload

********************
start_content_upload
********************



.. py:method:: QConnect.Client.start_content_upload(**kwargs)

  

  Get a URL to upload content to a knowledge base. To upload content, first make a PUT request to the returned URL with your file, making sure to include the required headers. Then use `CreateContent <https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_CreateContent.html>`__ to finalize the content creation process or `UpdateContent <https://docs.aws.amazon.com/amazon-q-connect/latest/APIReference/API_UpdateContent.html>`__ to modify an existing resource. You can only upload content to a knowledge base of type CUSTOM.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/qconnect-2020-10-19/StartContentUpload>`_  


  **Request Syntax**
  ::

    response = client.start_content_upload(
        knowledgeBaseId='string',
        contentType='string',
        presignedUrlTimeToLive=123
    )
    
  :type knowledgeBaseId: string
  :param knowledgeBaseId: **[REQUIRED]** 

    The identifier of the knowledge base. Can be either the ID or the ARN. URLs cannot contain the ARN.

    

  
  :type contentType: string
  :param contentType: **[REQUIRED]** 

    The type of content to upload.

    

  
  :type presignedUrlTimeToLive: integer
  :param presignedUrlTimeToLive: 

    The expected expiration time of the generated presigned URL, specified in minutes.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'uploadId': 'string',
          'url': 'string',
          'urlExpiry': datetime(2015, 1, 1),
          'headersToInclude': {
              'string': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **uploadId** *(string) --* 

        The identifier of the upload.

        
      

      - **url** *(string) --* 

        The URL of the upload.

        
      

      - **urlExpiry** *(datetime) --* 

        The expiration time of the URL as an epoch timestamp.

        
      

      - **headersToInclude** *(dict) --* 

        The headers to include in the upload.

        
        

        - *(string) --* 
          

          - *(string) --* 
    
  
  
  **Exceptions**
  
  *   :py:class:`QConnect.Client.exceptions.ValidationException`

  
  *   :py:class:`QConnect.Client.exceptions.UnauthorizedException`

  
  *   :py:class:`QConnect.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`QConnect.Client.exceptions.ResourceNotFoundException`

  