Sending messages via automation

This section deals with automation in chats to send messages and run workflows.

Basic chat flow

A basic chat flow where agent is a participant of the chatroom along with capabilities to send one-way messages via API (for ex. at the start of the chatroom or updates in between) is achieved as follows.

  1. Create a contact

  2. Create a chatroom with participants

  3. Send a message

Basic chat flow

Saleschat provides APIs for basic chat flow.

Send Template Message API

Since WABA requires initialization of a new chat session via a pre-approved template, the API currently allows sending of only template messages via API.

Even during the conversation, any interactive message, for example, messages with buttons, also need to be sent as a template.

Workflows using templates

Organizations that want to optimize agents time may want to send messages and also process the response via workflow automation.

To be able to achieve this, the Send Template Message API provides a relay_response query parameter.

Where will I receive response from the customer?

The response will be sent to the webhook that is configured for the organization. If the webhook is not configured then the response will not be sent.

Which responses will be relayed back to the webhook?

Only interactions with the templates that have buttons will be relayed back to the webhook. Any message other than interaction with the template, for example, a free flow response will not be sent back to the webhook

Will agent be allowed to chat during the workflow?

Yes, agent will be allowed to send messages even while the workflow is sending messages. The interactions with the template for which relay_response is set will still be relayed back to the webhook.

Silent messaging / Bump

In a basic chat scenario, each message bumps the chatroom to the top of the chatroom list.

Organizations may require that while the workflow automation is sending messages as well as any interaction on the template message remain silent and do not bump the chatroom to the top.

To be able to achieve this, the Send Template Message API provides 2 parameters -

  1. bump - when set to false , the chatroom will not be bumped to the top of chatroom list when a template message is sent.

  2. bump_response - when set to false , any interaction with the template message will not bump the chatroom to the top of the chatroom list.

Free flow (non-interactive) response from the customer will always bump the chatroom to the top of the chatroom list.

Optimizing Agent Participation

A new chatroom for a participant, unlike a message, will always bump it to the top of the chatroom list.

In some cases, bots can handle the initial conversation with a new customer. The system sends a message and waits for the customer to respond. On the basis of handover rules, a human agent can step in to manage the interaction. This ensures efficiency and allows agents to focus on engaged customers.

To be able to achieve this, the Create Chatroom API provides a flag assign_on_handover

This would also make sure that the chatroom is created but not bumped in the list of chatrooms for the agent, because the agent is not yet a participant of the chatroom.

What do you mean by handover?

  1. If assign_on_handover is set to true , then the agent will be assigned to the chatroom only when -

    1. Customer sends a free flow message

    2. There is an interaction with a template sent via STM API and relay_response flag is set to false (default is false )

  2. Explicit reassignment using Chatroom Reassign API

Agent participation can only be optimized at the time of chatroom creation.

Explicit Reassignment

In some cases, organizations may want to send a message to a customer and not wait for response even though assign_on_handover was set to true .

Consider the following scenario -

  1. A chatroom was created with assign_on_handover set to true

  2. A message was sent via STM

  3. Customer neither interacted with the STM message nor responded with any free flow message

  4. Organization would like the agent to follow up manually

To achieve this, you can re-assign chatroom.

On explicitly reassigning in this manner, the pending assign_on_handover will be discarded.

Last updated