Hi, Humans. How may we help you?

How to Set Up the Zenvia Bots plugins
6 min
Created by Karine Moreira on 5/2/2023 10:07 AM
Updated by Larissa Aniceto on 8/11/2023 5:39 PM
Check which additional configurations you'll need so that the Zenvia Bots will work correctly
 

First, you'll need to integrate Zenvia Bots. For more information about how to do this, see this article.

 

If is correctly integrated, you'll see an OK in green, as shown below:


To see the API Key for this integration, click the Bots icon and you'll see the screen below: 


In the next step, we'll use the API Key to set up the plugins in Bots.

 
 

Configuring the Zenvia Bots plugins

 

After creating your flow in App.zenvia > Products > Bots > New Flow:


Select the plugin Consult certified contact


The main function of this plugin is to check if the contact is already in the Zenvia Conversion database (considering the WhatsApp line and group that the contact is interacting with).

 

If is already a known contact with an agent assigned, then the conversation will be transferred directly to this specific agent.

 

Then, a new window will open where you must paste the previously generated API Key information in the Sirena Token field:


You will also need to add the Sirena Plugin. The main function of this plugin is to transfer the conversation to Zenvia Conversion.

 

There are 4 ways to transfer a conversation from Zenvia Bots to Conversion:

  • Directly to the agent assigned when is a pre-existent contact: In that case, we recommend that you add a group to transfer contacts if the contact has not yet been assigned.

  • Configure a default group (Secondary Fixed Group) to create a conversations queue in a specific group: In this field, we add the group ID.

  • Configure a fixed group (Default Group for Overflow) to transfer all the conversations to a fixed group on all occasions.

  • Provide the groups (departments) available for clients selection;

 
 

Access the flow you'd like to add the plugin and click the + icon:


Select Sirena's Plugin option, as shown in the image below: 


You'll see the component screen: 


Back in Zenvia Conversion, click on the button next to the API Key to copy it: 


Finally, simply paste the API Key in the Zenvia Conversion Token Bots field: 


Still on this same screen, maximize the More Parameters window by clicking on the icon to the right: 


You'll see the User telephone field. Add the #{telephone} variable, as shown below: 


You can also configure a default group (secondary fixed group) to create a conversation queue in a specific group.

 

In this case, the ID Group is:

ID Group
 

Directly to the agent assigned when is a pre-existent contact.

 

We suggest to use the variable:

#{agentGroupId}
 

In this case, we recommend that you add a group to transfer contacts if it has not already been assigned.


The rest of the options on this window can be configured as desired according to your needs. Click the OK button to complete the setup: 


In addition to these setting, you'll also need to edit the Initial Event.

 
 

Configuring the Initial Event

 

In your flow, click on the pencil button in the upper right of the Initial Event to edit it:


In the editing window, add the variables that will be used in the flow, as shown:

Name

Expression

username

visitor.firstName

phone

from


To make sure the syntax is correct, we recommend copying and pasting the variables from the table above. 


To confirm your changes, click OK


Finally, the last change we must make is to add a Json code.

Setting up JSon

Click the arrow located on the right side of the flow:


In the window that opens, add the following JSon to the end of the code: 

1 2 "defaultConversationalChannel": "WHATSAPP", "historic": true
 

To ensure that the syntax is correct, we recommend copying the snippet above and pasting it into your Bots code.

 

Check the image below for the place where your Json code should be:


After saving your settings, your integration with Zenvia Conversion will be working correctly.

Did this article solve your doubts?
Recently viewed