API True or False Node
This node allows you to mainly perform two kinds of actions.
- Store data on a remote server
- Make an evaluation based on data collected at EasySocial for true/false response
You can pass data from the chatbot to the API True or False Node via an API.
The API URL must be as follows:
https://api.mywebsite.com/validate_user/?name=[name]&mobile_no=[mobile_no]&other=1234
As you can see, in the URL the variable values are provided in square brackets, these values are dynamic values obtained from the customer in run time during the course of the chat via lead data fields. To learn more about lead data fields, you can watch this video.
The API can store or process the data and must give the following response:
Sample Response:
{
"data": {
"success": true //false
}
}
Explanation:
Based on the response received in the success parameter of the API response you can navigate your conversation to different branches.
The API can also contain custom lead data fields in the response, this information will be saved to the enquiry in EasySocial, and later this information can be used within the conversation for more advanced scenarios.
{
"data": {
"success": true,
"lead_attributes": {
"request_id": "34043222",
"past_customer": "True",
"wallet_balance": "$32.33"
}
}
}
Use Case1: Evaluate if the user in chatbot conversation is a customer or not
You can pass the phone number of the user to the API and the phone number can be evaluated with the registered user data, if the user is a registered customer this should give a true response. If the user is not registered, it should yield a false response. In case of a true response you can take the user to a list menu which can allow him to access his account, make changes to his profile its. However in case of a false response, you can take the user to a sign up form.
Use Case 2: Storing customer data
Lets say a customer wants to book a movie ticket, in the previous steps he has selected the movies he wants to watch, the cinema, and the timing of the movie. Now you want to pass this data to your server and create a new reservation. In this case when the data is saved to your server you can provide a true response, if there an error, lets say a validation error you might want to give a false response. Based on the response you can show a congratulations / confirmation message or a failure message to the user.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.