Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can i use localhost as a URL Callback in a messenger webhook

Good evening, just saw that Facebook released his messenger bot toolkit and i immediately jumped right into it to learn more about it and maybe try to do my own.

My problem is that i don't have a https website running and it requires a https valid url. I tried to use my local web-server that has a certificate but it doesn't work.

My question is if this is possible to be done using a localhost url at all.

Thank you in advance

like image 735
Query Avatar asked Apr 12 '16 20:04

Query


2 Answers

Actually this is possible with localhost. Use ngrok. It allows you to open localhost to the public web, over http or https. This should only be used for testing however.

like image 145
dankram Avatar answered Nov 16 '22 18:11

dankram


If you want to test webhooks on your local environment, I would try ultrahook.com, you can get an API Key for free and the tool creates a tunnel from a public URL to your computer. This is from their FAQs page:

You download and run the UltraHook client on your computer. It connects to UltraHook servers in the cloud and creates a tunnel from a public endpoint on our servers to your computer. Any HTTP POST requests sent to the public end point will be sent through the tunnel an delivered to a private endpoint accessible from your computer.

I have used it to test webhooks from different providers (like payment gateways). In your computer, you can run something like:

ultrahook <subdomain> http://localhost:8000/webhook/

and then configure the webhook URL in your external service to something like <subdomain>.ultrahook.com

like image 3
julianm Avatar answered Nov 16 '22 19:11

julianm