Case 1. Data Usage

Before you begin

This tutorial requires a webhook setup. Add a test webhook URL to your webhook settings.

Add a Subject

  1. Click Add Subject on the Scope details page.

  2. Select the Info Search tab.

  3. Enter a Subject name.

  4. Enter Query Statement which is the expected customer query as "How much data have I used on my account?"

  5. Click Recognize Statement to get the Recognition Result. The Recommended Statement is the statement which is semantically related to more ontologies and can generally capture more statement structures with the same intent. To use the recommended statement, just tick the checkbox saying Use Recommended Statement.

6. Additional Query Statement to Recognize may also be added but not required. This is used in case of multiple intents being expected to trigger this subject.

7. Click Add.

Build the Subject

  1. Click Add Component in the Components panel.

  2. Click Parameter Bundle.

3. In the popup, enter a Parameter Bundle name as "Check Month" and a Parameter name as "Month". Set it as required.

4. Click Add.

5. In the Component Settings panel, stay with the Single Value tab.

6. Enter the local binding key as "month".

7. Click Set up Entity Type.

8. In the popup, select the System Entities tab.

9. Select Datetime Entity.

10. Click Submit.

11. Click Save.

12. Click Add Action in the Conversation panel.

13. Under Check for Parameter, click Check.

14. Stay with the Customer tab.

15. Enter the prompt as "For which month?"

16. Click Save.

17. Click Add Action in the Conversation panel.

18. Under Completion of Parameter, click Show response.

19. Select the Webhook tab.

20. Choose a webhook URL http://mock-webhook.mind.aito use from the dropdown and enter URL Parameter (domain path and/or query string) as tutorial/data-usage?code=200

Webhook URL (Method: POST)

**BASE URL **``

**URL PARAMETER **` tutorial/data-usage?code=200`

Response Body

 "month": "July",
 "data-usage": "Your data plan is LTE+ (10G)\nYou have been using 4.3G.\nIf you want to change your mobile package, you can ask \"I want to change my mobile package\""

21. Select the request method as POST. For the POST request, you can enter the Request Body if needed. Enter the Request Body.

Request Body

 "month": "{{month}}"

22. **** Select an error message display method as Template and select an action as Terminate to take in case of HTTP 400. If Passthrough is selected, the webhook response will be displayed without modification.

23. Enter an error message that will be displayed to the customer.

Sorry, I am terminating the session.

24. Keep the Mapping toggle on.

25. Enter Key and JSONPath pairings for Result Mapping.

Result Mapping Pair 1

KEY month

JSONPATH $.month

Result Mapping Pair 2

KEY data_usage

JSONPATH $.data-usage

26. Enter the template to show to the customer as a response.

Data usage for {{month}}
- {{{data_usage}}}

27. Click Save.

28. Click Publish to publish the Subject.

29. To test the subject, click on the sandbox button on the right side of the screen and enter the query statement configured, in this case, How much data have I used?.

Last updated