:doc:`ChimeSDKVoice <../../chime-sdk-voice>` / Client / associate_phone_numbers_with_voice_connector

********************************************
associate_phone_numbers_with_voice_connector
********************************************



.. py:method:: ChimeSDKVoice.Client.associate_phone_numbers_with_voice_connector(**kwargs)

  

  Associates phone numbers with the specified Amazon Chime SDK Voice Connector.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-voice-2022-08-03/AssociatePhoneNumbersWithVoiceConnector>`_  


  **Request Syntax**
  ::

    response = client.associate_phone_numbers_with_voice_connector(
        VoiceConnectorId='string',
        E164PhoneNumbers=[
            'string',
        ],
        ForceAssociate=True|False
    )
    
  :type VoiceConnectorId: string
  :param VoiceConnectorId: **[REQUIRED]** 

    The Voice Connector ID.

    

  
  :type E164PhoneNumbers: list
  :param E164PhoneNumbers: **[REQUIRED]** 

    List of phone numbers, in E.164 format.

    

  
    - *(string) --* 

    

  :type ForceAssociate: boolean
  :param ForceAssociate: 

    If true, associates the provided phone numbers with the provided Amazon Chime SDK Voice Connector and removes any previously existing associations. If false, does not associate any phone numbers that have previously existing associations.

    

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

    
    ::

      {
          'PhoneNumberErrors': [
              {
                  'PhoneNumberId': 'string',
                  'ErrorCode': 'BadRequest'|'Conflict'|'Forbidden'|'NotFound'|'PreconditionFailed'|'ResourceLimitExceeded'|'ServiceFailure'|'AccessDenied'|'ServiceUnavailable'|'Throttled'|'Throttling'|'Unauthorized'|'Unprocessable'|'VoiceConnectorGroupAssociationsExist'|'PhoneNumberAssociationsExist'|'Gone',
                  'ErrorMessage': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **PhoneNumberErrors** *(list) --* 

        If the action fails for one or more of the phone numbers in the request, a list of the phone numbers is returned, along with error codes and error messages.

        
        

        - *(dict) --* 

          If a phone number action fails for one or more of the phone numbers in a request, a list of the failed phone numbers is returned, along with error codes and error messages.

          
          

          - **PhoneNumberId** *(string) --* 

            The phone number ID for which the action failed.

            
          

          - **ErrorCode** *(string) --* 

            The error code.

            
          

          - **ErrorMessage** *(string) --* 

            The error message.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`ChimeSDKVoice.Client.exceptions.UnauthorizedClientException`

  
  *   :py:class:`ChimeSDKVoice.Client.exceptions.NotFoundException`

  
  *   :py:class:`ChimeSDKVoice.Client.exceptions.ForbiddenException`

  
  *   :py:class:`ChimeSDKVoice.Client.exceptions.BadRequestException`

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

  
  *   :py:class:`ChimeSDKVoice.Client.exceptions.ThrottledClientException`

  
  *   :py:class:`ChimeSDKVoice.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`ChimeSDKVoice.Client.exceptions.ServiceFailureException`

  