The Unsubscribe action deletes a subscription. If the subscription requires authentication for deletion, only the owner of the subscription or the its topic’s owner can unsubscribe, and an AWS signature is required. If the Unsubscribe call does not require authentication and the requester is not the subscription owner, a final cancellation message is delivered to the endpoint, so that the endpoint owner can easily resubscribe to the topic if the Unsubscribe request was unintended.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The ARN of the subscription to be deleted. |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Unsubscribe from a topic.
$sns = new AmazonSNS(); // Unsubscribe from notifications $response = $sns->unsubscribe('arn:aws:sns:us-east-1:9876543210:my-topic:afe06644-0b1e-4f32-9f65-2dafe2d1e817'); // Success? var_dump($response->isOK());Result:
bool(true)
Related Methods
Source
Method defined in services/sns.class.php | Toggle source view (7 lines) | View on GitHub