GetSubscriptionAttributes - Amazon Simple Notification Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

GetSubscriptionAttributes

Returns all of the properties of a subscription.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

SubscriptionArn

The ARN of the subscription whose properties you want to get.

Type: String

Required: Yes

Response Elements

The following element is returned by the service.

Attributes
Attributes.entry.N.key (key)
Attributes.entry.N.value (value)

A map of the subscription's attributes. Attributes in this map include the following:

  • ConfirmationWasAuthenticatedtrue if the subscription confirmation request was authenticated.

  • DeliveryPolicy – The JSON serialization of the subscription's delivery policy.

  • EffectiveDeliveryPolicy – The JSON serialization of the effective delivery policy that takes into account the topic delivery policy and account system defaults.

  • FilterPolicy – The filter policy JSON that is assigned to the subscription. For more information, see Amazon SNS Message Filtering in the Amazon SNS Developer Guide.

  • FilterPolicyScope – This attribute lets you choose the filtering scope by using one of the following string value types:

    • MessageAttributes (default) – The filter is applied on the message attributes.

    • MessageBody – The filter is applied on the message body.

  • Owner – The Amazon Web Services account ID of the subscription's owner.

  • PendingConfirmationtrue if the subscription hasn't been confirmed. To confirm a pending subscription, call the ConfirmSubscription action with a confirmation token.

  • RawMessageDeliverytrue if raw message delivery is enabled for the subscription. Raw messages are free of JSON formatting and can be sent to HTTP/S and Amazon SQS endpoints.

  • RedrivePolicy – When specified, sends undeliverable messages to the specified Amazon SQS dead-letter queue. Messages that can't be delivered due to client errors (for example, when the subscribed endpoint is unreachable) or server errors (for example, when the service that powers the subscribed endpoint becomes unavailable) are held in the dead-letter queue for further analysis or reprocessing.

  • SubscriptionArn – The subscription's ARN.

  • TopicArn – The topic ARN that the subscription is associated with.

The following attribute applies only to Amazon Data Firehose delivery stream subscriptions:

  • SubscriptionRoleArn – The ARN of the IAM role that has the following:

    • Permission to write to the Firehose delivery stream

    • Amazon SNS listed as a trusted entity

    Specifying a valid ARN for this attribute is required for Firehose delivery stream subscriptions. For more information, see Fanout to Firehose delivery streams in the Amazon SNS Developer Guide.

Type: String to string map

Errors

For information about the errors that are common to all actions, see Common Errors.

AuthorizationError

Indicates that the user has been denied access to the requested resource.

HTTP Status Code: 403

InternalError

Indicates an internal service error.

HTTP Status Code: 500

InvalidParameter

Indicates that a request parameter does not comply with the associated constraints.

HTTP Status Code: 400

NotFound

Indicates that the requested resource does not exist.

HTTP Status Code: 404

Examples

The structure of AUTHPARAMS depends on the signature of the API request. For more information, see Examples of the complete Signature Version 4 signing process (Python) in the Amazon General Reference.

Example

This example illustrates one usage of GetSubscriptionAttributes.

Sample Request

https://sns.us-east-2.amazonaws.com/?Action=GetSubscriptionAttributes &SubscriptionArn=arn%3Aaws%3Asns%3Aus-east-2%3A123456789012%3AMy-Topic%3A80289ba6-0fd4-4079-afb4-ce8c8260f0ca &Version=2010-03-31 &AUTHPARAMS

Sample Response

<GetSubscriptionAttributesResponse xmlns="https://sns.amazonaws.com/doc/2010-03-31/"> <GetSubscriptionAttributesResult> <Attributes> <entry> <key>Owner</key> <value>123456789012</value> </entry> <entry> <key>DeliveryPolicy</key> <value>{&quot;healthyRetryPolicy&quot;:{&quot;numRetries&quot;:10}}</value> </entry> <entry> <key>SubscriptionArn</key> <value>arn:aws:sns:us-east-2:123456789012:My-Topic:80289ba6-0fd4-4079-afb4-ce8c8260f0ca</value> </entry> </Attributes> </GetSubscriptionAttributesResult> <ResponseMetadata> <RequestId>057f074c-33a7-11df-9540-99d0768312d3</RequestId> </ResponseMetadata> </GetSubscriptionAttributesResponse>

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: