:doc:`SNS <../../sns>` / Client / confirm_subscription

********************
confirm_subscription
********************



.. py:method:: SNS.Client.confirm_subscription(**kwargs)

  

  Verifies an endpoint owner's intent to receive messages by validating the token sent to the endpoint by an earlier ``Subscribe`` action. If the token is valid, the action creates a new subscription and returns its Amazon Resource Name (ARN). This call requires an AWS signature only when the ``AuthenticateOnUnsubscribe`` flag is set to "true".

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/sns-2010-03-31/ConfirmSubscription>`_  


  **Request Syntax**
  ::

    response = client.confirm_subscription(
        TopicArn='string',
        Token='string',
        AuthenticateOnUnsubscribe='string'
    )
    
  :type TopicArn: string
  :param TopicArn: **[REQUIRED]** 

    The ARN of the topic for which you wish to confirm a subscription.

    

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

    Short-lived token sent to an endpoint during the ``Subscribe`` action.

    

  
  :type AuthenticateOnUnsubscribe: string
  :param AuthenticateOnUnsubscribe: 

    Disallows unauthenticated unsubscribes of the subscription. If the value of this parameter is ``true`` and the request has an Amazon Web Services signature, then only the topic owner and the subscription owner can unsubscribe the endpoint. The unsubscribe action requires Amazon Web Services authentication.

    

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

    
    ::

      {
          'SubscriptionArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Response for ConfirmSubscriptions action.

      
      

      - **SubscriptionArn** *(string) --* 

        The ARN of the created subscription.

        
  
  **Exceptions**
  
  *   :py:class:`SNS.Client.exceptions.SubscriptionLimitExceededException`

  
  *   :py:class:`SNS.Client.exceptions.InvalidParameterException`

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

  
  *   :py:class:`SNS.Client.exceptions.InternalErrorException`

  
  *   :py:class:`SNS.Client.exceptions.AuthorizationErrorException`

  
  *   :py:class:`SNS.Client.exceptions.FilterPolicyLimitExceededException`

  
  *   :py:class:`SNS.Client.exceptions.ReplayLimitExceededException`

  