The ConfirmSubscription action 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”.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The ARN of the topic for which you wish to confirm a subscription. |
|
|
Required |
Short-lived token sent to an endpoint during the Subscribe action. |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Confirm a subscription to a topic.
$sns = new AmazonSNS(); // Subscribe to notifications $response = $sns->confirm_subscription( 'arn:aws:sns:us-east-1:9876543210:my-topic', // $topic '0NNAq8PwvXvg8EfAYG9sSmwKTZeixZgZNE6PbodG8td0DJ3gVOmjI2Gh/oFnb0Ie=' // $token ); // Success? var_dump($response->isOK());Result:
bool(true)
Related Methods
Source
Method defined in services/sns.class.php | Toggle source view (8 lines) | View on GitHub