Hi, Humans. How may we help you?

07. Customer assignment in the Chatbot
3 min
Created by Ligia Sarmento on 12/6/2024 9:32 AM
Updated by Ligia Sarmento on 12/16/2024 5:02 PM

Customer assignment ensures that a client is always served by the same sales agent responsible for their account. For example, a client in negotiation or part of an active sales portfolio is directed to the designated agent, ensuring continuity in the relationship and greater accuracy in commercial interactions.

In this article, we will teach you how to configure customer assignment in a flow-based chatbot, detailing the step-by-step process to assign specific agents to certain clients.

💡 Tip: In Automated Triage, customer assignment is already built into the flow, as it was specifically designed to meet the needs of commercial service. Therefore, this article focuses on flow-based chatbots.

Configuring customer assignment in a Flow-Based Chatbot

When configuring customer assignment in a flow-based chatbot, during the interaction with the client, the chatbot automatically checks if the default assigned agent is available. This check occurs in real-time via an API call, ensuring the service follows the established rules and respects the predefined assignment.

To configure customer assignment in a flow, you need to add two blocks:

  • A block to verify the assignment.

  • A block to transfer the conversation.

Follow these steps:

Block to verify the assignment

  1. Access the chatbot flow where you want to configure the assignment.

  2. Add a new block.

  3. Click on Conversation Actions and select API Call.

  4. Fill in the configuration fields as explained below:

  • Method: Select the GET method, used to retrieve information without modifying data on the server.

  • URL: Enter the API URL to verify the assignment:

     For WhatsApp:


 https://contacts-manager.zenvia.io/prospects/is-carteirizado?channel=whatsapp&contactMedium=phoneNumber&value=<?$phone?>

 For WebChat:


 https://contacts-manager.zenvia.io/prospects/is-carteirizado?channel=webchat&contactMedium=email&value=<?$email?>

Details:

  • channel: Specifies the channel used in the service (e.g., whatsapp or webchat).

  • contactMedium: Defines the type of client identification (e.g., phoneNumber for WhatsApp or email for WebChat).

  • value: Contains the dynamic variable identifying the client. For WhatsApp, use <?$phone?>. For WebChat, replace it with <?$email?>.

💡 Tip: Ensure the URL is correctly adapted to the configured service channel.

  • Header: Enter the JSON header in the appropriate field:

{
  "organizationId": "<your-organization-id>",
  "zenviaCredentialId": "<your-zenvia-credential-id>"
}


organizationId: Identifies your organization in the platform. Enter the value provided by Zenvia.

zenviaCredentialId: Authentication key to access the API services.


Block to transfer the conversation

  1. Add a new block to the flow.

  2. Click on Conversation Actions and select Transfer Conversation.

  3. Check the Human Assistance option.

  4. Configure this block to direct the client to the corresponding agent, based on the API's assignment response. Fill in the configuration fields as follows:

  • Type: Commercial Service.

  • Group ID: Leave this field blank.

  • User ID: <?$resposta_api.body.user?>.

With these steps, you ensure the chatbot respects the assignment logic during the service. To confirm everything is working correctly, simulate a service interaction to ensure the flow checks the assignment properly and transfers the conversation to the designated agent.

Important: The assignment functionality depends on the correct configuration of contact allocation in the Commercial Service section. If this configuration is not performed properly, assignment logic may fail. For more information on how to configure contact allocation, check out the article Contact assignment in Zenvia Customer Cloud.



Did this article solve your doubts?
Recently viewed