How to Launch a Bot with an A360 Event

You can send a message to a user in a messenger with confirmation of their reservation or order: order number, quantity of products, name of each product, etc.

Create an event, launch it on your website by sending data to the desired URL, transmit a message, and develop a chatbot script for closing the deal.

If you are already using the SendPulse event system, now you can launch an event not only for email flows, but also bot flows.

The information in this article describes how to launch a chatbot flow by event using the “A360 Event” trigger in the chatbots section. To send a message, you need a subscriber ID (the ways to get an ID are described below).
To launch a chatbot by email or phone number of a subscriber using an A360 flow, read the article "Messenger" element in Automation 360.

Step 1. Create an Event

Navigate to the Email section > Automation tab > Event Manager tab, and click Add New Event.

You can add fields for transmission when creating an event or indicate it when sending an event. Add fields for your order: for example, order number, product name, quantity, and so on.

To trigger a chatbot, you need to pass the chatbots_channel and chatbots_subscriber_id variables. You can indicate them when creating an event, or you can add them to the request body when you send a request.

chatbots_channel - indicates the communication channel:

  • tg — for Telegram;
  • fb — for Facebook;
  • vk — for VKontakte;
  • wa — for WhatsApp;
  • ig — for Instagram.

chatbots_subscriber_id - indicates the user ID.

Ways to get a user’s id:
  • webhook, contact id parameter;

  • following the link by user where you added the parameter {{contact_id}}

  • API method for finding a contact by tag or variable;

  • copying the parameter from the address bar in the chat window with the desired contact in the personal account

After adding all the required fields, click Add.

Copy the request URL and JSON data transfer format.

You will need to set up data transmission to the specified URL at the right time from your site: for example, after clicking on the "Order", "Confirm event" button, or after the user has left the site, leaving the order unfinished.

Step 2. Create a Trigger

Now you need to create a trigger that launches when an event is received.

Navigate to the Chatbots section, select a bot and click Create a new trigger. In the trigger type setting, mark A360 Event and select the created event that will be your trigger.

Step 3. Connect the Flow

Now you can connect the chatbot scenario. After creating a trigger, click Create flow to create a new one or Link an existing one.

You can bind any flow that is not connected to a trigger. All unbound threads are stored under the Saved Chains button.

Step 4. Create a Message

The variables that you receive through the event can be used in your message as a JSON path of the structure expression.

In the first start message, write the variables in the form {{$['somekey']}}, where you insert the name of your variable in place of somekey.

Note that data that you are not writing can only be used once in the next text block.

You can also add a button to the start block that will continue your scenario through the flow.

You can extend the scenario by adding the additional elements to it.

For example, you can add a button like "Leave a question," "Contact a manager," or details about the methods of payment and conditions for receiving products from your brand. Either ask the user for more data that you are missing, request the order status from CRM or send confirmation data to CRM, filter the received value, and build a flow scenario in accordance with the result.

Step 5. Send the Event

You can test receiving a message with data through the program. With the help of such programs, you can send data only in demo mode - it will not work for sending real data from your site. For real cases, the backend of the site is used with the operation of the site database in various programming languages and the sending of such requests is configured by the programmer.

For the tests, we will use Postman.

Add a link to the created event in the URL field. Select the request method POST.

Insert the transmitted parameters in the JSON format into the request body.

To send a request, click Send.

If your request was successful, you will receive a True response, and the subscriber will receive a message in the messenger you specified with the sent data.

You can check all received events in the event log.

You can see who the message was sent to and other statistics by clicking on the starting element.

Rate this article about "How to Launch a Bot with an A360 Event"

User Rating: 4 / 5 (12)

    Other useful articles

    Popular in Our Blog

    Try a free chatbot for Facebook Messenger