Webhooks
Incoming messages from users (students/parents) ping the webhook endpoints hosted within the Chatbot module.- Verification: When setting up the webhook with Meta, the Chatbot views handle the initial verification challenge payload seamlessly.
- Ingestion: When messages arrive, they are parsed safely and passed to the asynchronous message queue (e.g., Celery) to prevent timeout issues on the provider side.
Session Handling
The system tracks ongoing conversations natively:- Each user’s phone number forms a
Session. - Conversations carry “State”, mapping where the user is in a dialogue flow (e.g., “Awaiting Student ID”, “Main Menu”, “Viewing Exam Results”).
Automated Features
The chatbot offers quick self-service paths:- Check Results: Users supply an ID/PIN and the system queries the
Coremodule’s assessment tables in the relevant tenant. - Attendance Query: Parents can pull down attendance registers for a term.
- Broadcasts: Administrators can queue blast notifications out to all registered numbers in specific class sessions or entire forms.
AI Extensions
If integrated with an LLM, the unhandled text is securely injected into an AI Prompt, pre-seeded with context about the school and policies, and generates an organic response.Chatbots operate natively within tenants! The webhook logic parses the number or inbound route to know which school this message is meant for, setting the tenant context appropriately before replying.