Overview

Chatbot service is a chatbot which provides functionality to the user to access PGR module services like file complaint, track complaint, notifications from whatsapp. Currently citizen has three options to start conversation scan QR code, give missed call or directly send message to configured whatsapp number.

Pre-requisites

  1. Prior Knowledge of Java/J2EE.

  2. Prior Knowledge of SpringBoot.

  3. Prior Knowledge of PostgresSQL.

  4. Prior Knowledge of REST APIs and related concepts like path parameters, headers, JSON etc.

  5. Prior Knowledge of JSONQuery in Postgres. (Similar to PostgresSQL with a few aggregate functions.)

Dependencies

Functionalities

Chatbot service allows citizen to access PGR service through whatsapp. Citizen can provide all details required to create PGR complaint through question and answer method. The service continuosly listen on PGR update Kafka topic and send notifications to users associated with PGR record. On any message from citizen which is forwarded by whatsapp provider, chatbot processes his messages by passing message through various stages ex:- validations, enrichment, transformations etc and at the end sends final response to user by calling endpoint of whatsapp provider.

Configurations

There are two types of configurations for chatbot states:-

Flow Diagrams

Deployment Details

  1. Add configs required for chatbot Service.

  2. Deploy the latest version of chatbot Service.

  3. Add Role-Action mapping for API’s.

Integration

Integration Scope

The chatbot service is used to communicate with the users, lodge their complaints or provide miscellaneous / adhoc services which citizens avail from ULBs in an interactive way over whatsapp.

Integration Benefits

Steps to Integration

  1. To integrate, host of chatbot module should be overwritten in helm chart.

  2. POST /messages should be added as the endpoint for receiving user sent message and forward it to chatbot core logic for further processing and sending back response.

  3. GET /messages should be added as the endpoint for receiving user sent message and forward it to chatbot core logic for further processing and sending back response.

Reference Docs

Doc Links

Title 

Link

API Swagger Documentation

Swagger Documentation

API Details

a) POST /messages

Receive user sent message and forward it to chatbot core logic for further processing and sending back response

b) GET /messages

Receive user sent message and forward it to chatbot core logic for further processing and sending back response

Kafka Consumers

Kafka Producers