{"action":"opened","issue":{"url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/688","labels_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/688/labels{/name}","comments_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/688/comments","events_url":"https://api.github.com/repos/aws/aws-sdk-ruby/issues/688/events","html_url":"https://github.com/aws/aws-sdk-ruby/issues/688","id":55107874,"number":688,"title":"[Question] After creating and subscribing to a topic, can I confirm the subscription?","user":{"login":"dandunckelman","id":1153702,"avatar_url":"https://avatars.githubusercontent.com/u/1153702?v=3","gravatar_id":"","url":"https://api.github.com/users/dandunckelman","html_url":"https://github.com/dandunckelman","followers_url":"https://api.github.com/users/dandunckelman/followers","following_url":"https://api.github.com/users/dandunckelman/following{/other_user}","gists_url":"https://api.github.com/users/dandunckelman/gists{/gist_id}","starred_url":"https://api.github.com/users/dandunckelman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dandunckelman/subscriptions","organizations_url":"https://api.github.com/users/dandunckelman/orgs","repos_url":"https://api.github.com/users/dandunckelman/repos","events_url":"https://api.github.com/users/dandunckelman/events{/privacy}","received_events_url":"https://api.github.com/users/dandunckelman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-22T02:45:15Z","updated_at":"2015-01-22T02:45:15Z","closed_at":null,"body":"I can't seem to find out where to get the \"token\" needed for the `#confirm_subscription` command.\r\n\r\nHere's what I have:\r\n\r\n    class Notification                                                          \r\n      def initialize(config)                                                    \r\n        @config = config                                                        \r\n        @client = AWS::SNS::Client.new                                          \r\n      end                                                                       \r\n                                                                                \r\n      def create_and_subscribe                                                  \r\n        topic = create                                                          \r\n        subscription = subscribe(topic)                                         \r\n        binding.pry                                                             \r\n        exit                                                                    \r\n        confirm_subscription(subscription, topic)                               \r\n      end                                                                       \r\n                                                                                \r\n      private                                                                   \r\n                                                                                \r\n      def create                                                                \r\n        @client.create_topic({ :name => @config['topic']['topic_name'] })          \r\n      end                                                                       \r\n                                                                                \r\n      def subscribe(topic)                                                      \r\n        @client.subscribe({                                                     \r\n          :topic_arn  => topic.data[:topic_arn],                                \r\n          :protocol   => @config['subscription']['protocol'],                   \r\n          :endpoint   => @config['subscription']['endpoint']                    \r\n        })                                                                      \r\n      end                                                                       \r\n                                                                                \r\n      def confirm_subscription(subscription, topic)                             \r\n        @client.confirm_subscription({                                          \r\n          :topic_arn                    => topic.data[:topic_arn],              \r\n          :token                        => \"\", # TODO how do I get the token that's sent through the subscribe command?\r\n          :authenticate_on_unsubscribe  => \"false\"                              \r\n        })                                                                      \r\n      end                                                                       \r\n    end\r\n\r\nI was assuming the response for `subscribe` would include that token.  What am I missing?\r\n\r\nThanks for the help."}}