I can’t seem to get the JSON POST data of the webhook. I set up everything correctly (the webhook URL, also tested if the server is getting POST requests) and the requests are coming when the user posts something, but no POST nor GET data is logged. Is this a common bug or is it just me?
Question posted in Telegram API
A comprehensive official documentation can be found here.
A comprehensive official documentation can be found here.
3
Answers
UPDATE
A self signed cert is valid now.
As they said:
It’s a post, but they didn’t mentioned any parameter for us to get it, just a JSON value, so try get the raw input.
For example in PHP I got it by using:
file_get_contents('php://input')
Also, another reason for not getting POSTs is that the certificate chain could be incorrect. No errors show on Firefox, but Chrome for Android complained.
It’s explained in this thread on Reddit: https://www.reddit.com/r/Telegram/comments/3b4z1k/bot_api_recieving_nothing_on_a_correctly/
As soon as I added the chain certificate file and restarted Apache, the requests started coming in.