:doc:`ConnectParticipant <../../connectparticipant>` / Client / get_attachment

**************
get_attachment
**************



.. py:method:: ConnectParticipant.Client.get_attachment(**kwargs)

  

  Provides a pre-signed URL for download of a completed attachment. This is an asynchronous API for use with active contacts.

   

  For security recommendations, see `Amazon Connect Chat security best practices <https://docs.aws.amazon.com/connect/latest/adminguide/security-best-practices.html#bp-security-chat>`__.

   

  .. note::

    

    
    * The participant role ``CUSTOM_BOT`` is not permitted to access attachments customers may upload. An ``AccessDeniedException`` can indicate that the participant may be a CUSTOM_BOT, and it doesn't have access to attachments.
     
    * ``ConnectionToken`` is used for invoking this API instead of ``ParticipantToken``.
    

    

   

  The Amazon Connect Participant Service APIs do not use `Signature Version 4 authentication <https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html>`__.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/connectparticipant-2018-09-07/GetAttachment>`_  


  **Request Syntax**
  ::

    response = client.get_attachment(
        AttachmentId='string',
        ConnectionToken='string',
        UrlExpiryInSeconds=123
    )
    
  :type AttachmentId: string
  :param AttachmentId: **[REQUIRED]** 

    A unique identifier for the attachment.

    

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

    The authentication token associated with the participant's connection.

    

  
  :type UrlExpiryInSeconds: integer
  :param UrlExpiryInSeconds: 

    The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.

    

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

    
    ::

      {
          'Url': 'string',
          'UrlExpiry': 'string',
          'AttachmentSizeInBytes': 123
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **Url** *(string) --* 

        This is the pre-signed URL that can be used for uploading the file to Amazon S3 when used in response to `StartAttachmentUpload <https://docs.aws.amazon.com/connect-participant/latest/APIReference/API_StartAttachmentUpload.html>`__.

        
      

      - **UrlExpiry** *(string) --* 

        The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z.

        
      

      - **AttachmentSizeInBytes** *(integer) --* 

        The size of the attachment in bytes.

        
  
  **Exceptions**
  
  *   :py:class:`ConnectParticipant.Client.exceptions.AccessDeniedException`

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

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

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

  