Confirm SNS subscription on HTTP

luffy picture luffy · Oct 10, 2012 · Viewed 8.2k times · Source

I created an Amazon SNS Topic and added 2 subscriptions.

  1. My email id which works fine after confirmation.
  2. HTTP URL of an amazon ec2 instance.

The problem now is I cannot understand how to confirm the subscription for the HTTP URL. I cannot see the post request on the apache access.log. Do I have to look somewhere else for the message.

I already have a rails project deployed via passenger on the server. Should I check for the post request via rails code?

Answer

John picture John · Oct 23, 2012

Same issue, in fact it is RAW POST, you can read it with :

$post = file_get_contents('php://input');

put it in your destination url, and if you want for example send it on your e-mail to see it.

After that you can confirm : http://docs.amazonwebservices.com/sns/latest/api/API_ConfirmSubscription.html

Source : https://forums.aws.amazon.com/message.jspa?messageID=364666#364666

EDIT : actually this is in JSON and there is an variable "SubscribeURL", copy paste in navigator and it validate the subscription !

Edit 2 : Sorry for php, it seems in rails it is on :

request.raw_post

request.raw_post trying to pull data from it