Menu
Amazon Simple Notification Service
API Reference (API Version 2010-03-31)

SetTopicAttributes

Allows a topic owner to set an attribute of the topic to a new value.

Request Parameters

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

AttributeName

The name of the attribute you want to set. Only a subset of the topic's attributes are mutable.

Valid values: Policy | DisplayName | DeliveryPolicy

Type: String

Required: Yes

AttributeValue

The new value for the attribute.

Type: String

Required: No

TopicArn

The ARN of the topic to modify.

Type: String

Required: Yes

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

Example

Example

Sample Request

Copy
The following example sets the DisplayName attribute to MyTopicName http://sns.us-east-1.amazonaws.com/ ?AttributeValue=MyTopicName &TopicArn=arn%3Aaws%3Asns%3Aus-east-1%3A123456789012%3AMy-Topic &AttributeName=DisplayName &Action=SetTopicAttributes &SignatureVersion=2 &SignatureMethod=HmacSHA256 &Timestamp=2010-03-31T12%3A00%3A00.000Z &AWSAccessKeyId=(AWS Access Key Id) &Signature=mQA3nJI%2BcmAIY7r8HCArGElSqPX5JG4UGzF4yo0RygE%3D The following example sets the delivery policy to 5 total retries http://sns.us-east-1.amazonaws.com/ ?AttributeValue={"http":{"defaultHealthyRetryPolicy":{"numRetries":5}}} &TopicArn=arn%3Aaws%3Asns%3Aus-east-1%3A123456789012%3AMy-Topic &AttributeName=DeliveryPolicy &Action=SetTopicAttributes &SignatureVersion=2 &SignatureMethod=HmacSHA256 &Timestamp=2010-03-31T12%3A00%3A00.000Z &AWSAccessKeyId=(AWS Access Key Id) &Signature=mQA3nJI%2BcmAIY7r8HCArGElSqPX5JG4UGzF4yo0RygE%3D The JSON format for the DeliveryPolicy AttributeValue (linebreaks added for readability): { "http": { "defaultHealthyRetryPolicy": { "minDelayTarget": <int>, "maxDelayTarget": <int>, "numRetries": <int>, "numMaxDelayRetries": <int>, "backoffFunction": "<linear|arithmetic|geometric|exponential>" }, "disableSubscriptionOverrides": <boolean>, "defaultThrottlePolicy": { "maxReceivesPerSecond": <int> } }

Sample Response

Copy
<SetTopicAttributesResponse xmlns="http://sns.amazonaws.com/doc/2010-03-31/"> <ResponseMetadata> <RequestId>a8763b99-33a7-11df-a9b7-05d48da6f042</RequestId> </ResponseMetadata> </SetTopicAttributesResponse>

See Also

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