Blog

How to connect a Telegram bot to Zoho CRM and get notifications directly

Why do you need notifications in Telegram from Zoho?

In business operations, there is often a need to promptly notify employees about events in CRM or other Zoho applications:
  • a new lead arrived,
  • a deal was closed,
  • a payment was received,
  • a task was completed.

Usually, third-party services (Zapier, Make, Integromat, etc.) are used for such integrations, but they have their disadvantages:

  • paid tariffs when volume increases,
  • dependency on external platforms,
  • limited flexibility of customization.

In fact, everything can be implemented directly using Zoho tools - with the help of a Deluge script.

Solution: Sending messages to Telegram via Deluge

Zoho CRM (and other Zoho services) allow you to make HTTP requests. This means you can directly access the Telegram API and send a message to the bot.

Below is an example Deluge function:
string telegram_message(string text, string chat_id, string button_text, string button_url)
{
    param = Map();
    param.put("chat_id", chat_id);
    param.put("text", text);
    
    reply_markup = "{\"inline_keyboard\":[[{\"text\":\"" + button_text + "\",\"url\":\"" + button_url + "\"}]]}";
    param.put("reply_markup", reply_markup);
    
    response = invokeurl
    [
        url :"https://api.telegram.org/bot********************************/sendMessage"
        type :POST
        parameters:param
    ];
    
    return response;
}
How the script works

1) The function takes parameters
  • text — notification text,
  • chat_id — chat or user ID (you can get it by messaging the bot and checking the API response),
  • button_text — button caption,
  • button_url — the link the button opens.

2) Builds JSON with an inline button
You can attach a button to the message: for example, “Open deal in Zoho CRM” or “Go to task.”
3) A request to the Telegram API is in progress
Sends a POST request to the sendMessage method via invokeurl.
4) The response is returned
The response variable contains the result (success or error).

Example of use in Zoho CRM

Let's say we want the manager to receive a notification in Telegram when a new deal is created:
string telegram_message(string DealID)
{
	text = "New deal has been created";
	chat_id = "Your ID";
	button_url = "https://crm.zoho.com/crm/org861106275/tab/Potentials/" + id;
	button_text = "Open";
	//
    param = Map();
    param.put("chat_id", chat_id);
    param.put("text", text);
    
    reply_markup = "{\"inline_keyboard\":[[{\"text\":\"" + button_text + "\",\"url\":\"" + button_url + "\"}]]}";
    param.put("reply_markup", reply_markup);
    
    response = invokeurl
    [
        url :"https://api.telegram.org/bot********************************/sendMessage"
        type :POST
        parameters:param
    ];
    
    return response;
}

Result:

A Telegram message will arrive:

“A new deal has been created: <deal name>”

with a button Open deal that goes straight to the record in Zoho CRM.

Benefits of the solution

  • No third-party services — everything runs inside Zoho.
  • Instant notifications — staff are alerted right away.
  • Flexibility — send from any module (Leads, Deals, Tasks, Projects, etc.).
  • Buttons & links — quick jump to the exact CRM record.
  • Cost savings — no integrator fees.

Pitfalls

  • You need to create your own Telegram bot via BotFather in advance and get an API token.
  • Each user must have their own chat_id, it can be stored in a separate CRM field.
  • Telegram limits the number of requests (about 30 messages per second), but for CRM scenarios this is more than enough.

Conclusion

With a few lines of code, you can set up quick and easy notifications in Telegram directly from Zoho CRM. This solution is perfect if:

  • you want to instantly notify employees about events,
  • don't want to depend on third-party services,
  • are looking for a simple and free way to integrate Zoho and Telegram.