XState-Chatbot Integration Document
The XState-Chatbot is a revamped version of the chatbot, which provides functionality to the user to access PGR module services like filing complaints, tracking complaints and notifications from WhatsApp. It allows the user to view receipts and pay bills for Property, Trade Licence, Fire NOC, Water and Sewerage and BPA service module.
- File PGR complaint
- Track PGR complaint
- Support images when filing complaints
- Notifications to citizens when an employee performs any action on the complaint
- Allow users to search and pay bills of different modules.
- Allow users to search and view receipts of different modules.
- Allow users to change the language of their choice to have a better experience.
- Put user interactions on an elastic search for telemetry.
The XState chatbot can be integrated with any other module to improve the ease of searching and viewing bills/past payment receipts and to improve speed and convenience for bill payments. It can be integrated with the PGR module for easiness of creation and tracking of the complaint.
- Increase in convenience and ease of making the bill payment.
- Increase in no. of users opting for online payment.
- Improvement in demand collection efficiency
- Creating an additional channel for payment.
- Remove dependency on mobile/web apps or counter.
Integration of New Whatsapp Provider
Whatsapp provider is a third-party service that acts as an intermediary between the user WhatsApp client and the XState-Chatbot server. All messages coming/going to/from the user pass through the WhatsApp provider. The chatbot calls the WhatsApp provider to send messages to the user. When a user responds to any WhatsApp message the WhatsApp provider calls the Chatbot service configured endpoint with details like messages sent by the user, the sender number etc.
If any new WhatsApp provider is to be used with a chatbot, code must be written to convert the provider’s incoming messages to the format that the chatbot understands. The final output from the chatbot is also converted to the WhatsApp provider’s API request format.
Currently, the XState-Chatbot service is using ValueFirst as the WhatsApp Provider. This will require provider-specific environment variables to be configured. If the provider changes then, all these environment variables will also change. A few of those environment variables are stored as secrets, so these values need to be configured in env-secrets.yaml.
As this is a revamped version of the chatbot service, all of the secrets should already be present. There is no need to create new secrets.
Configuration of PGR version in chatbot
To configure PGR v2 in XState chatbot then pgrVersion should be ‘v2' and pgrUpdateTopic should be 'update-pgr-request’.
Adding Information Images in PGR Complaint Creation and Open Search Information Image
To configure the filestoreid for an informational image follow the steps mentioned below
- 1.Download the images from the section Information Images for PGR and Open Search
a) if supportedLocales: process.env.SUPPORTED_LOCALES || 'en_IN,hi_IN' then valuefirst-notification-resolved-templateid: "12345,6789"
b) if supportedLocales: process.env.SUPPORTED_LOCALES || 'hi_IN,en_IN' then valuefirst-notification-resolved-templateid: "6789,12345"
(Note: Both lists should not be empty - they must contain at least one element)
Template messages with buttons are maintained in the same way as described in the previous section (Configuration of push notification template messages)
There are two types of button message
- Quick Reply
- Call To Action
The Value First document below provides more details.
Value First Whatsapp User Guide
The integration of the Bill payment and receipt search feature with the chatbot is enabled and disabled by making changes in this file. The payment and receipt search feature can be enabled and vice versa by exporting the respective bill service and receipt service file.
Configuration of module for Bill payment and Receipt search
For example: If the application modules are defined in the variable -
bill-supported-modules: "WS, PT, TL" -the defined modules appear in the bill payment and receipt search. In the given example, the modules Water and Sewerage, Property Tax, and Trade License appear for bill payment and receipt search.
Configuration of Telemetry File
Cron job mdms entry:
Information images for PGR and Open Search
eGov-WhatsApp Template (14th July 2021).xlsx