list_subscriptions_by_topic

SNS.Client.list_subscriptions_by_topic(**kwargs)

Returns a list of the subscriptions to a specific topic. Each call returns a limited list of subscriptions, up to 100. If there are more subscriptions, a NextToken is also returned. Use the NextToken parameter in a new ListSubscriptionsByTopic call to get further results.

This action is throttled at 30 transactions per second (TPS).

See also: AWS API Documentation

Request Syntax

response = client.list_subscriptions_by_topic(
    TopicArn='string',
    NextToken='string'
)
Parameters
  • TopicArn (string) --

    [REQUIRED]

    The ARN of the topic for which you wish to find subscriptions.

  • NextToken (string) -- Token returned by the previous ListSubscriptionsByTopic request.
Return type

dict

Returns

Response Syntax

{
    'Subscriptions': [
        {
            'SubscriptionArn': 'string',
            'Owner': 'string',
            'Protocol': 'string',
            'Endpoint': 'string',
            'TopicArn': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Response for ListSubscriptionsByTopic action.

    • Subscriptions (list) --

      A list of subscriptions.

      • (dict) --

        A wrapper type for the attributes of an Amazon SNS subscription.

        • SubscriptionArn (string) --

          The subscription's ARN.

        • Owner (string) --

          The subscription's owner.

        • Protocol (string) --

          The subscription's protocol.

        • Endpoint (string) --

          The subscription's endpoint (format depends on the protocol).

        • TopicArn (string) --

          The ARN of the subscription's topic.

    • NextToken (string) --

      Token to pass along to the next ListSubscriptionsByTopic request. This element is returned if there are more subscriptions to retrieve.

Exceptions

  • SNS.Client.exceptions.InvalidParameterException
  • SNS.Client.exceptions.InternalErrorException
  • SNS.Client.exceptions.NotFoundException
  • SNS.Client.exceptions.AuthorizationErrorException