F
F
foxyrus2021-11-29 12:14:01
Java
foxyrus, 2021-11-29 12:14:01

Why telegram API function exportChatInviteLink returns 400 error?

Good afternoon! Doing on the dock https://core.telegram.org/bots/api#exportchatinvitelink
Created a bot, created a group chat, appointed the bot as the group chat admin, send a
POST request https://api.telegram.org/bot[bot_token]/exportChat ...
with chat_id=-CODCHATA parameter
and so {
"chat_id": "-CODCHAT",
"method": "exportChatInviteLink"
}
but in response I get

{
"ok": false,
"error_code": 400,
"description": "Bad Request: chat not found"
}

I tried to pass the ID of the newly created channel in chat_id (where the bot is also in the admins), the error is the same

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
foxyrus, 2021-12-06
@foxyrus

I will answer myself: you need to kill that the ID of the private group starts with "-100", if not, then add "-100"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question