I've already read the few questions about bot API, but can't find a solution.
My bot works fine without setting a webhook and processing /getUpdates. But I can't get it working setting "https://www.domain.com/page.php" as webhook.
I've got a shared hosting behind Cloudflare's Flexible SSL cert and browsers doesn't warn about it, so I assume it's working fine.
I'm trying to get Telegram's POST to a file to have a clue if webhook need diferent parsing, but it is empty and can't see ssl_acces.log, so I can't even watch if Telegram reach the page...
Here is the snippet:
$message = json_decode(file_get_contents('php://input'), true);
file_put_contents('telegram.txt', var_dump($message));
What am I doing wrong? Thanks.
[SOLUTION]
The way to log is:
$debug = file_get_contents('php://input');
$fp = fopen('debug.txt', 'w');
fwrite($fp, $debug);
fclose($fp);
And the solution is that the webhook must be set without wwww:
/setwebhook?url=https://domain.com/page.php
$debug = file_get_contents('php://input'); $fp = fopen('debug.txt', 'w'); fwrite($fp, $debug); fclose($fp);- edumgui$message = json_decode($_POST, true); file_put_contents('telegram.txt', $message);why don't you try that way? Telegram webhook seems to be making a POST request. - Ugur{"ok":false,"error_code":409,"description":"Error: Conflict: another webhook is active"}- edumgui