Skill level: Intermediate
Time required: 15 minutes
Prerequisite
Create a web widget inbox in Conversation Management. Set a suitable introduction heading and body text to provide context for the user, named Bot-Human agent web widget.
Click here to know how to create a web widget and open it in a web browser.
Note: Ensure you create a website widget and not a multichannel widget.
Configuring the trigger
-
In the Event section, search the Conversation Management by Quickwork app from the drop-down menu in the Apps field present right below the New Trigger button.
- Select the trigger event New text message from the drop-down menu in the Triggers field.
- Click the Link account button to connect Bot-Human agent web widget with Quickwork.
- Connect to Conversation Management by Quickwork window will pop up. Enter the API key and Inbox ID of the web widget. Click here to know how to get the API key and Inbox ID.
- Click the Link account button to make a successful connection.
- Next, specify a sample name in the Event input field. As soon as you complete specifying all the input, Quickwork returns a webhook URL.
- Copy this URL and go to the Webhook tab of the inbox whose API key and Inbox ID we connected, for example, Bot-Human agent web widget inbox. Paste the URL in the Webhook field.
- Click the Save Changes button.
- The New text message trigger is now successfully configured.
Setting conversations to the resolved state
Incoming messages from a web widget inbox are marked as open by default, allowing a human agent to manage the conversation. Once the user’s concerns are addressed, the agent updates the conversation status to resolved in the Conversation Management portal. However, for bots, a conversation must be marked as resolved to trigger an automated response.
To set the default status of new conversations to resolved, navigate to the Configuration tab, select Resolved under Default Conversation Status, and click Save.
Configuring the Get conversation by ID action
To get the status of each conversation, let us configure this action:
- In the Steps section, click on the Simple Action button and choose the Conversation Management by Quickwork app from the drop-down menu in the Apps field.
- Select the Action as Get conversation by ID from the drop-down menu.
- The connection gets established automatically as we connected previously for the trigger.
- In the Conversation Id field, drag and drop the Conversation Id data pill from the
Conversation Management by Quickwork | New text message Trigger under Data Tree Output:
Configuring the If condition for conversation status
- Click the + icon, click on Business Logic, and choose the If Condition.
- In the Left Value field, drag and drop the Status data pill from the Conversation Management by Quickwork | Get conversation by ID under Data Tree Output.
- Select Equals in the Condition field.
-
Enter resolved in the Right Value field:
Configuring Ask question action under If condition
- Click the indented action bar of the If Condition. Select Conversation Management by Quickwork in the App drop-down menu.
- Select Ask question from the Action drop-down menu.
- Enter the question or a text in the Question field. For example, Please select any one of the following options:
- Select Quick Replies in the Answer type field.
- In the Conversation ID field, drag and drop the Conversation Id data pill from the
Conversation Management by Quickwork | New text message Trigger under Data Tree Output. - Specify a help text in the Retry help field. For example, The specified input is invalid.
- Now let's configure two quick replies in this action. Scroll down to the Elements section. Select Type as Postback in the Item 1 block. Give the Title as Get Balance.
- Click the +Add New Item button to configure the second quick reply. Select Type as Postback in the Item 2 block and give the Title as Talk To Human.
Using If Else condition to validate quick replies
- Click the Business Logic option and select If Else Condition. Now, indent the If Else Condition below the Ask question action.
- In the Left Value field, drag and drop the Quick Reply Title data pill from the
Conversation Management by Quickwork | Ask question under Data Tree Output. - Select Equals in the Condition field.
-
Enter Get Balance in the Right Value field.
- Click the indented action bar of the If Condition. Select Conversation Management by Quickwork in the App drop-down menu.
- Select Send text message from the Action drop-down menu.
- Enter a text in the Message field. For example, Your account balance is 14 INR. This is an automated response. Get the options again by typing "Hi".
- In the Conversation ID field, drag and drop the Conversation Id data pill from the
Conversation Management by Quickwork | New text message Trigger under Data Tree Output. - Now, click the indented action bar of the Else Condition. Select Conversation Management by Quickwork in the App drop-down menu.
- Select Open conversation from the Action drop-down menu.
- In the Conversation ID field, drag and drop the Conversation Id data pill from the
Conversation Management by Quickwork | New text message Trigger under Data Tree Output. - Clone the above action and change it to Send text message from the Action drop-down menu.
-
Enter a text in the Message field. For example, You are now connected with Human Agent Service. Send your queries here so that an agent can respond to it accordingly.
Enter "Return to BOT" to switch to the automated service.
- In the Conversation ID field, drag and drop the Conversation Id data pill from the
Conversation Management by Quickwork | New text message Trigger under Data Tree Output.
Configuring If condition to switch to BOT
- Click the + icon, click on Business Logic and choose the If Condition.
- In the Left Value field, drag and drop the Message data pill from the Conversation Management by Quickwork | Send text message Trigger under Data Tree Output.
- Select Equals in the Condition field.
- Enter Return to BOT in the Right Value field.
- Now, click the indented action bar of the If Condition. Select Conversation Management by Quickwork in the App drop-down menu.
- Select Resolve conversation from the Action drop-down menu.
- In the Conversation ID field, drag and drop the Conversation Id data pill from the
Conversation Management by Quickwork | New text message Trigger under Data Tree Output.
- Clone the above action and change it to Send text message from the Action drop-down menu.
- Enter a text in the Message field. For example, The conversation is handovered to a bot. Send "Hi" to get the options again.
- In the Conversation ID field, drag and drop the Conversation Id data pill from the
Conversation Management by Quickwork | New text message Trigger under Data Tree Output.
Using Stop journey business logic
Click the + icon, click on the Business Logic and choose Stop Journey and indent below the action located at Step 11, i.e., Send text message action as shown:
The journey configuration is complete now. Click the Save Changes button and start the journey:
Executing the journey
1. Open the Bot-Human agent web widget in a web browser and send Hi.
2. Observe the automated response and test switching to a human agent by selecting the appropriate option.
3. Test returning to bot assistance by typing Return to BOT.
Comments
0 comments
Please sign in to leave a comment.