Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Confirm SNS subscription on HTTP

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?

like image 618
luffy Avatar asked Oct 10 '12 12:10

luffy


1 Answers

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

like image 192
John Avatar answered Oct 04 '22 15:10

John