:doc:`QBusiness <../../qbusiness>` / Client / list_attachments

****************
list_attachments
****************



.. py:method:: QBusiness.Client.list_attachments(**kwargs)

  

  Gets a list of attachments associated with an Amazon Q Business web experience or a list of attachements associated with a specific Amazon Q Business conversation.

  

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


  **Request Syntax**
  ::

    response = client.list_attachments(
        applicationId='string',
        conversationId='string',
        userId='string',
        nextToken='string',
        maxResults=123
    )
    
  :type applicationId: string
  :param applicationId: **[REQUIRED]** 

    The unique identifier for the Amazon Q Business application.

    

  
  :type conversationId: string
  :param conversationId: 

    The unique identifier of the Amazon Q Business web experience conversation.

    

  
  :type userId: string
  :param userId: 

    The unique identifier of the user involved in the Amazon Q Business web experience conversation.

    

  
  :type nextToken: string
  :param nextToken: 

    If the number of attachments returned exceeds ``maxResults``, Amazon Q Business returns a next token as a pagination token to retrieve the next set of attachments.

    

  
  :type maxResults: integer
  :param maxResults: 

    The maximum number of attachements to return.

    

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

    
    ::

      {
          'attachments': [
              {
                  'attachmentId': 'string',
                  'conversationId': 'string',
                  'name': 'string',
                  'copyFrom': {
                      'conversation': {
                          'conversationId': 'string',
                          'attachmentId': 'string'
                      }
                  },
                  'fileType': 'string',
                  'fileSize': 123,
                  'md5chksum': 'string',
                  'createdAt': datetime(2015, 1, 1),
                  'status': 'FAILED'|'SUCCESS',
                  'error': {
                      'errorMessage': 'string',
                      'errorCode': 'InternalError'|'InvalidRequest'|'ResourceInactive'|'ResourceNotFound'
                  }
              },
          ],
          'nextToken': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **attachments** *(list) --* 

        An array of information on one or more attachments.

        
        

        - *(dict) --* 

          An attachment in an Amazon Q Business conversation.

          
          

          - **attachmentId** *(string) --* 

            The identifier of the Amazon Q Business attachment.

            
          

          - **conversationId** *(string) --* 

            The identifier of the Amazon Q Business conversation the attachment is associated with.

            
          

          - **name** *(string) --* 

            Filename of the Amazon Q Business attachment.

            
          

          - **copyFrom** *(dict) --* 

            A CopyFromSource containing a reference to the original source of the Amazon Q Business attachment.

            .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``conversation``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                        'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


          
            

            - **conversation** *(dict) --* 

              A reference to an attachment in an existing conversation.

              
              

              - **conversationId** *(string) --* 

                The unique identifier of the Amazon Q Business conversation.

                
              

              - **attachmentId** *(string) --* 

                The unique identifier of the Amazon Q Business attachment.

                
          
        
          

          - **fileType** *(string) --* 

            Filetype of the Amazon Q Business attachment.

            
          

          - **fileSize** *(integer) --* 

            Size in bytes of the Amazon Q Business attachment.

            
          

          - **md5chksum** *(string) --* 

            MD5 checksum of the Amazon Q Business attachment contents.

            
          

          - **createdAt** *(datetime) --* 

            The Unix timestamp when the Amazon Q Business attachment was created.

            
          

          - **status** *(string) --* 

            AttachmentStatus of the Amazon Q Business attachment.

            
          

          - **error** *(dict) --* 

            ErrorDetail providing information about a Amazon Q Business attachment error.

            
            

            - **errorMessage** *(string) --* 

              The message explaining the Amazon Q Business request error.

              
            

            - **errorCode** *(string) --* 

              The code associated with the Amazon Q Business request error.

              
        
      
    
      

      - **nextToken** *(string) --* 

        If the response is truncated, Amazon Q Business returns this token, which you can use in a later request to list the next set of attachments.

        
  
  **Exceptions**
  
  *   :py:class:`QBusiness.Client.exceptions.InternalServerException`

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

  
  *   :py:class:`QBusiness.Client.exceptions.LicenseNotFoundException`

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

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

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

  