Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

629
Views
Node.JS Telegram bot gets '403 Forbidden' error on webhook

For study purposes I'm trying to create a Telegram bot on pure Node.JS, without any additional NPM's. I host it on glitch.com. Here's a very basic code sample:

require('https').createServer((req, res) => {
  if(req.method == 'POST' && req.url == process.env.SECRET_PATH){
    console.log('The webhook was accessed.');
  }
  
  res.writeHead(200);
  res.end('OK');
  
}).listen(8443);

I tried listening on different ports (3000, 5000, 8000, 8080, 8443, 80, 88, 443) or several of them simultaneously, used different server modules (http, https), and even tried generating a self-signed certificate. Nothing works.

The request to https://api.telegram.org/bot<TOKEN>/getWebHookInfo returns this:

{
  ok: true,
  result: {
    url: '<WEBHOOK_URL>',
    has_custom_certificate: false,
    pending_update_count: 4,
    last_error_date: 1651148554,
    last_error_message: 'Wrong response from the webhook: 403 Forbidden',
    max_connections: 40,
    ip_address: '18.205.205.44'
  }
}

The last_error_message property is always 'Wrong response from the webhook: 403 Forbidden'. What am I doing wrong?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!