:doc:`EndUserMessagingSocial <../../socialmessaging>` / Client / associate_whatsapp_business_account

***********************************
associate_whatsapp_business_account
***********************************



.. py:method:: EndUserMessagingSocial.Client.associate_whatsapp_business_account(**kwargs)

  

  This is only used through the Amazon Web Services console during sign-up to associate your WhatsApp Business Account to your Amazon Web Services account.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/socialmessaging-2024-01-01/AssociateWhatsAppBusinessAccount>`_  


  **Request Syntax**
  ::

    response = client.associate_whatsapp_business_account(
        signupCallback={
            'accessToken': 'string',
            'callbackUrl': 'string'
        },
        setupFinalization={
            'associateInProgressToken': 'string',
            'phoneNumbers': [
                {
                    'id': 'string',
                    'twoFactorPin': 'string',
                    'dataLocalizationRegion': 'string',
                    'tags': [
                        {
                            'key': 'string',
                            'value': 'string'
                        },
                    ]
                },
            ],
            'phoneNumberParent': 'string',
            'waba': {
                'id': 'string',
                'eventDestinations': [
                    {
                        'eventDestinationArn': 'string',
                        'roleArn': 'string'
                    },
                ],
                'tags': [
                    {
                        'key': 'string',
                        'value': 'string'
                    },
                ]
            }
        }
    )
    
  :type signupCallback: dict
  :param signupCallback: 

    Contains the callback access token.

    

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

      The access token for your WhatsApp Business Account. The ``accessToken`` value is provided by Meta.

      

    
    - **callbackUrl** *(string) --* 

      The URL where WhatsApp will send callback notifications for this account.

      

    
  
  :type setupFinalization: dict
  :param setupFinalization: 

    A JSON object that contains the phone numbers and WhatsApp Business Account to link to your account.

    

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

      An Amazon Web Services access token generated by ``WhatsAppSignupCallback`` and used by ``WhatsAppSetupFinalization``.

      

    
    - **phoneNumbers** *(list) --* **[REQUIRED]** 

      An array of WabaPhoneNumberSetupFinalization objects containing the details of each phone number associated with the WhatsApp Business Account.

      

    
      - *(dict) --* 

        The registration details for a linked phone number.

        

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

          The unique identifier of the originating phone number associated with the media. Phone number identifiers are formatted as ``phone-number-id-01234567890123456789012345678901``. Use the `GetLinkedWhatsAppBusinessAccount <https://docs.aws.amazon.com/social-messaging/latest/APIReference/API_GetLinkedWhatsAppBusinessAccount.html>`__ API action to find a phone number's id.

          

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

          The PIN to use for two-step verification. To reset your PIN follow the directions in `Updating PIN <https://developers.facebook.com/docs/whatsapp/cloud-api/reference/two-step-verification/#updating-pin>`__ in the *WhatsApp Business Platform Cloud API Reference*.

          

        
        - **dataLocalizationRegion** *(string) --* 

          The two letter ISO region for the location of where Meta will store data.

           

          **Asia–Pacific (APAC)**

           

          
          * Australia **AU**
           
          * Indonesia **ID**
           
          * India **IN**
           
          * Japan **JP**
           
          * Singapore **SG**
           
          * South Korea **KR**
          

           

          **Europe**

           

          
          * Germany **DE**
           
          * Switzerland **CH**
           
          * United Kingdom **GB**
          

           

          **Latin America (LATAM)**

           

          
          * Brazil **BR**
          

           

          **Middle East and Africa (MEA)**

           

          
          * Bahrain **BH**
           
          * South Africa **ZA**
           
          * United Arab Emirates **AE**
          

           

          **North America (NORAM)**

           

          
          * Canada **CA**
          

          

        
        - **tags** *(list) --* 

          An array of key and value pair tags.

          

        
          - *(dict) --* 

            The tag for a resource.

            

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

              The tag key.

              

            
            - **value** *(string) --* 

              The tag value.

              

            
          
      
      
  
    - **phoneNumberParent** *(string) --* 

      Used to add a new phone number to an existing WhatsApp Business Account. This field can't be used when the ``waba`` field is present.

      

    
    - **waba** *(dict) --* 

      Used to create a new WhatsApp Business Account and add a phone number. This field can't be used when the ``phoneNumberParent`` field is present.

      

    
      - **id** *(string) --* 

        The ID of the linked WhatsApp Business Account, formatted as ``waba-01234567890123456789012345678901``.

        

      
      - **eventDestinations** *(list) --* 

        The event destinations for the linked WhatsApp Business Account.

        

      
        - *(dict) --* 

          Contains information on the event destination.

          

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

            The ARN of the event destination.

            

          
          - **roleArn** *(string) --* 

            The Amazon Resource Name (ARN) of an Identity and Access Management role that is able to import phone numbers and write events.

            

          
        
    
      - **tags** *(list) --* 

        An array of key and value pair tags.

        

      
        - *(dict) --* 

          The tag for a resource.

          

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

            The tag key.

            

          
          - **value** *(string) --* 

            The tag value.

            

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

    
    ::

      {
          'signupCallbackResult': {
              'associateInProgressToken': 'string',
              'linkedAccountsWithIncompleteSetup': {
                  'string': {
                      'accountName': 'string',
                      'registrationStatus': 'COMPLETE'|'INCOMPLETE',
                      'unregisteredWhatsAppPhoneNumbers': [
                          {
                              'arn': 'string',
                              'phoneNumber': 'string',
                              'phoneNumberId': 'string',
                              'metaPhoneNumberId': 'string',
                              'displayPhoneNumberName': 'string',
                              'displayPhoneNumber': 'string',
                              'qualityRating': 'string',
                              'dataLocalizationRegion': 'string'
                          },
                      ],
                      'wabaId': 'string'
                  }
              }
          },
          'statusCode': 123
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **signupCallbackResult** *(dict) --* 

        Contains your WhatsApp registration status.

        
        

        - **associateInProgressToken** *(string) --* 

          An Amazon Web Services access token generated by ``WhatsAppSignupCallback`` and used by ``WhatsAppSetupFinalization``.

          
        

        - **linkedAccountsWithIncompleteSetup** *(dict) --* 

          A LinkedWhatsAppBusinessAccountIdMetaData object map containing the details of any WhatsAppBusiness accounts that have incomplete setup.

          
          

          - *(string) --* 
            

            - *(dict) --* 

              Contains your WhatsApp registration status and details of any unregistered WhatsApp phone number.

              
              

              - **accountName** *(string) --* 

                The name of your account.

                
              

              - **registrationStatus** *(string) --* 

                The registration status of the linked WhatsApp Business Account.

                
              

              - **unregisteredWhatsAppPhoneNumbers** *(list) --* 

                The details for unregistered WhatsApp phone numbers.

                
                

                - *(dict) --* 

                  The details of your WhatsApp phone number.

                  
                  

                  - **arn** *(string) --* 

                    The ARN of the WhatsApp phone number.

                    
                  

                  - **phoneNumber** *(string) --* 

                    The phone number for sending WhatsApp.

                    
                  

                  - **phoneNumberId** *(string) --* 

                    The phone number ID. Phone number identifiers are formatted as ``phone-number-id-01234567890123456789012345678901``.

                    
                  

                  - **metaPhoneNumberId** *(string) --* 

                    The phone number ID from Meta.

                    
                  

                  - **displayPhoneNumberName** *(string) --* 

                    The display name for this phone number.

                    
                  

                  - **displayPhoneNumber** *(string) --* 

                    The phone number that appears in the recipients display.

                    
                  

                  - **qualityRating** *(string) --* 

                    The quality rating of the phone number.

                    
                  

                  - **dataLocalizationRegion** *(string) --* 

                    The geographic region where the WhatsApp phone number's data is stored and processed.

                    
              
            
              

              - **wabaId** *(string) --* 

                The Amazon Resource Name (ARN) of the WhatsApp Business Account ID.

                
          
      
    
    
      

      - **statusCode** *(integer) --* 

        The status code for the response.

        
  
  **Exceptions**
  
  *   :py:class:`EndUserMessagingSocial.Client.exceptions.ValidationException`

  
  *   :py:class:`EndUserMessagingSocial.Client.exceptions.LimitExceededException`

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

  
  *   :py:class:`EndUserMessagingSocial.Client.exceptions.InvalidParametersException`

  
  *   :py:class:`EndUserMessagingSocial.Client.exceptions.ThrottledRequestException`

  
  *   :py:class:`EndUserMessagingSocial.Client.exceptions.DependencyException`

  