Leeloo.ai API section on the Leeloo.ai platform allows automating the transfer of data on standard events occurring on the platform to an external server. This is useful for integration with CRM systems and other tools that process information about orders, sales, subscriptions, and chat messages.
Using and configuring webhooks
To configure webhooks, follow these steps:
Go to Settings → Leeloo API on your platform's control panel.
In the window that opens, check the Webhook enabled checkbox.
3. In the Webhook URL field, enter the URL of your webhook server that will receive requests from the platform.
You can test and take a Webhook URL using online services such as https://webhook.site
4. Choose which events should be transmitted to your server:
Order (a person clicked the "Buy" button, entered data, and confirmed the order).
Sale (the fact of sale: confirmation of manual payment or successful payment through the payment system).
Subscription (if the user subscribed to an LGT in the sales tunnel).
Incoming Message (a lead sent a message to your bot integrated with the Leeloo platform).
Below you can find examples of events transmitted through Webhook. When one of the listed events occurs, a request with JSON data is sent to your server.
Examples of JSON responses for each type of event:
Order (ORDER):
{ "type": "ORDER", "data": { "order_id": "5eabfdfb4eee28000e33dac7", "account_id": "5e9eed3c8b2dc7000faff207", "offer_name": "1111", "price": 10770, "currency": "RUB", "email": "test@gmai.com", "phone": "+380952938955", "created_at": "2020-05-01T10:47:06.474Z" } }
Sale (SALE):
{ "type": "SALE", "data": { "order_id": "5eabfeadaf2213000cc5ee1e", "account_id": "5e9eed3c8b2dc7000faff207", "offer_name": "1111", "price": 10770, "currency": "RUB", "payment_method": "5d08cd71bcc043000c4bc5fc", "email": "test@gmai.com", "phone": "+380952938955", "created_at": "2020-05-01T10:49:17.260Z" } }
Subscription (SUBSCRIBE):
{ "type": "SUBSCRIBE", "data": { "account_id": "5f46a0ce5fa0ee000e697436", "tunnel_name": "первый туннель", "leadgentool_name": "подписка1", "email": "tesst@gmail.com", "phone": "+380952938955", "created_at": "2020-09-04T10:09:44.394Z" } }
Incoming Message (INCOME_MESSAGE):
{ "type": "INCOME_MESSAGE", "data": { "text": "подписка", "account_id": "5dd691740f69bb000d45dbcb", "email": "test@gmail.com", "phone": "+380664445432", "created_at": "2020-07-13T12:01:44.333Z" } }
Phone, email, account_name, and other custom fields are taken from the customer card on the Leeloo.AI platform.
Synchronization Settings
After activating the webhooks on the settings page, you can update the data synchronization time to keep the information on your server up to date.
To do this, click the Update Synchronization Time button.
Webhooks are sent from the platform to the server every 15 minutes.
This button will send the webhooks that have "accumulated" within the 15-minute window and restart the timer.
Webhooks on the Leeloo.ai platform provide flexible integration opportunities with other systems. Proper configuration of these requests allows you to receive timely, up-to-date data about user actions on the platform.