Facebook Reaction Trigger
This guide explains how to set up and use the Facebook Reaction Trigger in UChat, based on the step-by-step process below:
Step 1: Create a New Trigger
Inside your bot, navigate to the Triggers section in UChat:
Go to the Automations on the left sidebar.
Select Triggers from the available options.
Click on the New Trigger button located in the top-right corner of the interface.
From the list of trigger options, select Facebook Reaction.
Step 2: Configure the Facebook Reaction Trigger
In the Trigger Configuration window:
Enter a descriptive name for your trigger (e.g., Facebook Reaction Trigger).
Under the option Save content to a user field, select or create a new Custom User Field where the reaction data will be stored.
To create a new user field:
Click the + Create New Field button.
Assign a name to the field (e.g., Facebook Reaction Payload).
Select JSON as the field type.
Save the new field.
Optionally, you can add tags or notes to this trigger for better organization.
Ensure that the Trigger Activation Toggle is switched to Activated (green).
Click the Save button to finalize the configuration.
Step 3: Link or Create a Flow to Handle Reactions
After configuring the Facebook Reaction Trigger, you can:
Select an existing flow: If you already have a flow set up to handle Facebook reactions, simply connect it to the trigger.
Create a new flow: If you don’t have a flow yet, you can create one specifically to process the reactions.
The flow could be designed to capture and process the reaction data stored in the custom user field. This can include:
Identifying the type of reaction.
Responding to the user with a personalized message.
Logging the reaction for analytics or reporting.
Step 4: Understand the Payload Integration in Message Nodes
When creating your flow, you can utilize the Custom User Field containing the reaction payload. The provided screenshots demonstrate:
Where the Custom User Field (e.g., Facebook Reaction Payload) will be located in a Node.
How the reaction data in JSON format can be accessed and integrated into your message content.
This allows you to dynamically reference the reaction data and use it within the flow.
Step 5: View the Payload in Action
The screenshots also show an example of the reaction being triggered in a live chat conversation:
You’ll see the reaction stored in the Custom User Field with a clear payload structure, including:
The message ID of the reacted message.
The reaction itself (e.g., 👍 or ❤️).
This example helps you understand the format of the data and how it can be used to identify and process the reaction in your flow.
Step 6: Create a Custom Flow for Reactions
With this understanding, you can now build or modify your flow to:
Identify the type of reaction.
Trigger specific responses or actions based on the reaction type.
Handle user engagement in a way that aligns with your business needs.
The flexibility of the Flow Builder in UChat ensures that you can design a process tailored to your requirements.
By following these steps, you can effectively utilize the Facebook Reaction Trigger to capture, understand, and respond to user reactions, creating a personalized and engaging experience.
Additional Guide: Getting Message Content Using the Bot User API Node
Step 1: Add a Bot User API Node to Your Flow
Open the Flow Builder in UChat.
Drag and drop the Action Node into your flow and go to Advanced Actions.
In Advanced Actions you can select Bot User API.
Step 2: Configure the Bot User API Node
Action Type: Select Get Chat Messages.
Fill in the required fields:
Bot User Ns (Test Only): Enter the test User Ns (e.g.,
f79795u1718...
).Message Id: Enter the test Message Id (e.g.,
wamid.HBgMTN...
). Later, you can replace this static value with a Custom Field that contains the dynamic Message ID.
Step 3: Process the API Response
Test the Request:
Click Test Request to retrieve the JSON response containing the message data. The system will return the message content in a JSON format.
Mapping the Data:
In the Sample Data section, locate the desired value from the JSON response. For example:
Use the JSON Path to access the specific field and save the message text in a custom field.
Save the Result in a Custom Field:
In the Map Response to Custom Field field, select or create a Custom Field to store the result (e.g.,
Message_content
).Enter the JSON Path and click Add to confirm.
Optionally, you can define a Fallback Value in case the JSON does not return the expected data.
Replace the Message Id with a Dynamic Variable:
After testing and successfully mapping the JSON, replace the static Message Id field with a Custom Field that dynamically stores the Message ID.
Example:
{{Message_ID}}
.
Save Your Configuration:
Click Save to finalize the setup.
Outcome:
With this configuration, the message text will be saved in the defined Custom Field, allowing you to use this data in other nodes or messages within the flow.
If you encounter issues, please submit a ticket to ticket@uchat.com.a