unsubscribe ( $subscription_arn, $opt )

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

$subscription_arn

string

Required

The ARN of the subscription to be deleted.

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

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

public function unsubscribe($subscription_arn, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['SubscriptionArn'] = $subscription_arn;
    
    return $this->authenticate('Unsubscribe', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback