Step 1: Create a Telegram Bot
- Open Telegram and search for “BotFather”
- Open the Telegram app on your phone or desktop.
- In the search bar, type “BotFather” and select the verified bot with a blue checkmark.
- Start a conversation with BotFather
- Click on “Start” to begin the conversation.
- Create a new bot
- Type /newbot and send the message.
- BotFather will ask for a name for your bot. Provide a name (e.g., “MyPerfexBot”).
- Next, BotFather will ask for a username for your bot. The username must end with “bot” (e.g., “my_perfex_bot”).
- Get the bot token
- After creating the bot, BotFather will provide a bot token. This token is used to authenticate your bot and connect it to your application. Copy this token.
Step 2: Find Your Telegram Chat/Group ID
For a Personal Chat ID
- Start a chat with your bot
- Search for your bot by its username in Telegram and start a conversation by sending a message.
- Get updates to find the chat ID
- Visit the following URL in your browser, replacing YOUR_BOT_TOKEN with the token you received from BotFather:
- https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates
- Look for the chat object in the response. It should contain an id field, which is your personal chat ID.
For a Group Chat ID
- Add your bot to a group
- Create a new group or use an existing group in Telegram.
- Add your bot to the group.
- Send a message to the group
- Any member of the group should send a message to the group to trigger an update.
- Get updates to find the group ID
- Visit the following URL in your browser, replacing YOUR_BOT_TOKEN with the token you received from BotFather:
- https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates
- Look for the chat object in the response. It should contain an id field, which is your group chat ID. Note that group chat IDs usually have a negative sign (e.g., -123456789).
Step 3: Configure Your Perfex CRM Module
- Enter the bot token and chat/group ID in the module settings
- Open the settings for your Perfex CRM Telegram Integration Module.
- Enter the bot token you received from BotFather in the “Telegram Bot Token” field.
- Enter the chat ID or group ID in the “Telegram Chat/Group ID” field.
- Click “Submit” to save the settings.
Now, your Perfex CRM is connected to Telegram, and you will start receiving notifications as configured.