Webhook is already deleted
CeelMarten opened this issue · 9 comments
When I'm sending a request to telegram server the response is always "Webhook is already deleted" for all bots.
You are most likely passing an empty url to SetWebhookAsync
@MihaZupan here is data
REQUEST URL
https://api.telegram.org/bot------MyBotToken------/setWebhook
POST BODY
{
"key": "url",
"value": "https://myaddron.ngrok.io/api/update"
}
AND RESPONSE
{
"ok": true,
"result": true,
"description": "Webhook is already deleted"
}
@MihaZupan Sorry, It was my mistake. ContentType was wrong
Hello. I have the same problem. Could u help please? What means "ContentType was wrong"?
Hello. I have the same problem. Could u help please? What means "ContentType was wrong"?
If post body is json you should send header also:
Header:
Content-Type: application/json
So, finaly:
- POST REQUEST
- POST HEADER: Content-Type: application/json
- POST BODY: {url : "https://your.url"}
Hello. I have the same problem. Could u help please? What means "ContentType was wrong"?
If post body is json you should send header also:
Header:
Content-Type: application/json
So, finaly:
- POST REQUEST
- POST HEADER: Content-Type: application/json
- POST BODY: {url : "https://your.url"}
Thanks a lot
I have the same problem, can you explain what to change in my example?
curl --location --request POST "https://api.telegram.org/bot58qqqq65:AAFZILu-qK8gbkE6NqN9Y_QqqqVNmAuMn4/setWebhook" --header "Content-Type:application/json" --data-raw "{"url":"https://59c0-178-94-31-158.eu.ngrok.io"}
I have the same problem, can you explain what to change in my example?
curl --location --request POST "https://api.telegram.org/bot58qqqq65:AAFZILu-qK8gbkE6NqN9Y_QqqqVNmAuMn4/setWebhook" --header "Content-Type:application/json" --data-raw "{"url":"https://59c0-178-94-31-158.eu.ngrok.io"}
Please do not share your bot key. Anybody can manipulate your bot with this key.
Hello, there was the same error that the webрhook has already been deleted
function setWebhook() {
let webAppUrl = "https://script.google.com/macros/s/AKfycbz_9bCq1Zi9xaTVZCBMJTnCLO7cmOcgVCBc3b_fltxamg__GH912LBTjTO87DtFijOQ9g/exec";
let response = UrlFetchApp.fetch("https://api.telegram.org/bot"+ token + "/setWebhook?url ="+ webAppUrl);
console.log(response.getContentText());
}