Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Telegram bot API no JSON POST data on webhook

Tags:

telegram-bot

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?

like image 541
L. Pes Avatar asked Jun 25 '15 21:06

L. Pes


1 Answers

As they said:

we will send an HTTPS POST request to the specified url, containing a JSON-serialized

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')

like image 93
Emad Ghasemi Avatar answered Sep 22 '22 18:09

Emad Ghasemi