:doc:`PinpointSMSVoiceV2 <../../pinpoint-sms-voice-v2>` / Client / create_registration_attachment

******************************
create_registration_attachment
******************************



.. py:method:: PinpointSMSVoiceV2.Client.create_registration_attachment(**kwargs)

  

  Create a new registration attachment to use for uploading a file or a URL to a file. The maximum file size is 500KB and valid file extensions are PDF, JPEG and PNG. For example, many sender ID registrations require a signed “letter of authorization” (LOA) to be submitted.

   

  Use either ``AttachmentUrl`` or ``AttachmentBody`` to upload your attachment. If both are specified then an exception is returned.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/pinpoint-sms-voice-v2-2022-03-31/CreateRegistrationAttachment>`_  


  **Request Syntax**
  ::

    response = client.create_registration_attachment(
        AttachmentBody=b'bytes',
        AttachmentUrl='string',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ],
        ClientToken='string'
    )
    
  :type AttachmentBody: bytes
  :param AttachmentBody: 

    The registration file to upload. The maximum file size is 500KB and valid file extensions are PDF, JPEG and PNG.

    

  
  :type AttachmentUrl: string
  :param AttachmentUrl: 

    Registration files have to be stored in an Amazon S3 bucket. The URI to use when sending is in the format ``s3://BucketName/FileName``.

    

  
  :type Tags: list
  :param Tags: 

    An array of tags (key and value pairs) to associate with the registration attachment.

    

  
    - *(dict) --* 

      The list of tags to be added to the specified topic.

      

    
      - **Key** *(string) --* **[REQUIRED]** 

        The key identifier, or name, of the tag.

        

      
      - **Value** *(string) --* **[REQUIRED]** 

        The string value associated with the key of the tag.

        

      
    

  :type ClientToken: string
  :param ClientToken: 

    Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you don't specify a client token, a randomly generated token is used for the request to ensure idempotency.

    This field is autopopulated if not provided.

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

    
    ::

      {
          'RegistrationAttachmentArn': 'string',
          'RegistrationAttachmentId': 'string',
          'AttachmentStatus': 'UPLOAD_IN_PROGRESS'|'UPLOAD_COMPLETE'|'UPLOAD_FAILED'|'DELETED',
          'Tags': [
              {
                  'Key': 'string',
                  'Value': 'string'
              },
          ],
          'CreatedTimestamp': datetime(2015, 1, 1)
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **RegistrationAttachmentArn** *(string) --* 

        The Amazon Resource Name (ARN) for the registration attachment.

        
      

      - **RegistrationAttachmentId** *(string) --* 

        The unique identifier for the registration attachment.

        
      

      - **AttachmentStatus** *(string) --* 

        The status of the registration attachment.

         

        
        * ``UPLOAD_IN_PROGRESS`` The attachment is being uploaded.
         
        * ``UPLOAD_COMPLETE`` The attachment has been uploaded.
         
        * ``UPLOAD_FAILED`` The attachment failed to uploaded.
         
        * ``DELETED`` The attachment has been deleted..
        

        
      

      - **Tags** *(list) --* 

        An array of tags (key and value pairs) to associate with the registration attachment.

        
        

        - *(dict) --* 

          The list of tags to be added to the specified topic.

          
          

          - **Key** *(string) --* 

            The key identifier, or name, of the tag.

            
          

          - **Value** *(string) --* 

            The string value associated with the key of the tag.

            
      
    
      

      - **CreatedTimestamp** *(datetime) --* 

        The time when the registration attachment was created, in `UNIX epoch time <https://www.epochconverter.com/>`__ format.

        
  
  **Exceptions**
  
  *   :py:class:`PinpointSMSVoiceV2.Client.exceptions.ServiceQuotaExceededException`

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

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

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

  
  *   :py:class:`PinpointSMSVoiceV2.Client.exceptions.ConflictException`

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

  