Basic CRM Integration Tutorial

This tutorial will guide you through the essential steps for a basic integrating between your CRM and Saleschat.

Without this integration, Saleschat can still be used via its dashboard, but key features like number leakage protection and programmatic agent assignment will not be available.

Step-by-step guide

We recommend that you provide the following two buttons on your CRM:

  1. Login

  2. Chat

Where should I provide these buttons?

The Login button can be provided as an action within accounts or integration section

The Chat button should be provided for each lead, within quick actions for the lead (for ex. next to the dialer).

The functionalities for each of these buttons is explained as below.

1. Login

Users can use the “Login” button to login to Saleschat which should open a new Saleschat tab.

When the login button is clicked, the following steps should be performed at the client:

  1. Generate a magic link for the user.

  2. Open the generated magic link in a new tab.

Users can be created in Saleschat in advance using the Create User API.

This can be a batch operation via a script and need not be a part of logic within your CRM.

Do make sure that the userId's of users that are created via the API are recorded in your system.

2. Chat

Users can use the "Chat" button to get access to the Chatroom with the customer. The access to the Chatroom will be granted basis the business logic.

Where will the User see the Chatroom?

If the business logic permits and the API operations are successful, the user will automatically see the Chatroom at the top of the list of Chatroom within Saleschat's chat dashboard. The User should not "Login" to Saleschat for each customer.

We recommend the following business logic:

Business logic
API documentation

Create a Contact in Saleschat if not created already.

Create a Chatroom for the Contact and assign a User if not created already

If a Chatroom already exists and is assigned to a different user, you can reassign it to the current user, provided your business logic allows this change.

What if I prefer having manager and agent in the same chatroom with the customer?

While practices on personal Whatsapp app follow these conventions, it is not scaleable for the manager and it leads to a state where it is practically impossible for the manager to keep track of all the conversations.

We recommend having only the agent in the chatroom along with the customer. Each manager has access to agent metrics and chats between the agents and the customers.

How will the customer know which agent is s/he speaking with?

We annotate the name of the agent with each chat so as to maintain a personal touch between the agent and the customer.

How will the agent know which customer the agent is speaking with

The chatroom name is a combination of CRM_ID, First Name and Last Name of the Contact that is created.

Explicit Success & Error Notifications:

Each of the API to create a Contact, create a Chatroom and reassign a Chatrrom responds with appropriate error code and error message in case of a failure and we suggest that you display them explicitly when the user is interacting with the Chat button on your CRM.

Basic Database Schema

Field
Description

User table

id (PK)

Primary Key of the User table

crm_user_id

CRM-specific user ID

sc_user_id

Saleschat user ID

sc_magic_link

Magic link for user login

sc_expiry_ts

Expiry timestamp for the magic link

Contact table

id (PK)

Primary Key of the Contact table

crm_customer_id

CRM-specific customer ID

sc_contact_id

Saleschat contact ID

Contact_chatroom table

id (PK)

Primary Key of the Contact_Chatroom table

contact_id (FK)

Foreign key referring to Contact ID

sc_chatroom_id

Saleschat chatroom ID

Contact_chatroom_assigned_to table

id (PK)

Primary Key of the Contact_Chatroom_Assigned table

contact_chatroom_id (FK)

Foreign key referring to the Contact_Chatroom ID

user_id (FK)

Foreign key referring to the assigned User ID

Last updated