Set up the chat
Create a bot through BotFather, start a chat with it or invite it to your group, then obtain the destination chat ID from a bot update. Keep the bot token in a server environment variable or an automation platform’s credential store.
Call sendMessage from your workflow
After accepting and validating a submission, make a server-side request with a short notification and the configured chat ID.
JAVASCRIPT
const endpoint = "https://api.telegram.org/bot" + process.env.TELEGRAM_TOKEN + "/sendMessage";
const response = await fetch(endpoint, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
chat_id: process.env.TELEGRAM_CHAT_ID,
text: "A new contact request is waiting in Forms4Web.",
}),
});
if (!response.ok) throw new Error("Telegram delivery failed");Check access
Use a private group if alerts include personal information. Test with a harmless submission, inspect non-success API responses, and follow the retry interval in a rate-limit reply.