How to Configure User Subscription to Notifications
According to messenger policies, bots cannot send messages first. For a user to receive notifications from the bot, they must first interact with the bot and send it any initial message.
How Does Subscription Work?
- User clicks a button on the website/in app "want to receive messages in messenger"
- A link to the bot with parameters (deeplink) opens
- User clicks "Start" in the messenger
- Bot returns
chat_idandchannelback to the application through thesend_meaction - Now you can send notifications to the user via
call_nodeAPI
Creating Subscription Button
On the website/application side, create a button "want to receive messages in messenger" (or "track order status in messenger", "choose support channel", etc.).
In this button, the start parameter can contain:
customer_idof the client in your CRM/ERP- Order ID
- Other identification data
📖 Documentation: Read more about deeplink in Launch scenario via deeplink.
Returning chat_id and channel
After the first message from the user (for example, clicking the "Start" button in Telegram), the bot should return back to the application (website, CRM, etc.) a pair of parameters:
chat_id— unique chat ID within the messenger (usually an alphanumeric string)channel— channel name (telegram, viber, facebook, etc.)
In ConnectiveOne, there is a special send_me action for this.
send_me Action Configuration
In this action settings, specify:
url— address to send the request tomethod— request method (GET, POST)data— additional parameters to send, can contain placeholders, for example{{messenger_input_param}}headers— request headers
Automatic Parameters
The send_me action automatically adds to request data:
chat_id— user chat identifierchannel— communication channel (telegram, viber, facebook, etc.)
These parameters don't need to be specified in configuration — they are added automatically.
Configuration Example
{
"url": "https://your-crm.com/api/webhook/chat-registered",
"method": "POST",
"data": {
"customer_id": "{{messenger_input_param}}",
"user_name": "{{user_name}}"
},
"headers": {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
}
}
Request result:
{
"customer_id": "12345",
"user_name": "Ivan",
"chat_id": "398866372",
"channel": "telegram"
}
Possible Branching by Events
"ok"— request successfully sent"not_ok"— error during request sending
Error Handling
If the request ended with an error, the action returns "not_ok". In the scenario, you can handle this event for:
- Retry
- Sending a message to the user
- Logging the error
Sending Notifications After Subscription
After you receive chat_id and channel, you can send notifications to the user via call_node API.
📖 Documentation: Read more in Launch scenario via API call_node.
Limitations
- URL must be accessible from the ConnectiveOne server
- Only HTTP and HTTPS protocols are supported
- Request timeout depends on system settings
Important Notes
⚠️ Note: When using Facebook, Viber deeplink, the
startcommand is passed. Consider this if you use scenario branching with theget_commandaction.
If you don't need to use the user ID in the external system in the bot (for example, to identify), you can not pass any parameters, but simply send the user to the bot to do the first steps and save chat_id + channel in CRM/application.