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?
Telegram bot API no JSON POST data on webhook
7.3k views Asked by L. Pes At
3
There are 3 answers
0
On
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.
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')