Finally Facebook launched API for their messenger API for their messenger. This will allow us to create chat bots.
In getting started guide, I need to setup webhook. This requires webserver which resides in specific domain and must use SSL connection.
I have VPS which has static IP. I made self signed certificate and created simple Node JS web server which uses this certificate. First of all I need to verify token for webhook:
app.get('/webhook/', function (req, res) {
if (req.query['hub.verify_token'] === '<validation_token>') {
res.send(req.query['hub.challenge']);
}
res.send('Error, wrong validation token');
})
Then I launched this server application and In my facebook app dashboard I click to Verify and Save button.
It throws me this error message:
This means that Facebook does not want to accept my self signed certificate.
This brings a several questions:
Do I need to use SSL certificates only provided by Certificate Authorities in order to work with facebook messenger?
Working with Facebook messenger is far more difficult than Telegram.
The Messenger Profile API allows you to set, update, retrieve, and delete properties from the Page Messenger Profile.
You can use cloudflare to get https instead of self-sign. Or you can use https://letsencrypt.org
For just test you can use localtunnel. https://localtunnel.me/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With