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

***********************
start_attachment_upload
***********************



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

  

  Provides a pre-signed Amazon S3 URL in response for uploading the file directly to S3.

   

  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::

    

    ``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/StartAttachmentUpload>`_  


  **Request Syntax**
  ::

    response = client.start_attachment_upload(
        ContentType='string',
        AttachmentSizeInBytes=123,
        AttachmentName='string',
        ClientToken='string',
        ConnectionToken='string'
    )
    
  :type ContentType: string
  :param ContentType: **[REQUIRED]** 

    Describes the MIME file type of the attachment. For a list of supported file types, see `Feature specifications <https://docs.aws.amazon.com/connect/latest/adminguide/feature-limits.html>`__ in the *Amazon Connect Administrator Guide*.

    

  
  :type AttachmentSizeInBytes: integer
  :param AttachmentSizeInBytes: **[REQUIRED]** 

    The size of the attachment in bytes.

    

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

    A case-sensitive name of the attachment being uploaded.

    

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

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see `Making retries safe with idempotent APIs <https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/>`__.

    This field is autopopulated if not provided.

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

    The authentication token associated with the participant's connection.

    

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

    
    ::

      {
          'AttachmentId': 'string',
          'UploadMetadata': {
              'Url': 'string',
              'UrlExpiry': 'string',
              'HeadersToInclude': {
                  'string': 'string'
              }
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **AttachmentId** *(string) --* 

        A unique identifier for the attachment.

        
      

      - **UploadMetadata** *(dict) --* 

        The headers to be provided while uploading the file to the URL.

        
        

        - **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.

          
        

        - **HeadersToInclude** *(dict) --* 

          The headers to be provided while uploading the file to the URL.

          
          

          - *(string) --* 
            

            - *(string) --* 
      
    
    
  
  **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`

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

  