Introduction
This document provides an overview of the CxPerium modules (Live Chat, Survey, CRM, Ticket) and explains how they can be integrated into a WhatsApp Chatbot (assistant) using the C# programming language. The following sections describe the core functionalities of each module and demonstrate how to integrate them into a WhatsApp Chatbot with example C# code snippets.
1. Overview
CxPerium is a platform designed to offer a variety of interaction channels for your customers or users. This document covers four main modules:
- Live Chat
- Survey
- CRM
- Ticket
Each module’s core features will be explained, along with C# example code snippets demonstrating how to integrate them into a WhatsApp Chatbot.
2. CxPerium Modules
2.1. Live Chat
The Live Chat module allows real-time support for users. This enables businesses to interact with users instantly and respond to their inquiries or issues quickly.
2.1.1. Transferring a Conversation to Live Chat
At any stage, the assistant can transfer the conversation to live chat with a single line of code using the TransferToLiveChat method:
using QSoft.CxPerium.Dialogs.WhatsApp;
using System;
namespace QSoft.CxPerium.Assistant.Dialogs
{
public class MainDialog : BaseWhatsAppDialog
{
public override void RunDialog()
{
this.LiveChat.TransferToLiveChat();
}
}
}
- Important Note: If the “Only during working hours” setting is enabled in the CxPerium panel and a message is received outside working hours, the user will not be transferred to live chat. In this case, the assistant will continue responding.
- Once the conversation is transferred to live chat, messages will no longer be processed by the assistant. After the live chat session is closed, the assistant will resume handling messages.
2.1.2. Transferring a Conversation to a Specific Team
To assign a conversation to a specific team during live chat, use the TransferToLiveChatByTeam
method. The teamId
parameter specifies the target team, which can be obtained from the Teams page under the Live Chat menu.
using QSoft.CxPerium.Dialogs.WhatsApp;
using System;
namespace QSoft.CxPerium.Assistant.Dialogs
{
public class MainDialog : BaseWhatsAppDialog
{
public override void RunDialog()
{
// Set teamId to the corresponding team ID.
string teamId = “TEAM_ID_HERE”;
this.LiveChat.TransferToLiveChatByTeam(teamId);
}
}
}
Once transferred, team members can manage the conversation via the Live Chat panel. When the chat session is closed, the assistant resumes handling messages.
2.1.3. Webhook Triggered When Live Chat Ends
When a Live Chat session ends, the OnClosingLiveChat
method in the CxPerium
class under the Channels
folder is triggered. This method can be used to perform specific actions or update records after the session closes.
protected override void OnClosingLiveChat(Contact contact)
{
base.OnClosingLiveChat(contact);
}
2.2. Survey
The Survey module is designed to measure user experience and collect feedback. It allows businesses to analyze customer satisfaction, expectations, and needs.
2.2.1. Survey Webhooks
When a user completes a survey or answers a question, relevant methods in the CxPerium
class under the Channels
folder are triggered.
OnSurveyQuestionAnswered
protected override void OnSurveyQuestionAnswered(Contact contact, ConversationState conversation, SurveyCx survey, SurveyQuestionReplyCx answer)
{
base.OnSurveyQuestionAnswered(contact, conversation, survey, answer);
}
OnSurveyCompleted
protected override void OnSurveyCompleted(Contact contact, ConversationState conversation, SurveyCx survey)
{
base.OnSurveyCompleted(contact, conversation, survey);
}
2.2.2. Sending a Survey from the Assistant
To send a survey prepared in CxPerium to a user, use the SendSurvey
method of the Survey
class:
using QSoft.CxPerium.Dialogs.WhatsApp;
using System;
namespace QSoft.CxPerium.Assistant.Dialogs
{
public class MainDialog : WelcomeDialog
{
public override void RunDialog()
{
this.Survey.SendSurvey(“surveyid”);
}
}
}
The surveyid
value can be obtained from the Surveys page in the CxPerium panel.
2.3. CRM
The CRM module manages customer relationships, stores customer records, and analyzes customer interactions.
2.3.1. Automatic Record Creation
When a user sends a message to the WhatsApp number linked to CxPerium, a CRM record is automatically created if GDPR consent is granted.
2.3.2. Accessing Contact Data
User data can be accessed within an assistant (dialog) using the Contact
object:
public override void RunDialog()
{
var user = this.Contact;
// Access user.Id, user.Phone, user.Email, etc.
}
2.3.3. Contact Class Methods
- InsertOrUpdateCustomField(string fieldName, string fieldValue) – Adds or updates a custom field in the
Contact
object. - Anonymize() – Anonymizes the
Contact
object to mask personal data. - UpdateEmail(string email) – Updates the email field of the
Contact
object. - UpdateLanguage(LanguagesEnum language) – Updates the default language of the
Contact
object.
2.4. Ticket
The Ticket module is a task management system integrated with WhatsApp. Users can create tickets (support/task records) via assistants, and these tickets can be assigned to CxPerium users or teams. This enables:
- Automatic WhatsApp notifications to assigned users.
- Updates or comments made by the assigned user to trigger automatic notifications to the ticket creator.
The Ticket module ensures that all communication during a support or task process is managed via WhatsApp and recorded in the system, allowing both team members and users to track the process seamlessly.
This document provides fundamental information about the main modules in CxPerium. For advanced integrations or additional configurations, refer to the official documentation or contact technical support.