:doc:`QApps <../../qapps>` / Client / import_document

***************
import_document
***************



.. py:method:: QApps.Client.import_document(**kwargs)

  

  Uploads a file that can then be used either as a default in a ``FileUploadCard`` from Q App definition or as a file that is used inside a single Q App run. The purpose of the document is determined by a scope parameter that indicates whether it is at the app definition level or at the app session level.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/qapps-2023-11-27/ImportDocument>`_  


  **Request Syntax**
  ::

    response = client.import_document(
        instanceId='string',
        cardId='string',
        appId='string',
        fileContentsBase64='string',
        fileName='string',
        scope='APPLICATION'|'SESSION',
        sessionId='string'
    )
    
  :type instanceId: string
  :param instanceId: **[REQUIRED]** 

    The unique identifier of the Amazon Q Business application environment instance.

    

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

    The unique identifier of the card the file is associated with.

    

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

    The unique identifier of the Q App the file is associated with.

    

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

    The base64-encoded contents of the file to upload.

    

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

    The name of the file being uploaded.

    

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

    Whether the file is associated with a Q App definition or a specific Q App session.

    

  
  :type sessionId: string
  :param sessionId: 

    The unique identifier of the Q App session the file is associated with, if applicable.

    

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

    
    ::

      {
          'fileId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **fileId** *(string) --* 

        The unique identifier assigned to the uploaded file.

        
  
  **Exceptions**
  
  *   :py:class:`QApps.Client.exceptions.ResourceNotFoundException`

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

  
  *   :py:class:`QApps.Client.exceptions.ValidationException`

  
  *   :py:class:`QApps.Client.exceptions.InternalServerException`

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

  
  *   :py:class:`QApps.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`QApps.Client.exceptions.ContentTooLargeException`

  
  *   :py:class:`QApps.Client.exceptions.ThrottlingException`

  