# Welcome to Swiftsell

Our goal is to help you get set up and assist you in anything you need to succeed.

Welcome to the Swiftsell help center! 😃

We understand that using a new product can sometimes be a bit challenging, so we're here to assist you every step of the way. Whether you're a new customer or a long-time user, we've covered you with comprehensive guides, tutorials, and troubleshooting tips to ensure a seamless experience.

If you still can't get through,

Reach us at 👉🏼 [support@swiftsell.biz](mailto:undefined)

<table data-view="cards"><thead><tr><th></th><th></th><th></th></tr></thead><tbody><tr><td>🏁 <a href="/getting-started/building-a-chatbot">Getting Started</a></td><td></td><td></td></tr><tr><td>⏹️ <a href="/bot-builder/action-block">Action Blocks</a></td><td></td><td></td></tr><tr><td>🔗 <a href="/integrations/overview">Integrations</a></td><td></td><td></td></tr><tr><td><a href="/whatsapp-business-api/overview">Whatsapp Business API</a></td><td></td><td></td></tr><tr><td><a href="/live-chat/overview">Live Chat</a></td><td></td><td></td></tr><tr><td><a href="/outbound-bots/overview">Outbound Bots</a></td><td></td><td></td></tr></tbody></table>


# Swiftsell Basics

Everything that you need to know about building chatbots with Swiftsell

### What does it offer?


# Building a Chatbot

Chatbots are the way forward for any business looking to automate any repetitive or manual task. Now that you're interested in creating a chatbot, let's learn about building a chatbot

### What type of chatbots I can build?&#x20;

There are two types of chatbot that you can build. They are;&#x20;

1. [Inbound Chatbot](#how-do-i-build-an-inbound-chatbot)
2. [Outbound Chatbot](broken://pages/bu3664jwucUoNIkJGoFP)

### What is an Inbound chatbot?&#x20;

An inbound chatbot is a type of chatbot that is designed to interact with customers or users who initiate contact with a business or organisation. These chatbots are usually placed on a company's website or social media platform and are programmed to respond to customer inquiries, provide product information, schedule appointments, or handle other customer service tasks.&#x20;

### How do I build an Inbound Chatbot?

You can follow the following steps to build an inbound chatbot;&#x20;

* Go to '**Bot Builder**' <br>
* Click on '**Build a Bot**' <br>
* Choose '**Build an Inbound Bot**' <br>
* Select the '**Channel**' from the available options<br>
* Choose how you want to build your bot i.e. '**Use this Templates**' or '**From Scratch**' <br>
* Add '**Action Blocks**' in the conversational flow<br>
* Configure '**Action Blocks**' on the right panel<br>
* Click on '**Test this Bot**' to test the flow <br>
* Click on '**Deploy**' to deploy the bot


# Testing a Chatbot

Now test your bot on Swiftsell before deploying it to the production

### How do I test my bot?&#x20;

To test the bot, you can follow the following steps;&#x20;

* Go to '**Bot Builder**' <br>
* '**Open**' the bot you want to test<br>
* Click on '**Test this Bot**' &#x20;

TODO: INSERT IMAGE

{% hint style="success" %}
Once you click on '**Test this Bot**', a different window will open up allowing you to test the flow of the bot that you have built
{% endhint %}

{% hint style="warning" %}
You will need to allow the pop-ups on your browsers in case you do not see the window opening-up
{% endhint %}

{% hint style="info" %}
The link is publicly available and hence can be shared across with the other team members as well
{% endhint %}


# Installation

Swiftsell supports deploying chatbot on following channels;

{% tabs %}
{% tab title="Website" %}
{% content-ref url="/pages/ubemXg7KtiNdlwufQV6h" %}
[Installation using HTML](/getting-started/installation/installation-on-website/installation-using-html)
{% endcontent-ref %}

{% content-ref url="/pages/G1NWKo6pm7Fq8RxdWHdQ" %}
[Installation using Google Tag Manager](/getting-started/installation/installation-on-website/installation-using-google-tag-manager)
{% endcontent-ref %}

{% content-ref url="/pages/b8FRYO3ipDneW3GXOfL0" %}
[Installing on SquareSpace](/getting-started/installation/installing-on-squarespace)
{% endcontent-ref %}
{% endtab %}

{% tab title="WhatsApp" %}
{% content-ref url="/pages/MUGQ5u81Pf0sNsHbVkSE" %}
[Installation on WhatsApp](/getting-started/installation/installation-on-whatsapp)
{% endcontent-ref %}
{% endtab %}

{% tab title="Facebook" %}
{% content-ref url="/pages/ofPlx1vap6vucRzxrLKc" %}
[Installation on Facebook](/getting-started/installation/installation-on-facebook)
{% endcontent-ref %}
{% endtab %}
{% endtabs %}


# Installation on Website

Adding our Javascript snippet on your website starts showing the chat widget on all the pages of your website. Visitors engage with the chatbot using the rich chat widget

To add the chatbot to your website, the first thing you need to do is add 'Swiftsell's' code snippet on your website.&#x20;

There are two ways by which you can configure the bot on your website;&#x20;

1. Using HTML
2. Using Google Tag Manager


# Installation using HTML

Configure the chatbot on your website using HTML code

To add the chatbot to your website, the first thing you need to do is add Swiftsell's code snippet on your website's HTML, preferably in the \<Body> tag of a reusable component like the header or footer. This way the bot chat widget will show up on all the pages of your website.&#x20;

### How can I configure it?&#x20;

To configure it using HTML code snippet, you can follow the following steps;&#x20;

* Go to 'Channel Configuration -> Web -> Configuration' <br>
* Enter the domain address in the 'Website URL' field where you would like to add the chat widget&#x20;

{% hint style="info" %}
The domain restriction logic only allows the chat widget to appear on the domain that you have entered on the 'Website URL' field
{% endhint %}

* Copy the code snippet and add it to any reusable component of your website's HTML file like Header or Footer

{% hint style="info" %}
By following the above steps, you will see the chat widget visible on your website. Simply 'Deploy' a bot and see your visitor's interactions get automated at scale

\
If you do not see a chat widget on your website, then it must be because of the following reasons; <br>

* No bot is created&#x20;
* No bot is turned on&#x20;
* No bot is created for the 'Web' channel<br>
  {% endhint %}


# Installation using Google Tag Manager

Using Google Tag Manager to host your website? Well we have got you covered

### How do I set it up using Google Tag Manager?&#x20;

To set it up on your website using Google Tag Manager, you can follow the following steps;&#x20;

* Go to 'Channel Configuration -> Web -> Configuration' <br>
* Enter the 'Website URL' <br>
* Copy the code snippet<br>
* Go to 'Tag Manager -> Workspace -> Tags' <br>
* Create 'New Custom HTML Tag' by clicking on 'New' <br>
* Paste the code snippet under 'Custom HTML' tag & set the trigger condition to 'All Page'&#x20;

{% hint style="info" %}
As per your preference, you can also set the trigger for only the pages that you want to show the bot on
{% endhint %}

* Give appropriate name and save the tag<br>
* Preview the 'Tag' through 'Debug' and hit 'Publish' once ready

{% hint style="info" %}
Now when the website loads, the chatbot will start showing up on all the pages defined in the trigger&#x20;
{% endhint %}


# Installing on SquareSpace

Having chatbot on your SquareSpace website can give a fresh new look to your old and beloved '.com'. You can embed the bot either on the single page or can embed on the entire website

### How do I configure it on a single page?&#x20;

To embed the bot on a single page, you can follow the following steps;&#x20;

* Go to 'Channel Configuration -> Web -> Configuration' <br>
* Copy the 'Code Snippet' <br>
* Go to the desired page where you want to embed the bot<br>
* Hover and select the page setting (menu gear against the page name) <br>
* Under the page settings screen, select 'Advanced' <br>
* Click on 'Page Header Code Injection' <br>
* Paste the snippet in the block editor<br>
* Click on 'Save' to apply changes<br>

### How do I configure it on the entire website?&#x20;

To embed the chatbot on the entire website, you can follow the following steps;&#x20;

* Go to 'Settings' <br>
* Under 'Settings', select 'Advanced' <br>
* Under 'Advanced', select 'Code Injection' <br>
* Scroll down until you see 'Footer' section<br>
* Paste the code in the 'Footer' section&#x20;


# Installation on WhatsApp

WhatsApp is by far the most popular messaging platform used by people around the globe. Connect your Chatbot with WhatsApp and interact with your customers at ease

{% hint style="info" %}
You can connect WhatsApp Chatbot with WhatsApp using WhatsApp Business API. In case you do not have WhatsApp Business API, you can refer to this [article](broken://pages/KqKxKXTfIxR1UWP3lbLB) or can reach out to us at `support@swiftsell.biz`
{% endhint %}

### How do I configure a chatbot on WhatsApp?&#x20;

To run a chatbot on WhatsApp, you can follow the following steps;&#x20;

* Go to 'Channel Configuration -> WhatsApp -> Configuration' <br>
* Click on '+ WhatsApp Configuration' <br>
* Provide the following details; <br>
  * Phone Number: \
    \
    Enter the Phone number for which you have WhatsApp Business API. Enter the phone number with the country code but without '+' sign<br>
  * API Details: \
    \
    Different providers have different input fields. Enter the details received from the provider into the respective fields

{% hint style="info" %}
Currently, Swifsell supports the following providers;&#x20;

* Meta&#x20;

* 360Dialog

* Twilio&#x20;

* Unifonic&#x20;

* GupShup
  {% endhint %}

* Click on 'Save' to save the configuration<br>

* Go to 'Bot Builder -> WhatsApp Bot -> Trigger Action Block' <br>

* Select the 'Phone Number' configured<br>

* Click on 'Deploy' to go live with the chatbot on WhatsApp


# Installation on Facebook

Facebook is definitely a popular channel for businesses to automate their customer interactions. Especially for businesses B2C space

### How do I configure it on Facebook?&#x20;

To configure the chatbot on your Facebook page, you can follow the following steps;&#x20;

* Go to 'Channel Configuration -> Facebook' <br>
* Click on 'Connect to Facebook'

{% hint style="info" %}
Clicking on this will open up a pop up window requesting to sign in to your Facebook account and for the permissions to be provided to Swiftsell app\
\
In case the pop up window does not open, please check your browser settings as you may have enabled a setting that blocks the pop up to open
{% endhint %}

* Select 'Facebook Page' to connect chatbot with<br>
* Check the status

{% hint style="info" %}
Click on 'Dropdown' and select the bot you would like to map to the selected Facebook Page. If the bot's status is turned on then you will see <mark style="color:green;">ACTIVE</mark> written on that page & if the bot is turned off, you will see <mark style="color:red;">INACTIVE</mark>\
\
If there is no status, that means that no bot is not connected to the page
{% endhint %}


# Deploying a Chatbot

Go-Live with the Chatbot and start interacting with the visitors

To deploy the chatbot, you can follow the following steps;

* Channel Configuration:&#x20;

  First and foremost you will need to configure the channel for which the bot is built. To configure the channel, you can go to '**Channel Configuration**' & select the channel
* Go to '**Bot Builder**'
* '**Switch On**' the bot you wish to deploy
* '**Open**' on the bot you want to deploy
* Click on '**Deploy**' at the top right corner

TODO: INSERT IMAGE

{% hint style="info" %}
If the channel is not configured, deploying the bot will fetch an error\
\
We at Swiftsell recommend to 'Deploy' the bot every time the changes are made in the flow
{% endhint %}


# Utility Tools

Swiftsell offers a set of tools on the left of the canvas which you can use while building the bot

Here are a few tools that are available on the left of the canvas;&#x20;

* **Search:** \
  \
  This tool allows you to look for the action block based on its name. The tool is really handy when the flow is huge and constant changes are required to be made in the flow<br>
* **Auto Layout:** \
  \
  This tool will allow you to automatically arrange all the action blocks on the canvas in proper order and ensure that the canvas looks neat<br>
* **Expanded View:** \
  \
  This tool allows you to see the content inside the action block<br>
* **Minimap:** \
  \
  This tool highlights the area of the canvas where the content is present<br>
* **Undo:** \
  \
  This tool allows you to reverse all the changes made in the flow or bot builder<br>
* **Redo:** \
  \
  This tool allows you to revert to the recent changes made in the flow or bot builder<br>
* **Zoom In:**\
  \
  This tool allows you to zoom in, enlarging the size of the action blocks<br>
* **Zoom Out:** \
  \
  This tool allows you to zoom out, reducing the size of the action blocks <br>
* **Version Control:** \
  \
  This tool allows you to revert to the old bot or old version on which the bot was built<br>
* **Zoom to Content:** \
  \
  This tool allows you to directly navigate to Canvas where the content is present<br>


# Action Block


# Trigger

Starting point of the chatbot flow.

The trigger block is what determines which chatbot is to be executed when a user requests a chat.

### Conditions for trigger <a href="#conditions-for-trigger" id="conditions-for-trigger"></a>

As you can have more than one chatbot on your account, the conditions on the trigger help the system qualify the right chatbot for the conversation.

You can also combine multiple conditions using an AND/OR operation.

The conditions on the trigger can be:

| **URL**              | <p>The webpage URL the user is on.</p><p>For example, "URL contains pricing" or "URL equals <https://swiftsell.biz>"</p>                                            |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Browser language** | The default language set by the user on their browser. For example, "Language is French"                                                                            |
| **Date range**       | The date when the user is initiating the chat. For example, you can build a separate chatbot flow that activates during Christmas or for a new launch announcement. |
| **Keyword**          | \[Only for WhatsApp and SMS] The incoming keyword from the user that started the chat. For example, the user sent a keyword containing "Book appointment".          |
| **Button payload**   | \[Only for WhatsApp and SMS] When the user receives a template message from the business and clicks on a button.                                                    |

**Conditions are not mandatory.** If you have not defined any conditions for your chatbots, the first active chatbot on the list will be activated.

### Contact subscription <a href="#contact-subscription" id="contact-subscription"></a>

Applicable only for WhatsApp and SMS.

In channels like WhatsApp and SMS, businesses can reach out to contacts at any time, even if the contact doesn't want to have a conversation.

Countries' laws mandate that companies maintain a subscription status for each contact, meaning that a contact has subscribed or unsubscribed from receiving your communication. This is similar to how unsubscription works on emails.

**SUBSCRIBED -** Will receive any new template message that the company sends as a promotion.

**UNSUBSCRIBED -** Will not receive any template message that the company sends as a promotion.

So, based on the conditions you define for the trigger, you can choose to set the subscription status for the contact.

Generally, you should always have two chatbots:

* Your main chatbot, which has the 'Subscribed' status
* An acknowledgment chatbot for when users type 'STOP.'

### Inject data into the chatbot <a href="#inject-data-into-the-chatbot" id="inject-data-into-the-chatbot"></a>

If you want to send external data to the chatbot, you can use this option. Once enabled, you can map the fields that contain the value with the Swiftsell variable.

Two ways you can inject the data:

#### Using Query params <a href="#using-query-params" id="using-query-params"></a>

With this method, when the Swiftsell snippet is loaded on the website for the first time, the defined query params and their values will be stored in the Swiftsell variable.

For example, if your URL is the following`www.swiftsell.biz?cust_id=1234&plan=9896`

You can choose to store the values of `cust_id` and `plan` on the trigger action block.

<div align="left"><figure><img src="https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252FFcGmWsh3vcRFCRd6bGsH%252FCleanShot%25202024-06-08%2520at%252011.38.13.png%3Falt%3Dmedia%26token%3D5a79f128-c032-4cf3-935a-5c002f00075d&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=744685df&#x26;sv=1" alt=""><figcaption></figcaption></figure></div>

#### Using JSON <a href="#using-json" id="using-json"></a>

With this method, you can inject a JSON payload inside Swiftsell's code snippet and map the objects to be stored in the trigger action block.

To do this you need to add the following object with your desired fields in the Swiftsell code snippet

Copy

```
data-session-payload='{"field1": "value", "field2: "value"}
```

Now, let's take an example to understand this.

Assume you are using the chatbot in your web app and already know the user initiating the chat. For your agents to know the user details, you can add their name, email, customer\_id, plan, etc. to the Swiftsell code snippet.

Copy

```
<script src="" data-session-payload='{"name": "Charles", "phone": "8164848686"}' defer></script>
```

We have stored the “name” and “phone" fields to Swiftsell variables on the trigger action block.

![](https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252FdpN4xZDKrAJ0DB5IOTK8%252FCleanShot%25202024-06-08%2520at%252011.45.53.png%3Falt%3Dmedia%26token%3D1b4bcdc4-03fa-40bf-b1eb-ef58f17cb389\&width=768\&dpr=4\&quality=100\&sign=584b136\&sv=1)

{% hint style="info" %}
Note:

* Swiftsell reads this object only once when the code snippet is fired. Sending data after the code snippet loads will not be read.
* Dynamically add the data-session-payload object to the Swiftsell code snippet
  {% endhint %}


# Send Message

Action block is used for sending out informative messages that do not seek input from the visitors.

The rich text editor supports all languages i.e. now you can type your input in any language you want like French, Spanish, etc. Delay in sending messages based on word count if the content of the first message is large, the bot usually delays sending the second message for 2 to 5 seconds allowing the visitor time to read through the first message.

#### When should I use this block?  <a href="#when-should-i-use-this-block" id="when-should-i-use-this-block"></a>

There are various reasons for which this action block can be used like for instances it allows you to greet your visitor, share information about the product or service or company as well.

#### How do I set it up?  <a href="#how-do-i-set-it-up" id="how-do-i-set-it-up"></a>

You can follow the following steps to set up '**Send Message**' action block;

* Add a block on canvas by clicking on '**+**'
* Choose '**Send Message**'
* Configure the following on the right panel
  * **Message:** Configure or set the message that you would like to send it to the visitor. You can also use the variables to personalise the message. Depending on your preference, you can either add text message by clicking on '**+ Text**' or media file as message like GIFs or images by clicking on '**+ File**'

#### What formatting options do I have?  <a href="#what-formatting-options-do-i-have" id="what-formatting-options-do-i-have"></a>

In the rich text editor, you can format your text using the formatting bar. It allows you to display your message to the user either in the Bold or Italics letters or even underline the selected part of the message. It also allows you to send the message in the bullet points or attach link with selected text.

* Bold
* Italics
* Underline
* Bullet Points
* Link

You can also add emojis to make the conversation more casual and friendly. We do support up to 999 characters however we do recommend not to have more than 160 characters in a single message since anything more than this could impede the user experience

#### Can the messages be re-arranged?  <a href="#can-the-messages-be-re-arranged" id="can-the-messages-be-re-arranged"></a>

The sequence of the messages/inputs space can also be changed as per the preference. You can hover over the block till the arrows are visible on the left of the input space, left-click on the arrow (hold), drag (upwards or downwards) & release it to the position as per the new sequence defined.


# Collect Input

This action block allows you to collect the input or response from the visitors or customers

When you as a business want to ask questions to the visitor and expect answers in the return. You don't want to just collect any random input, like you're asking for the visitor's email and they input 'abcedfg', it wouldn't make sense to move ahead in the conversation without receiving a valid input.&#x20;

The collect input block has a set of in-built validations that you can use to verify whether the input provided is valid and only then move forward with the flow.&#x20;

### When should I use Collect Input?&#x20;

* Collecting information like name, email, or phone
* Asking questions&#x20;
* Collecting Feedback&#x20;
* Branching the conversation flow based on the input received

### How do I set it up?&#x20;

You can follow the following steps to set up the '**Collect Input**' action block;&#x20;

* Add the block on canvas by clicking on '**+**' <br>
* Choose '**Collect Input**'\
  &#x20;
* Configure the following on the right panel<br>
  * **Question:** Write down the question you want to ask in the rich text editor under '**Show this question**' <br>
  * **Variable:** Select the variable in which the response from the visitor will be stored

{% hint style="info" %}
These variables can be used later in the conversational flow to give personalization
{% endhint %}


# Buttons

Buttons block is used to branch out conversation using intuitive buttons. You can choose any option to go down its path. Each button can have a same path or different paths moving from it

Button action block can be used while building the bot for the Web or Facebook channel.

### What are the different types of Buttons?&#x20;

* **Branch:** Move to a different path of the conversation flow
* **URL:** Open a web page and end the flow

{% hint style="info" %}
Buttons will perform either of the above functions at a time\
\
Maximum number of buttons that can be added is 10\
\
The buttons do not disappear after they are clicked on so, the user can return to them at any moment during a conversation
{% endhint %}

### How do I set it up?&#x20;

You can follow the following steps to set up the '**Buttons**' action block;&#x20;

* Add an action block on canvas by clicking on '**+**'<br>
* Choose '**Buttons**' <br>
* Configure it on the right panel<br>
  * **Defining Question:** \
    \
    Depending upon the preference, you can either add a text message or a question that needs to be sent to the visitor to collect input\
    \
    Using our rich text editor, you can format the text or the question that you want to send to the user. You can also add emojis to make the conversation more casual and friendly<br>
  * **Defining Buttons:** <br>

    You can either add a Branch button or a URL button based on your preference. Let's have a quick look at how these buttons can be configured. <br>

    * **Branch Button:** \
      \
      Selecting and configuring the branch button will allow the user to navigate visitors to different flows based on the selection. '+ Branch Button' will allow you to add multiple buttons. To remove the button, you can double-click on the same and give the appropriate name as per your preference. <br>
    * **URL Button:** \
      \
      Adding a URL button will allow you to navigate your visitors from one page to another either in the same tab or in a different tab. You can add multiple URL buttons by clicking on '+ URL Button'. To configure the URL button, you can follow the following steps; <br>

      * Click on the '**Link Icon**' displayed on the left of the button<br>
      * Copy / Paste the '**Link / URL**', you want the visitors to be navigated to<br>
      * Choose whether to open in the '**Same tab**' or in the '**New tab**' <br>
      * Click on the '**Right**' icon to configure the URL

      \
      Adding a URL button will end the conversation flow<br>
  * **Define Variables:**\
    \
    Store the selected button in a variable. Doing this will assist you to know what button the visitor has selected, which can be further used while creating the lead in the CRM or sending the data to any other internal systems\
    \
    The input from the visitor will not be stored in a variable if the button type is '**URL Button**'&#x20;


# Reply Buttons

Render up to three buttons in your conversation flow on WhatsApp

{% hint style="info" %}
This feature is only supported for WhatsApp for the following WA API providers: 360Dialog, Meta, and GupShup&#x20;
{% endhint %}

Using reply buttons makes it easy for the user to reply to a question by giving a rich interface of buttons. Users can create a maximum of **3** buttons. If more are needed, it is recommended to use the [List](/bot-builder/action-block/list) or [Options](/bot-builder/action-block/options) action block.

<figure><img src="https://2580337444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2FF09e36vCFYYjKgsie5xN%2FGroup%202.png?alt=media&#x26;token=173e6bc1-475d-4920-aed8-88ada500c9c7" alt=""><figcaption><p>Preview of reply button on WhatsApp</p></figcaption></figure>

## Configurations on the action block

### Header

Users can choose to show a header text or image in one of the following ways,

* **Text** - Shows a text in bold&#x20;
* **Media (Static)** - Shows an image/video/gif
* **Media (Dynamic)** - Allows you to enter a variable that can show rich media dynamically

### Body

The text will be the question associated with showing the list of options.&#x20;

### Footer

An optional field where a help text is entered. Mostly a disclaimer, visualized in a grey color.

### Button name

You can add up to 3 buttons with different text.

### Variable

Users can store the value of the selected list item in a variable for future reference.

([Refer to this article to learn more about variables](broken://pages/yoQeaanOi6YcYGlLVEoj))

### Track links

Enabling this option will create short URLs for all the URLs mentioned in this action block.&#x20;

([Refer to this article](broken://pages/fXXTtx6OkxSObuZTFSuj))

{% hint style="warning" %}
This will only work if **Link tracking** is enabled in your account settings.
{% endhint %}


# Carousel

Carousel action block is set of cards that represent something whether its product or service

There are two types of Carousel blocks that Swiftsell offers. They are;&#x20;

1. **Image Carousel:**\
   \
   When you just want to show a set of images in a card, not requiring any input to move forward in the conversation flow<br>
2. **Carousel:**\
   \
   When you want to display details along with images along with CTA buttons to move forward in the conversational flow

### When should you use it?&#x20;

* Displaying a set of products or services
* Wanting to let the visitors choose from a variety of options&#x20;
* Give an image for a button
* Showing a set of images

### How do I set up the 'Carousel' action block?&#x20;

You can follow the following steps to set up the 'Carousel' action block;&#x20;

* Add action block on canvas by clicking on '+' <br>
* Choose 'Carousel' <br>
* Configure it on the right panel<br>
  * **Adding a card:**\
    \
    Click on '+ Card' to add a card. A maximum of 10 cards can be added in a 'Carousel'<br>
  * **Configuring the card:**\
    \
    Click on 'Card' to configure the following;<br>
    1. **Card Image:** \
       \
       Click on 'Upload an Image' to upload the image<br>
    2. **Card Name:** \
       \
       Provide the name of the card in the text editor<br>
    3. **Card Description:** \
       \
       Describe the card in the rich text editor<br>
  * **Buttons:** \
    \
    The carousel supports two types of buttons;<br>
    1. **Call to Action:**\
       \
       Using this button will allow you to decide the next set of actions or flow visitors will be navigated to  \
       &#x20;
    2. **URL Button:**\
       \
       Using this button, you can configure the URL where you would like to navigate the visitor to&#x20;

{% hint style="warning" %}
A maximum of 3 buttons can be added to one card.&#x20;
{% endhint %}


# Answer AI

Uses an LLM-based AI model to generate an answer for the question asked.

The Answer AI action block generates an answer to the user's question from the trained data.

When using the answer AI block, the user submits an open-ended question, which the AI Studio then processes to generate a relevant answer.

{% hint style="info" %}
Swiftsell uses OpenAI GPT APIs to generate an answer.
{% endhint %}

Process in which the Answer AI works,

1. The user asks a question
2. AI generates the answer from a knowledge base

### Step 1: Define the question <a href="#step-1-define-the-question" id="step-1-define-the-question"></a>

This message will prompt the user to ask their question.

For example, your message could be,

> 👋 Hey! I'm an AI assistant, how can I help you?

### Step 2: Choose a knowledge base <a href="#step-2-choose-a-knowledge-base" id="step-2-choose-a-knowledge-base"></a>

Choose the knowledge base from which AI will generate an answer.

### Step 3: Configure your AI for accurate answers <a href="#step-3-configure-your-ai-for-accurate-answers" id="step-3-configure-your-ai-for-accurate-answers"></a>

LLM models require guidance to be able to generate a relevant and accurate answer. There are some tools you can use to guide your AI; they are:

#### Instructions/Prompt <a href="#instructions-prompt" id="instructions-prompt"></a>

A prompt is an instruction that helps the LLM know what to remember and follow while generating an answer.

The more clear, concise, and brief your instruction, the more accurate your answers will be from the AI.

Things to write in your prompt:

* **Objective** - What is its objective
* **Output format** - Typically would be HTML/markdown.
* **Writing style** - How should the answers be written?
* **Don'ts** - Clear instructions of what to avoid.
* **Examples** - Examples of question and answer.

#### LLM model <a href="#llm-model" id="llm-model"></a>

Select the LLM model that will be used to parse your training data and generate an answer.

Currently, Swiftsell only supports the following models:

* gpt-4o
* gpt-4-turbo
* gpt-4
* gpt-3.5-turbo

#### Restrict answer size <a href="#restrict-answer-size" id="restrict-answer-size"></a>

The maximum length of the answer is defined in tokens.

Tokens can be thought of as pieces of words, and 1 token=4 characters. [Learn more](https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them)

#### Creativity in responses <a href="#creativity-in-responses" id="creativity-in-responses"></a>

You can control whether you would like to receive unique responses every time a question is asked or get the same response every time the question is asked.

Define a number between 0 and 1. Nearer to 1 gives you distinct responses; nearer to 0 gives you fix responses. By default, we keep the number as **0.5**.

#### Chunks <a href="#chunks" id="chunks"></a>

When the AI is asked a question, it first fetches relevant content from the knowledge base, which is then sent to the LLM model to generate an answer.

The more relevant content the AI can fetch, the more chances of accurate responses are.

The number indicates the number of relevant responses which will be fetched from the knowledge base.

#### Context length <a href="#context-length" id="context-length"></a>

Sends the recent sets of question answer pairs to provide the LLM with more context of the current ongoing chat.

The benefit of this is that you can ask a follow-up question as 'it's pricing', and the LLM would be aware that your previous question was about Swiftsell, so you meant "Swiftsell's pricing'.

#### Ask for feedback <a href="#ask-for-feedback" id="ask-for-feedback"></a>

For every AI generated response, we allow the user to submit feedback about the generated answer.

This helps you know how helpful are AI's answers.

#### Answer source <a href="#answer-source" id="answer-source"></a>

Displays the URL of the content source from where the answer was referenced from. This only works for knowledge bases built using a website URL.


# Set AI

Uses an LLM-based AI model to generate an response based on the prompt given.

The Set AI action block is used to generate a response to the prompt supplied to it.

When using the Set AI block, the user submits a prompt, which is then either processed by the AI Studio or the LLM model to generate a response. This response is then stored in a variable

Swiftsell uses OpenAI GPT APIs to generate a response.

Process in which the Set AI works,

1. A prompt is supplied
2. AI generates the response
3. The response is stored in a variable

### Step 1: Define the prompt/instruction <a href="#step-1-define-the-prompt-instruction" id="step-1-define-the-prompt-instruction"></a>

LLM models require guidance to be able to generate a relevant and accurate answer. There are some tools you can use to guide your AI; they are:

#### Instructions/Prompt <a href="#instructions-prompt" id="instructions-prompt"></a>

A prompt is an instruction that helps the LLM know what to remember and follow while generating an answer.

The more clear, concise, and brief your instruction, the more accurate your answers will be from the AI.

Things to write in your prompt:

* **Objective** - What is its objective
* **Output format** - Typically would be HTML/markdown.
* **Writing style** - How should the answers be written?
* **Don'ts** - Clear instructions of what to avoid.
* **Examples** - Examples of question and answer.

An example prompt could be:

> Given the ‘user’s question’: “\[QUESTION]”
>
> And the detailed information provided in ‘chunks’: “\[CHUNKS]”
>
> Determine, whether a clarifying question is required.
>
> Instructions:
>
> 1\. Analyse the 'chunks' and the 'user's question' to identify the specificity of the query and the scope of the information in 'chunks'.
>
> 2\. If the query is broad and the 'chunks' have multiple categories or types, output '#' and guide the chatbot to ask for clarification.
>
> 3\. If the query aligns well with a specific part of the 'chunks' that provides a comprehensive answer, output '\~'.
>
> Output format: \[Decision: '\~' or '#', (if '#') then clarification is required. If '#' also, 'specify the type of information or category that would help better address their question. This should be based on 'chunks'.
>
> Important: if the user's question is likely to have a device specific answer, then you should ask for more information.
>
> If the user has given a device, then we don't need to clarify.

### Step 2: Store the response in a variable <a href="#step-2-store-the-response-in-a-variable" id="step-2-store-the-response-in-a-variable"></a>

The AI would process the instruction/prompt and generate a response. To get an ideal response, make sure you include in the instructions what kind of response you want to receive.

Choose the variable you want to store the response in.

For example, if you want to check if the user has asked for a follow-up question, you can write the instructions:

> Examine the user's last utterance:
>
> "\[LAST INPUT]"
>
> Determine if the user has asked a follow-up question by looking for:
>
> \- Interrogative words (who, what, where, when, why, how, etc.)
>
> \- Phrases that indicate a desire for additional information (e.g., "I would like to know", "Can you tell me about", "I'm interested in", "Could you explain")
>
> \- Continuation phrases or conjunctions that introduce new topics or questions (e.g., "but", "however", "also", "in addition")
>
> \- Output '1' if any of these indicators suggest a follow-up question is present.
>
> \- Output '0' if no follow-up question is detected.
>
> \[Note: Only output '1' or '0' based on this analysis.]


# Send an Email

This action block of Swiftsell allows you to get notified over email when any particular action in bot is performed.

### When should you use it?&#x20;

* When the lead is generated&#x20;
* When the visitor has entered their details
* When a conversation has been completed&#x20;
* When a conversation has reached a particular point

### How do I set it up?&#x20;

To set the 'Send Email' action block, you can follow the following steps;&#x20;

* Add action block on canvas by clicking on '+' <br>
* Choose 'Send an Email' <br>
* Configure the following on the right panel<br>
  * **Send an email to:** \
    \
    Define the email IDs of the users who need to be notified via email<br>
    1. **To:** <br>
    2. **CC:** <br>
    3. **BCC:** <br>
  * **Subject:** \
    \
    Define the subject of the email <br>
  * **Email Markup:** \
    \
    Define the content of the email<br>
  * **Include Chat Transcript:** \
    \
    You can switch on 'Include Chat Transcript' if you would like to receive the entire chat transcript over email


# List

Renders a list of items grouped by categories on a drawer.

{% hint style="info" %}
This feature is only supported on the **WhatsApp channel** for the following WA API providers: 360Dialog, Meta, and GupShup.
{% endhint %}

This action block is used for a rich approach of allowing users to choose from a list of options. Mostly used as an alternative to the '[Option](broken://pages/T4ARPqGMJFF56MTWy4pK)' action block, as it is not user-friendly and prone to users from the users.

<figure><img src="https://2580337444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2F3s5epgwFg7NxEh9Qe6vr%2FGroup%201.png?alt=media&#x26;token=40192a0e-16c2-4cb2-a63b-6398a56c1e22" alt=""><figcaption><p>Preview of list on WhatsApp </p></figcaption></figure>

## Configurations on the action block

### Header

Shows the text entered in a bold format -- making it look like a title.

### Body

The text will be the question associated with showing the list of options.&#x20;

### Footer

An optional field where a help text is entered. Mostly a disclaimer, visualized in a grey color.

### Button name

Along with the above, there will be a button that is displayed, on click of which will we show the list of options in a drawer format.&#x20;

Here you can write the name of the button like 'Choose', 'Select' etc.

### Items & Categories

All the items that are to be displayed in the list are defined here. Each item contains the following information that can be entered,

* **Item name** - Name of the item
* **Item description** - A short description of the item
* **Category** - List of all categories created

{% hint style="info" %}
A maximum of **10** items and categories can be created.
{% endhint %}

### Variable

Users can store the value of the selected list item in a variable for future reference.

([Refer to this article to learn more about variables](broken://pages/yoQeaanOi6YcYGlLVEoj))

### Track links

Enabling this option will create short URLs for all the URLs mentioned in this action block.&#x20;

([Refer to this article](broken://pages/fXXTtx6OkxSObuZTFSuj))

{% hint style="warning" %}
This will only work if **Link tracking** is enabled in your account settings.
{% endhint %}


# Human Handover

This action block is used when you want to invoke a human handover action at some point in the conversation flow thereby transferring the control of the chat from the bot to an agent

### When I should use it?&#x20;

* Transferring the chat to a human agent
* Involving your support team when questions are not answered by the bot

### How do I set it up?&#x20;

You can follow the following steps to set up the Human Handover action block;&#x20;

* Add an action block on Canvas by clicking on '**+**' <br>
* Choose '**Human Handover**' <br>
* Configure it on the right panel<br>

  * **Transfer conversation to:** \
    \
    Select the team to whom the conversation needs to be transferred to\
    \
    [<mark style="background-color:yellow;">Click here</mark>](broken://pages/koBmYyGM62x9WMepjlVq) <mark style="background-color:yellow;">to learn more about managing a team in Swiftsell</mark><br>
  * **Success Message:** \
    \
    The message configured here will be sent to the visitors when Human Handover is successfully invoked<br>
  * **Disabled Message:**\
    \
    The message configured here will be sent to the visitor when Human Handover is disabled\
    \
    [<mark style="background-color:yellow;">Click here</mark>](broken://pages/GunpI8UGdwKdxXMue3pV) <mark style="background-color:yellow;">to learn about Human Handover configuration</mark><br>
  * **No agent is available:** \
    \
    The message configured here will be sent to the visitors when all the agents are either occupied or not available \
    \
    [<mark style="background-color:yellow;">Click here</mark>](broken://pages/fyrB0y8VHtsbhHUOImJy) <mark style="background-color:yellow;">to learn more about managing the availability of agents</mark><br>
  * **Beyond operational hours:** \
    \
    The message configured here will be sent to the visitors when the Human Handover is invoked beyond operational hours

{% hint style="info" %}
When Human Handover is triggered, the assigned user will receive a browser notification to let them know that a conversation has been assigned to them\
\
If 'Auto Assign' is enabled for Human Handover, then the conversation will be automatically assigned to an available agent, or else the conversation will be placed in the 'Unassigned' tab\
\
Once the conversation is assigned to the agent, the same cannot be re-assigned back to the bot
{% endhint %}

### What are the scenarios in which Human Handover can fail?&#x20;

* When Human Handover is disabled
* When there are no agents available&#x20;
* When Human Handover occurs beyond operational hours


# Dynamic Data

Dynamically renders the list of options by storing the response of an API call

For use cases, that require the list of options to be fetched from an API call (meaning the list being unique to each visitor), you would be using the Dynamic data action block.

Using this block, you can dynamically display list items for,

* Button
* Carousel
* Option (WhatsApp and SMS)
* List (WhatsApp)
* Reply button (WhatsApp)

### Step 1: Store the response in a variable

The API response which contains the list of items needs to be stored in a variable. You would do this using the Service call action block.

{% hint style="info" %}
Make sure you store the entire payload response in a variable. To do this, do not append anything after the result on the object path.
{% endhint %}

### Step 2: Setup the Dynamic data action block

Add the 'Dynamic data' action block after the service call block, and configure the details.

#### Data variable

Contains the entire payload response received from the API. In our example, it is the `response` variable.

#### Block to generate

Choose the action block that you would like to generate. Dynamic data supports the following action blocks,

* Button
* Carousel
* Option (WhatsApp and SMS)
* List (WhatsApp)
* Reply button (WhatsApp)

#### Question

Configure the block for the question i.e. what question is to be shown while displaying the list items.

#### Configuring list items

Depending on which action block you have chosen, you would then map the object paths of the data you want to show for that action block.&#x20;

For example, if the payload response stored is the following,

```json
[
    {
        "product_id": "123",
        "status": "pending"
    },
    {
        "product_id": "456",
        "status": "delivered"
    },
    {
        "product_id": "798",
        "status": "pending"
    }
]
```

And if we want to render the product\_id from this list as a button, we would configure the object path as follows:

`result[*].product_id`

Where \[\*] denotes that we need to display all occurrences of the field **product\_id**.


# Javascript

Executes a javascript code on the client side.

Javascript is a piece of code that can be run on the browser to perform an action. Some of the cases where a Javascript action block can be used are:

* Performing maths calculations.
* Dynamically rendering the values of the variables.
* String modification.
* Firing & tracking events in Google Analytics.

You can choose to run the Javascript code either on **CLIENT / SERVER**.

### Maths Calculations: <a href="#maths-calculations" id="maths-calculations"></a>

Here are a few of the snippets that you can use to perform the maths calculations within the chatbot flow:

| Parameter                 | Snippet                                | Description                                                                                                                                                         |
| ------------------------- | -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Summation (Addition)      | *const additionResult = num1 + num2;*  | <ul><li>Num 1 & Num 2 can be any number or variable which has a number stored in it</li><li>The result will be stored in <em>additionResult</em> variable</li></ul> |
| Subtraction (Minus)       | *const additionResult = num1 - num2;*  | <ul><li>Num 1 & Num 2 can be any number or variable which has a number stored in it</li><li>The result will be stored in <em>additionResult</em> variable</li></ul> |
| Division (Divide)         | *const additionResult = num1 / num2;*  | <ul><li>Num 1 & Num 2 can be any number or variable which has a number stored in it</li><li>The result will be stored in <em>additionResult</em> variable</li></ul> |
| Multiplication (Multiple) | *const additionResult = num1 \* num2;* | <ul><li>Num 1 & Num 2 can be any number or variable which has a number stored in it</li><li>The result will be stored in <em>additionResult</em> variable</li></ul> |

### Rendering values into variables: <a href="#rendering-values-into-variables" id="rendering-values-into-variables"></a>

Here are few of the snippets that you can use to render values in variables.

| Parameter                   | Snippet                                                           | Example                                         |
| --------------------------- | ----------------------------------------------------------------- | ----------------------------------------------- |
| Set Variable (Conversation) | *wn.setConversationVariable(“variable\_name”,”variable\_value”);* | *wn.setConversationVariable(“name\_wn”,”ABC”);* |
| Set Variable (Contact)      | *wn.setContactVariable(“variable\_name”,”variable\_value”);*      | *wn.setContactVariable(“name\_wn”,”ABC”);*      |

### String Modification: <a href="#string-modification" id="string-modification"></a>

Here are few of the snippets that you can use to calculate the length of the variable or get part of the variable.

| Parameter            | Snippet                                             | Example                                                                                                                                                                                                                                                                                                          |
| -------------------- | --------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Length of String     | *const lengthOfString = “variable\_name”.length();* | <p><em>const lengthOfString = “some\_string\_content”.length();</em></p><p><em><strong>//Output: 19</strong></em></p><p>Calculates the number of characters passed/present in the value</p>                                                                                                                      |
| Get part of a string | *const partOfString = “variable\_name”.slice();*    | <p><em>const partOfString = “some\_string\_content”.slice(5);</em></p><p><strong>Note: We need to pass the starting index from where we need to get the sub-string. The index starts from 0.</strong> <strong>//Output: string\_content</strong> Commonly used to pass the phone number without country code</p> |

### Firing & Tracking events in Google Analytics or any Analytics tool: <a href="#firing-and-tracking-events-in-google-analytics-or-any-analytics-tool" id="firing-and-tracking-events-in-google-analytics-or-any-analytics-tool"></a>

Here is the snippet that you can use to push or record events into Google Analytics or any other analytics tool

| Tool               | Snippet                                      | Example |                                                                                                                                                                                                                                                                                                                                                                                                        |                                          |   |                                                                                                                                                                                                                                                                            |
| ------------------ | -------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------- | - | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Google Analytics 4 | <p><em>window\.dataLayer = window\.dataLayer |         | \[];</em></p><p><em>function gtag() {</em></p><p><em>window\.dataLayer.push(arguments);</em></p><p><em>}</em></p><p><em>gtag("js", new Date());</em></p><p><em>gtag("config", "YOUR-MEASUREMENT-ID");</em></p><p><em>gtag("event", "YOUR-EVENT-NAME", {</em></p><p><em>"send\_to": "YOUR-MEASUREMENT-ID"</em></p><p><em>// Additional parameters that you may want to pass</em></p><p><em>});</em></p> | <p>window\.dataLayer = window\.dataLayer |   | \[];</p><p>function gtag() {</p><p>window\.dataLayer.push(arguments);</p><p>}</p><p>gtag("js", new Date());</p><p>gtag("config", "123");</p><p>gtag("event", "Swiftsell\_Test", {</p><p>"send\_to": "123",</p><p>"name": "Test",</p><p>"phone": "123456789",</p><p>});</p> |

### Triggering day-based flow: <a href="#triggering-day-based-flow" id="triggering-day-based-flow"></a>

Here is the snippet that you can use to trigger the flow based on a specific day

| Parameter                                    | Snippet                                                                                                                                                                                                                              | Description                                     |
| -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------- |
| Get current date                             | *const currentDate = new Date();*                                                                                                                                                                                                    | Helps to get the today’s date                   |
| Check if Fromdate should be more than Todate | <p><em>isFromDateBeforeToDate(fromDate, toDate) {</em></p><p><em>const fromDateObj = new Date(fromDate);</em></p><p><em>const toDateObj = new Date(toDate);</em></p><p><em>return fromDateObj < toDateObj;</em></p><p><em>}</em></p> | Helps to trigger the flow the day specific flow |


# Form

Action block provides the easiest way of collecting multiple inputs from your visitors

In scenarios, where you are looking to collect multiple inputs like name, email, or phone to confirm the appointment, rather than making the conversation lengthy by using multiple collect input blocks to collect each value, you can make use of a form that collects everything at once.&#x20;

### When should I use it?&#x20;

* You are collecting multiple inputs&#x20;
* Want to keep the chat short and quick
* Reduce the number of to and fros

### How do I set it up?&#x20;

You can follow the following steps to set up the '**Form**' action block;&#x20;

* Add an action block on Canvas by clicking on '**+**' <br>
* Choose '**Form**' <br>
* Double-click on '**Form**' to configure it on the right panel<br>
  * **Message:** \
    \
    The message configured here will be sent to the visitors when the 'Form' action block is triggered along with the form fields<br>
  * **Add fields to capture individual input:**<br>

    1. **Name:** \
       \
       Enter the name of the field. This is what the visitors will see<br>
    2. **Validation Method:** \
       \
       Select the validation method i.e text, name, email, phone, or custom<br>
    3. **Define Variable:** \
       \
       Give a name to the variable in which the answers to this field will be stored

    \ <mark style="background-color:yellow;">You can click on '</mark><mark style="background-color:yellow;">**+ Form Field**</mark><mark style="background-color:yellow;">' to add more fields and repeat the above step to configure it.</mark>&#x20;

{% hint style="warning" %}
You can add a maximum of up to 5 fields\
\
You can have some fields as 'Optional' so that the visitors can still move forward in the conversation if it is not filled
{% endhint %}


# Flow

Action block allows you to break down larger chatbot flows into smaller manageable chunks

### How does it help?&#x20;

* Creating smaller manageable flows for each path
* Easier navigation between conversational flow
* Easier onboarding of teams to the chatbot

### How do I set it up?&#x20;

You can follow the following steps to set up the '**Flow**' action block;&#x20;

* Add an action block on Canvas by clicking on '**+**' <br>
* Choose '**Flow**' <br>
* Enter '**Flow**' \
  \
  Double-click on '**Flow**' to enter or single-click on it and then click '**Enter**' on the right panel<br>
* Build the flow on the canvas

Once you enter the '**Flow**', it will look similar to '**Bot Builder**'. You can continue building your chatbot flow here in the flow just by clicking on '**+**' as you would otherwise.

To navigate between the '**Root Flow**' and other created flows, you can just click on the name of the flow or the '**Home**' button visible on the top left corner of the '**canvas**' &#x20;

{% hint style="info" %}
You can create as many '**Flows**' as you want&#x20;
{% endhint %}


# Options

Options allow the conversation flow to be branched into various paths based on user input

{% hint style="info" %}
Most commonly used on SMS and WhatsApp channels.
{% endhint %}

Option block is used when a selection from a list of items is to be made. The action block would render the list of options as follows:

<figure><img src="https://2580337444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2FOs9vwHtqFzf9iynww1xo%2FCleanShot%202023-08-23%20at%2017.40.10%402x.png?alt=media&#x26;token=4f5302b8-0dbd-425b-8928-7ee546c26c58" alt=""><figcaption><p>View of how options will be visible</p></figcaption></figure>

As the list of options is displayed with numbers i.e. 1, 2, 3, etc. it is best suited for channels like WhatsApp and SMS.

## Configurations on the action block:

### Message

This is the question the bot would ask while presenting the list of options.&#x20;

### List of options

The list of options that are to be shown will be defined here.&#x20;

You can have up to **10 options** in one action block. In case you need more you can nest 'Option' blocks together.&#x20;

Users can select from options by typing the following,&#x20;

* The numeric digit i.e. 1, 2, 3...
* Alphabetic name i.e. one, two, three...&#x20;
* Value of the option itself i.e. Blue, Green, etc.

### Error message

When submitting a selection from the list of options, if any input does not match the list, this error message will be shown along with the list of options.&#x20;

The user will have to retry by entering a valid number.

### Variable

Users can store the value of the selected option in a variable for future reference.&#x20;

For example, if I choose 2 from the above image, 'Yellow' would be stored on the variable.

### Hot keywords

You can define hot keywords that bring the user to this action block, wherever they are in the conversation flow.&#x20;

{% hint style="info" %}
You can define more than 1 hot keywords
{% endhint %}

### Track links

Enabling this option will create short URLs for all the URLs mentioned in this action block.&#x20;

([Refer to this article](broken://pages/fXXTtx6OkxSObuZTFSuj))

{% hint style="warning" %}
This will only work if **Link tracking** is enabled in your account settings.
{% endhint %}


# Calendar

Calendar action block is used for collecting date from the or for booking appointments

### When should you use this?&#x20;

* Collecting a date from the visitor
* Booking appointments&#x20;

### How do I set it up?&#x20;

To set up the 'Calendar' action block, you can follow the following steps;&#x20;

* Add action block on canvas by clicking on '+' <br>
* Choose 'Calendar' <br>
* Configure the following on the right panel<br>
  * **Date Selection:** \
    \
    Configure the following under 'Date Selection' in the configuration message;<br>
    1. **Show Message:** \
       \
       You can set the message that you would like to send to the visitors along with the calendar to book the appointment<br>
    2. **Define Variable:** \
       \
       Define the variable in which the response of the visitors will be stored <br>
    3. **Date Selection:** \
       \
       Select the nature of the date selection from available options. You can enable 'Show Past Dates' to show the visitors' past dates<br>
  * **Exclude Dates:** \
    \
    Select the 'Exclude Dates' tab and define any exclusion of dates that you don't want to be visible in the calendar UI. You can exclude dates by either; <br>
    * Selecting the days all together like Saturdays, Sundays, etc. This way all of these will not be selectable to the visitor. <br>
    * Selecting special dates like Christmas, Diwali, EID, etc.&#x20;


# Slider

Action block provides interactive way to the visitors to choose a value from a visual slider

### When should I use it?&#x20;

* Values are to be selected from a range of finite values
* To make the conversation more interactive

### How do I set it up?&#x20;

You can follow the following steps to set up the Slider action block;&#x20;

* Add an action block on Canvas by clicking on '+' <br>
* Choose 'Slider' <br>
* Double-click on the 'Slider' block to configure it on the right panel<br>
  * **Ask a question:** \
    \
    Write down the question that you want to ask your visitors<br>
  * **Range:** \
    \
    Enter the range values (Minimum to Maximum) that you want to allow the visitors to choose from<br>
  * **Define Variables:** \
    \
    You can define the variables to save the response received from the visitor<br>
  * **Step Count:** \
    \
    You can enable step count by switching on the switch. Enabling this will move the slider in the increments of the step count\
    \ <mark style="background-color:yellow;">The value for the step count can be between 2 & 5</mark><br>
  * **Units:** \
    \
    Select a unit for the slider values from the drop-down list i.e $, ‎€, ₹, £, °C. By default, we do not have any unit assigned to the slider


# Image Carousel

Action block is used to display one or more images in a carousel to make it easier for the visitors to browse through

### When should you use it?&#x20;

This is usually used when you just want to show a set of images in a card, not requiring any input to move forward for instance;&#x20;

* Displaying a set of products or services
* Gallery of images

### How do I set it up?&#x20;

You can follow the following steps to set up the Image Carousel action block;&#x20;

1. Add an action block to the canvas by clicking on '**+**' <br>
2. Choose '**Image Carousel**'\
   &#x20;
3. Configure it on the right panel<br>
   * **Upload Image:** \
     \
     You can add the image/photo of your choice that you would like to display it to the visitors by clicking on '**Upload Image**' <br>
   * **Add more images:** \
     \
     To add multiple images, you can click on '**Add Image**'. The maximum images that you can add is 10&#x20;

{% hint style="info" %}
We recommend you upload compressed images (up to 5 MB) to improve the load time of the images on the chat widget\
\
The file extension that we support are '**.jpg**', '.**JPEG'**, '.**PNG**'
{% endhint %}


# WhatsApp Flow

WhatsApp Flows is a way to build structured interactions for business messaging. With Flows, businesses can define, configure, and customize messages with rich interactions that give customers more structure in their communication.

[Learn more about flows](https://developers.facebook.com/docs/whatsapp/flows/)

<figure><img src="https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252FPtk9H2B12qDJgo3XdNpc%252Fimage.png%3Falt%3Dmedia%26token%3Dd708e112-2420-4fc1-a880-5c1eb4ac66dc&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=421ae981&#x26;sv=1" alt=""><figcaption></figcaption></figure>

To configure the Whatsapp flow action block:

### Step 1: Create a template <a href="#step-1-create-a-template" id="step-1-create-a-template"></a>

To initiate a WhatsApp flow, you must first create a flow on your Facebook account.

* Go to your **Facebook Business settings** → **WhatsApp Manager**, or click [**here**](https://business.facebook.com/wa/manage).
* Under Account tools → Select **Message Templates**.

This will allow us to use the drag-and-drop builder to create our WhatsApp Flow. You won’t have to submit a template at the end of this guide — we’re just using this to access the drag-and-drop Flow builder.

<figure><img src="https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252FLw1ASRM2ND359QqVixwK%252F1.jpg%3Falt%3Dmedia%26token%3Dd49e01dc-37a9-434b-8f97-1ec3879b45b3&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=596e3c1d&#x26;sv=1" alt=""><figcaption></figcaption></figure>

* Select **Create Template**.

<figure><img src="https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252FxDr6U3812g5X3f8zTRay%252F2.jpg%3Falt%3Dmedia%26token%3D102c9027-99ab-450a-ae6f-8041f9dd553b&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=3db2fea&#x26;sv=1" alt=""><figcaption></figcaption></figure>

* Choose the category of the flow

<figure><img src="https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252Fc5rKZJ2jY8CZaGPAAhjB%252F3.jpg%3Falt%3Dmedia%26token%3Db7bd4a1d-1559-47f6-87fb-02285ac0e83c&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=ee7ecb2f&#x26;sv=1" alt=""><figcaption></figcaption></figure>

* Customize your flow details using the drag-and-drop builder for WhatsApp flows.

<figure><img src="https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252FMudCnzZnzQtLqIfypq4f%252F7.jpg%3Falt%3Dmedia%26token%3Db5bdf722-7ab1-4c65-a08a-649a7fe5f2da&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=80bc5364&#x26;sv=1" alt=""><figcaption></figcaption></figure>

* You can add multiple screens as part of one flow by clicking on **+ Add new** on the left and giving your screen a name.

<figure><img src="https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252F44uR9jdsMUfk759MEsGp%252F8.jpg%3Falt%3Dmedia%26token%3Dc7994c8d-8809-4693-a972-8fb8f8b8a50c&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=f712ec67&#x26;sv=1" alt=""><figcaption></figcaption></figure>

* Customize your flow screen by editing the components you add. You can choose to add radio, input, text input, dropdown, date picker, [and many more](https://developers.facebook.com/docs/whatsapp/flows/reference/flowjson/components/).

<figure><img src="https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252Fe0Qihfl5EZRRcw5oWXya%252F10.jpg%3Falt%3Dmedia%26token%3D86e71c38-769c-4274-88f0-6021b44d0c88&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=fd2cfcfa&#x26;sv=1" alt=""><figcaption></figcaption></figure>

* When you’re done, click **Save**:

<figure><img src="https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252Foo3CcJu4WkDFbgieGXZE%252F11.jpg%3Falt%3Dmedia%26token%3D34e73e40-4174-498c-9db1-2e928b3c5269&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=5dd4391e&#x26;sv=1" alt=""><figcaption></figcaption></figure>

Your WhatsApp flow is now created and you can find it in the WhatsApp manager menu -> Account tools, select Flows:

<figure><img src="https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252FZ4IM0ThmIUeiJeA9mGD9%252Fimage.png%3Falt%3Dmedia%26token%3Dba5a6f58-d64a-4ffd-a352-938130c40920&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=54f17eba&#x26;sv=1" alt=""><figcaption></figcaption></figure>

#### Restrictions <a href="#restrictions" id="restrictions"></a>

* You can add up to 8 components on every screen. A multiple-choice question is considered one component, regardless of the number of choices.
* The maximum number of screens per WhatsApp Flow is also 8.

### Step 2: Setup the "WhatsApp flow" action block <a href="#step-2-setup-the-whatsapp-flow-action-block" id="step-2-setup-the-whatsapp-flow-action-block"></a>

Add the "WhatsApp flow" action block on the bot builder and configure it.

**Header**

Shows the text in a bold format -- making it look like a title. It is an optional field.

**Body**

The text will be the question associated with showing the list of options.

For example, "Select the service you are interested in".

**Footer**

The text is displayed in a small grey color format. Mostly used to display a disclaimer to the user when selecting the option from the list.

**Button name**

Along with the above, a button will be displayed, on click of which we will show the list of options in a drawer format.

You can write the button's name here, such as 'Choose', 'Select', etc.

**Error message**

If the user types a random text instead of clicking the button, this error message will be sent.

### Step 3: Select and setup the WhatsApp flow <a href="#step-3-select-and-setup-the-whatsapp-flow" id="step-3-select-and-setup-the-whatsapp-flow"></a>

* Choose the flow from the dropdown
* And the starting screen you want to launch when the flow is executed.

<figure><img src="https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252FBfdzJEjOm4fJXcrs2StD%252FCleanShot%25202024-07-29%2520at%252016.19.25.png%3Falt%3Dmedia%26token%3Dc7ea8a01-2a39-405d-b8a8-d4fb5253c0d2&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=8ba989e2&#x26;sv=1" alt=""><figcaption></figcaption></figure>

We will show the flows in the dropdown that are fetched from the phone number that you have connected for that bot on the "**Trigger**" action block.

* Next, select the data that you want to send from Swiftsell to the WhatsApp flow
* Map the fields fetched from the flow with the values/variables that you want to send

This is done to make the flow dynamic and contextual to the user's interactions.

### Step 4: Store the responses into variables <a href="#step-4-store-the-responses-into-variables" id="step-4-store-the-responses-into-variables"></a>

After the flow is executed and the user has completed interacting with it, choose the results that you want to store into variables for further use in the chat flow.

This could be things like dropdown selected, input added etc.

Map the response path with the variable that you want to store it in.

<figure><img src="https://help.wotnot.io/~gitbook/image?url=https%3A%2F%2F360969599-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FsrMxU8nO3RjusUiYuXBB%252Fuploads%252FLMtuAXIRIASZmguVy8Ws%252FCleanShot%25202024-07-29%2520at%252016.20.56.png%3Falt%3Dmedia%26token%3D7bbdb326-7222-4d90-94f1-68f0c1cc0c8e&#x26;width=768&#x26;dpr=2&#x26;quality=100&#x26;sign=bea17b5a&#x26;sv=1" alt=""><figcaption></figcaption></figure>


# Branch

Branch action block allows you to move to different path of the conversation flow on the basis of conditions defined

With the help of a Branch action block, you can create multiple branches based on certain conditions, which have their separate conversational flows.&#x20;

### Use case scenario:&#x20;

Following are a few of the scenarios in which the branch action block can be used:&#x20;

* Let's say you want to separate the flows for visitors speaking from developed countries vs developing countries<br>
* When you want to branch out the flow based on a keyword or phrase that the visitor has provided

### What are operators?&#x20;

Operators are constructs that behave like functions and are used for comparison and logical conditions. Using operators in the branch action block allows you to compare the defined values with variables and accordingly navigate your visitors through the flow.&#x20;

### Type of operators:&#x20;

There are various types of operators that Swiftsell supports, they are;&#x20;

|     Operator     |                                            Description                                           |                Example                |
| :--------------: | :----------------------------------------------------------------------------------------------: | :-----------------------------------: |
|     Equals To    |       Commonly used when you want to match the value of the variable with the defined value      |   "City" '**Equals To**' "New York"   |
|   Not Equals To  | Commonly used when you don't want the value of the variable to be matched with the defined value | "City" '**Not Equals To**' "New York" |
|     Contains     |               Commonly used when you want the variable to contain the defined value              |       "URL" '**Contains**' "Web"      |
| Does Not Contain |           Commonly used when you do not want the variable to contain the defined value           |   "URL" '**Does Not Contain**' "Web"  |
|     Is Empty     |            You can use this operator to identify whether the variable is empty or not            |         "Phone" is '**Empty**'        |
|   Is Not Empty   |                  You can use this operator to ensure that variable is not empty                  |       "Name" is '**Not Empty**'       |

### How do I set it up?&#x20;

You can follow the following steps to set up the branch action block;&#x20;

1. Add action block on canvas by clicking on '**+**' <br>
2. Choose '**Branch**' <br>
3. Configure it on the right panel<br>
   * **Add a Branch:** \
     \
     You can add multiple branches by clicking on '**+ Branch**'. The maximum number of branches that you can add is 10 <br>
   * **Define the condition:** \
     \
     Click on the branch to open the configuration window. You can configure the following once the panel opens up; <br>
     1. **Variable:** \
        \
        Click on 'Variable' to open the drop-down list of the defined variables and select the variable as per your preference<br>
     2. **Operator:** \
        \
        Click on 'Operator' to open the drop-down list of supported operators and select it as per your preference<br>
     3. **Value:** \
        \
        Define the value with which the variable value will be compared. Here you can enter multiple values by hitting enter and they will be displayed as chip<br>
   * Choose '**Any/All**' condition: \
     \
     You can select either of the conditions from Any or All\
     \
     **Any:** The system will route the visitors through this branch if any of the condition is met or holds true\
     \
     **All:** The system will route the visitors through this branch if all the conditions are met or hold true


# File Upload

This action block is used when you would like your visitors to submit documents or files through bot.

### In what formats can the file be uploaded?&#x20;

* .pdf
* .jpg
* .png
* .doc
* .docx
* .ppt
* .xsl
* .xlsx
* .csv

{% hint style="warning" %}
The maximum size of the file supported is 10 MB\
\
The maximum number of uploads allowed is up to 10&#x20;
{% endhint %}

### How do I set it up?&#x20;

You can follow the following steps to set up the 'File Upload' action block;&#x20;

* Add an action block on Canvas by clicking on '**+**'<br>
* Choose '**File Upload**' <br>
* Double-click on '**File Upload**' to configure it on the right panel<br>
  * **Message:** \
    \
    Define the message or question that will appear to your visitors before collecting the file.<br>
  * **Type of File:**\
    \
    Select the type of file that you want to limit the visitors to upload. This will restrict the bot from accepting the files of the format that are not selected by you.\
    &#x20;
  * **Define Variable:**\
    \
    Configure the variable where you would like the file to be uploaded or stored. This will allow you to share the link of the file uploaded by the visitor later in the flow. <br>
  * **File Size:** \
    \
    Set the limit of the file size that the visitor can upload. The maximum size supported is 10 MB. Other sizes that you can choose are 1, 2 & 5 MB. To change the maximum size of the file, you will need to click on the 'Drop down arrow' & select from the available options. <br>
  * **Upload Limit:** \
    \
    Set the upload limit i.e the number of times visitors can upload a file. Maximum number of uploads allowed per visitor is 10. The other available options are 1, 2 & 5. To change the upload limit, you will need to click on the 'Drop down arrow' & select from the available options.&#x20;


# Building a GPT chatbot

GPT chatbots are smart bots that answer questions from a data source.

GPT chatbots are all the rage these days, thanks to ChatGPT.

ChatGPT has opened a new way of asking questions and getting answers – that are accurate, brief, and quick.

Here are the steps to build your own GPT chatbot:

As an example, we are going to build a GPT chatbot for the website <https://swiftsell.biz/> and answer user's questions. If the bot does not know the answer, we will share the customer support details.

### Step 1: Creating a knowledge base <a href="#step-1-creating-a-knowledge-base" id="step-1-creating-a-knowledge-base"></a>

The fundamental of a GPT chatbot is creating a knowledge base that is trained with the information you want it to answer from.

As we want to answer questions from the website <https://swiftsell.biz/>, let’s build the knowledge base.

* Go to AI Studio > Add Knowledge base > Add data source
* Choose URL as the data source
* Enter the domain <https://swiftsell.biz/>
* Hit 'Train' and wait until all URL(s) are being fetched

### Step 2: Build a bot <a href="#step-2-build-a-bot" id="step-2-build-a-bot"></a>

Next, we need to build a bot that will speak with the visitor and use this knowledge base to fetch the answers to questions asked.

Go to Bot Builder > Build a bot > Inbound > Web

### Step 3: Adding the Answer AI action block <a href="#step-3-adding-the-answer-ai-action-block" id="step-3-adding-the-answer-ai-action-block"></a>

After the trigger action block, we will add the 'Answer AI' action block.

* Add a welcome question like “Hey there! What can I help you with today?”
* Choose the “Knowledge base” we created

Also, we will configure the 'Answer AI' block as per our needs. For this example, I will use the following:

**Instructions**:

Instructions guide the AI on how you want the answer to be generated. Write a clear and concise instruction.

“I want you to act as a support agent. Your name is "AI Assistant". You will provide me with answers from the given info. If the answer is not included, say exactly "Hmm, I am not sure." and stop after that. Refuse to answer any question not about the info. Never break character.”

All other advanced settings are kept as it is. You can choose to tweak it if needed.

### Step 4: Adding fallback measures <a href="#step-4-adding-fallback-measures" id="step-4-adding-fallback-measures"></a>

Not always will the AI answer your question. Primarily, because it may not have all the data to answer it, or the question is quite vague to generate an answer.

In any case, it is important to always define fallback measures to help users get assistance.

In this example, after the AI generates the answer, we will try to seek acknowledgment from the user whether this answer helped or not.

Click on the success path and add “Add another block”.

Here we will add a button block with the message “Did this answer your question?” with the following options:

* Yes - Ends the flow with a thank you message “Glad we could help!”
* No - Apologise and share support details like “Sorry we couldn’t answer your question. Feel free to reach out to us at [support@swiftsell.biz](mailto:undefined) for assistance.”

This way, the user always has a secondary way of getting the answer if the GPT fails. You can even extend the failure flow to collect details of their problems and create a ticket in your support systems or notify your team via email.


# Knowledge base

Source of information used by AI to answer your questions.

To use AI to generate answers, you need to first build a knowledge base with the information you want the answer from.

A knowledge base is nothing but a collection of data sources.

### Data source types <a href="#data-source-types" id="data-source-types"></a>

A data source can be one of three types:

* URL
* File
* Text

#### URL <a href="#url" id="url"></a>

You can add content using a domain or a set of web pages.

**When using a domain**, you simply enter the domain address or sitemap address, and our system will automatically import all URL(s) of that domain.

**Supported types:**

* Domain i.e. <https://www.swiftsell.biz/>

As good practice, it is always better to delete the URLs that are not needed to avoid wrong or incorrect answers from the bot. Because, the more junk you add, the more confused the AI gets.

**When using webpages**, you explicitly list down the exact URL(s) you want to import content from.

#### File <a href="#file" id="file"></a>

You can add content and upload a set of documents to your knowledge base.

Upload one or files and click 'Train' to start training your knowledge base with the contents of those files.

**Supported file types:**

* csv
* xlsx
* txt
* pdf
* doc
* docx

Max file size supported is 5 MB.

#### Text <a href="#text" id="text"></a>

You can also directly add the information as content to the knowledge base.

By choosing this data source method, you can copy-paste the content you want to add.

A maximum of 2,500 characters is allowed.

### Data source details <a href="#data-source-details" id="data-source-details"></a>

You can find all the data sources added to your knowledge base in the table.

To find your data source, you can use the search bar or filter option.

On the table, you can view details like:

* Data source name
* Data source type
* Added at
* Added by
* Refresh

You can even click on each data source row to see exactly what information has been extracted from it.

Depending on the content size of a knowledge base, each data source can have more than one chunk. Each paragraph of text displayed is called a chunk.


# Custom Answers

Override AI generated responses with custom answers defined by you.

Using AI to generate responses can sometimes be **right or wrong**.

Usually, this happens because

* Your knowledge base has incorrect or duplicate information
* The prompts used are not specific/brief for the AI

To solve this problem and help you always get correct answers, we have launched **Custom Answers**.

### How it works <a href="#how-it-works" id="how-it-works"></a>

#### Step 1: Review the answers <a href="#step-1-review-the-answers" id="step-1-review-the-answers"></a>

First, you review all the questions users ask the AI on the "Custom answers" page.

* Click on AI Studio -> Custom answers and view all questions asked to the AI

Use the pre-built queues, 'Downvoted' and 'All,' to view all answers and the answers generated by the AI.

#### Step 2: Customize the answers <a href="#step-2-customize-the-answers" id="step-2-customize-the-answers"></a>

The questions you find incorrectly answered, just click on the 'Modify answer' button and override the answer.

Make sure to write at least 100 characters in your response.

Once saved, this question and the answer would be added to the knowledge base as a 'Text' source.

{% hint style="danger" %}
Make sure you do not delete these text data sources that were added automatically.

Deleting them will result in receiving the wrong answers.
{% endhint %}


# Function call

Execute functions to help your AI generate dynamic answers.

AIs were limited to answering questions from your static knowledge base.

With function calling, you can have your AI execute a Javascript function that invokes third-party APIs to generate a dynamic answer.

### Creating a function <a href="#creating-a-function" id="creating-a-function"></a>

First, we create a function from the AI Studio -> Function Call screen

<figure><img src="https://633293635-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGQT6bvyjdctMxBrViCPu%2Fuploads%2F1JP6GxeN1EBHNcPxNssv%2Ffunction_call.jpeg?alt=media&amp;token=bf54c44b-aa72-4d48-8983-232258651b3f" alt=""><figcaption></figcaption></figure>

Each function is made up of 3 things:

#### Prompt <a href="#prompt" id="prompt"></a>

A brief description that helps the AI understand what this function does.

#### Parameters <a href="#parameters" id="parameters"></a>

The list of parameters that are required for this function to be executed. The parameters need to be provided in the form of a JSON array.

#### Function handler <a href="#function-handler" id="function-handler"></a>

This is the Javascript code executed to generate the response to the question asked.

This function would generally consist of

* API endpoint that is to be invoked
* Conditions and logic to ask follow-up questions if parameters are missing

### Testing the function <a href="#testing-the-function" id="testing-the-function"></a>

On the function, click on the 'Save & Run function' to open the test window.

You can customize the LLM model used and see the response generated by it.

Also, to view the exact execution of the function, you can click the 'Show log' to view the entire log.

Here you can view the arguments detected by the function and the output generated by the function.


# Prompts

Prompt/instruction is a set of rules an AI uses to generate an answer.

By using the right prompts, we can make sure our AI chatbots are responding accurately and appropriately—and that we’re delivering more sophisticated and engaging user experiences. They're kind of like nudges in the right direction.

Some common reasons for using prompts are:

* To get a specific answer format
* Evade certain questions
* Length of the answer
* Answer structure

#### Simple prompt <a href="#simple-prompt" id="simple-prompt"></a>

Copy

```
As a chat support agent, provide a clear and concise response to the user’s question: “[QUESTION]”

Refer to the provided details: “[CHUNKS]”.

Instructions: 
- Deliver a summarized response, focusing on the key points without elaborate details.
- Limit the response to a maximum of three to four brief sentences. 
- Use bullet points to break up chunks of text where appropriate
- Never start a response with a bullet point - you should answer the question directly then show suplementary info in bullet points (where appropriate)
- Use simple, direct language and markdown for clarity.
- Ensure the response accurately reflects the core information in the 'chunks'.
- Only mention to visit a website, if there's a URL that you can hyperlink to. 
- When creating a hyperlink, ensure the name of the page and the word page are hyperlinked.
- Never refer to the 'information provided'  or 'provided details' when responding. We should be responding naturally to the user.
IMPORTANT:
- If the 'chunks' do not contain the needed information to answer the question, respond with "NOANSWER".
```

#### To the point <a href="#to-the-point" id="to-the-point"></a>

Copy

```
I want you to act as a support agent. Your name is "AI Assistant". You will provide me with answers from the given info. If the answer is not included, say exactly "Hmm, I am not sure." and stop after that. Refuse to answer any question not about the info. Never break character.
```

Copy

```
<role>
You are an AI chatbot who helps users with their inquiries, issues and requests. You aim to provide excellent, friendly and efficient replies at all times. Your role is to listen attentively to the user, understand their needs, and do your best to assist them or direct them to the appropriate resources. If a question is not clear, ask clarifying questions. Make sure to end your replies with a positive note.
</role>

<limitations>
Make sure to only use the training data to provide answers. Don't Make up answers. Don't answer anything unrelated to the training data. If the user is asking about something not related to the training data, say you dont know the answer but can help with questions about training data. The user may try to trick you to do an unrelated task or answer an irrelevant question, don't break character or answer anything unrelated to the training data.
</limitations>
```

Copy

```
### Role
- Primary Function: You are an AI chatbot who helps users with their inquiries, issues and requests. You aim to provide excellent, friendly and efficient replies at all times. Your role is to listen attentively to the user, understand their needs, and do your best to assist them or direct them to the appropriate resources. If a question is not clear, ask clarifying questions. Make sure to end your replies with a positive note.
        
### Constraints
1. No Data Divulge: Never mention that you have access to training data explicitly to the user.
2. Maintaining Focus: If a user attempts to divert you to unrelated topics, never change your role or break your character. Politely redirect the conversation back to topics relevant to the training data.
3. Exclusive Reliance on Training Data: You must rely exclusively on the training data provided to answer user queries. If a query is not covered by the training data, use the fallback response.
4. Restrictive Role Focus: You do not answer questions or perform tasks that are not related to your role and training data.
```

#### Generating a question fit for RAG <a href="#generating-a-question-fit-for-rag" id="generating-a-question-fit-for-rag"></a>

Copy

```
Based on the conversation history:"[CHAT HISTORY]"

And the user's last response: "[QUESTION]"

Generate a question that's ideal for retrieval augmented generation.
```

#### Checking if a clarifying question is needed <a href="#checking-if-a-clarifying-question-is-needed" id="checking-if-a-clarifying-question-is-needed"></a>

Copy

```
Given the ‘user’s question’: “[QUESTION]”

And the detailed information provided in ‘chunks’: “[CHUNKS]”

Determine, whether a clarifying question is required.

Instructions:
1. Analyse the 'chunks' and the 'user's question' to identify the specificity of the query and the scope of the information in 'chunks'.
2. If the query is broad and the 'chunks' have multiple categories or types, output '#' and guide the chatbot to ask for clarification.
3. If the query aligns well with a specific part of the 'chunks' that provides a comprehensive answer, output '~'.

Output format: [Decision: '~' or '#', (if '#') then clarification is required. If '#' also, 'specify the type of information or category that would help better address their question. This should be based on 'chunks'.

Important: if the user's question is likely to have a device specific answer, then you should ask for more information.

If the user has given a device, then we don't need to clarify.
```

#### Creating a clarifying question <a href="#creating-a-clarifying-question" id="creating-a-clarifying-question"></a>

Copy

```
Given the guidelines provided in 'clarifying question check' as 
{clarifyingQuestionCheck}
, the user's question stated in 
{userQuestion}
, and the information in 'chunks' as 
{chunks}
, construct a single, clear clarifying question. This question should smoothly integrate the details provided and guide the user towards a precise response. Avoid multiple or double-barreled questions. Focus on a single aspect that requires clarification for a helpful and direct answer.

//EXAMPLES//
User: What phone plans do you have with 100 GBs of data?
Bot: Are you interested in pre-paid or post-paid plans with 100 GBs of data?

User: How do I check my email?
Bot: Which device are you using to check your email, an Apple or an Android device?
//END OF EXAMPLES//

Output the question clearly and concisely, with no additional text.
```

#### Creating a follow-up question <a href="#creating-a-follow-up-question" id="creating-a-follow-up-question"></a>

Copy

```
Given the initial response 
"[ANSWER]" 
and the user's question 
"[QUESTION]”
, alongside the provided details "
[CHUNKS]
":

Instructions:
- Quickly identify a key point in the 'chunks' that relates to the initial response.
- Formulate a single, clear follow-up question about this point, like "Would you like more details about [topic]?"
- If no specific topic is identified, ask a general question like "Is there anything else I can assist you with?"
- Output this single follow-up question or engagement phrase.

Ensure the follow-up is direct and focused on one topic for clarity.
```

#### Answering from a CSV <a href="#answering-from-a-csv" id="answering-from-a-csv"></a>

Copy

```
You are Fedex support agent and helping people by providing courier rate for different countries according to weightage. 

You need to find exact rate from the context you receive. You will receive context in following format "{weight} Kg price in {country} is {price}" where {weight}, {country} and {price} will be dynamic. You have prices for 0.5 kg to 30 kgs in the context.

You need to give answer in following format, "{weight} kg rate in {country} is {price}."

If user is not providing {country} or {weight} in query, ask user to provide {country} and {weight} in following format, "{weight} kg rate in {country}".

If you don't find rate for given country and weight, tell user that "I don't have data for {given_country} and {weight}".
```


# Tokens

Tokens are nothing but a group of characters.

1 token is equal to 4 characters.

For example, the following sentence “The quick brown fox jumps over the lazy dog” has 11 tokens.

### How are tokens calculated? <a href="#how-are-tokens-calculated" id="how-are-tokens-calculated"></a>

Tokens are used by both the input (what is being sent to the AI model) and output (what is being received by the AI model).

For example, when you train an AI model with the website <https://www.swiftsell.biz/> here’s how many tokens would be consumed:

* **Training** – Total number of characters extracted from the website (Counted once, as you only train once)
* **Input tokens** – All the tokens used to send the question to OpenAI are counted here. They include:
  * **Chunks** – When a question is asked to the AI model, the system would fetch a chunk that closely matches the question.
  * **Input question** – Question asked by the user
  * **Prompt** – System prompt and the instructions defined
* **Output tokens** – Size of the response received from OpenAI

The token calculation would vary depending on the size of your AI model, how brief are your prompts/instructions, and how big are the responses from the AI model.


# Setting up retrain

Retrain allows you to retrain knowledge base at a given time interval.

Retrain allows you to train your knowledge base with the latest content on it.

You can also schedule a time interval in which the knowledge base will automatically import the content on those URLs

To enable this,

* Open AI Studio
* Open the Knowledge base
* Click on the data sources you want to schedule a retrain
* Click 'Never'
* Choose the refresh rate
  * Days
  * Hours
* Click 'Save'


# Overview

How Swiftsell integrates with third-party apps

Here are the 3 ways in which Swiftsell integrates with applications

## **Native Integrations:**&#x20;

You can find all the native integrations displayed under the 'App Market' icon on the nav bar.

## **HTTP Requests:**&#x20;

Using the Service Call action block you can invoke a REST API request to exchange information securely between applications. You can perform GET, POST, and PUT requests.

{% content-ref url="/pages/D99aeNJftpWK70x6xzKk" %}
[Service Call](/integrations/service-call)
{% endcontent-ref %}

## **Zapier:**

Our Zapier integration allows you to invoke any Zap flow that you have made.&#x20;

## Custom Integration:&#x20;

If you are not able to integrate your app using the above methods, Swiftsell can custom-develop the integration for you.&#x20;

{% hint style="info" %}
Custom developing integrations are charged on a time and material model. Send your inquiries to **<support@swiftsell.biz>**
{% endhint %}


# Events

Listen to webhook events from the Swiftsell platform.

{% hint style="info" %}
This feature is part of the 'Enterprise' plan
{% endhint %}

Enabling the events will give you access to define your webhook endpoint which will receive all the subscribed events.&#x20;

<figure><img src="https://633293635-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FGQT6bvyjdctMxBrViCPu%2Fuploads%2Fxmg6U0NFMoA23BYyROpS%2FScreenshot%202024-01-08%20at%208.16.24%E2%80%AFPM.png?alt=media&amp;token=0f93e486-b9a8-4929-bec1-7fe9fd005bbe" alt=""><figcaption></figcaption></figure>

## List of events

### Conversation Creation

When a new conversation is created.

```json
{"events":[{"event":{"type":"conversation_create","payload":{"assigned_to_user":{"email":"seq_user@swiftsell.biz","id":"8181","type":"bot"},"created_at":"2023-08-29 04:27:48.236411","title":"Visitor - A27187","bot_id":8861,"channel":{"name":1,"provider":0},"is_new_visitor":false,"is_closed":0,"external_key":"7f984da9a15b4bceb512ecad8ca461051693283267","browser":"Chrome 116 (116.0.0.0)","variables":[{"type":"text","name":"bot_name","value":"All Dialogs"},{"type":"text","name":"referrer_url","value":""},{"type":"text","name":"timezone","value":"Asia/Calcutta"},{"type":"text","name":"os","value":"Mac OS X 10_15_7"},{"type":"text","name":"browser_language","value":"en-GB"},{"type":"text","name":"browser","value":"Chrome 116 (116.0.0.0)"},{"type":"text","name":"ip_address","value":"49.249.141.54"},{"type":"text","name":"global_channel_name","value":"WEB"},{"type":"date","name":"conversation_created_at","value":"2023-08-29T04:27:48.183000+00:00"},{"type":"text","name":"conversation_url","value":"https://app.dev.swiftsell.biz/account/476/live-chat/bot/8861/conversations/unassigned/7f984da9a15b4bceb512ecad8ca461051693283267"},{"type":"text","name":"source_url","value":"https://app.dev.swiftsell.biz/bot-preview/8Dc98btp4CPu0959442660854eRb8N5u"},{"type":"text","name":"contact_id","value":"a569015fa03d41a283ed4c66c4601966"},{"type":"text","name":"visitor_contact_created_by","value":"Swiftsell Development"},{"type":"text","name":"visitor_age","value":"abc"},{"type":"text","name":"visitor_js1","value":"hj"},{"type":"text","name":"visitor_name","value":"nik"}]}},"conversation":{"key":"42bb83f00d8240e5bb41290a12eb44401693552452","id":7525695},"account":{"key":"VGYh5KEUxnaS043726528180Llb9R8pe","id":476,"bot":{"id":8861}},"visitor":{"key":"a569015fa03d41a283ed4c66c4601966","id":826373},"timestamp":"2023-09-01 14:13:32.141788"}]}
```

### Message exchange

When exchanges of messages are made between bots/agents and visitors.

```json
// TEXT
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": null, "id": null, "type": "visitor"}, "message": {"type": "text", "text": "Hiiiii"}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:45.503552"}]}

//IMAGE
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "message": {"type": "image", "payload": {"link": "https://swiftsell-conversation-attachment-dev.storage.googleapis.com/8861/Visitor%20-%20A27187-355aaabc63aa46aaa31b4a6ab1a89dd01693458824/30cb79cc-47bd-11ee-8b81-a241eeeaf60f_sample-clouds-400x300.jpg", "mime_type": "image/jpeg", "file_name": "photo-1579353977828-2a4eab540b9a.jpeg"}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}

//FORM
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "message": {"type": "form", "payload": {"message": "Please fill in the following details", "fields": [{"label": "Name", "type": "text", "variable": "\u00bf\u00b7$user.info.age\u00b7?", "is_optional": false}, {"label": "Email", "type": "email", "variable": "\u00bf\u00b7$user.info.email\u00b7?", "is_optional": false}, {"label": "Phone", "type": "phone", "variable": "\u00bf\u00b7$user.info.phone\u00b7?", "is_optional": false}]}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}

//FILE UPLOAD
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "message": {"type": "file_upload", "payload": {"title": "Can you please upload your file?", "allow_extensions": [".jpg", ".png", ".pdf", ".jpeg"], "max_file_size_in_kb": "Can you please upload your file?", "upload_file_limit": 1, "error_message": {"file_size": "Please upload a file below 10 MB", "file_extensions": "Please upload a valid file format", "file_not_found": "Invalid! Please upload a valid file"}}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}

//CALENDAR
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "message": {"type": "calendar", "payload": {"auto_open": true, "title": "What is your preferred date?", "validation": {"datepicker_type": "single", "start": "", "end": "", "formatter": "MM/DD/YYYY", "exclude_days": [], "include": [], "selected": "", "skip": []}}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}

//AUDIO
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "message": {"type": "audio", "payload": {"link": "https://bucket-dev.storage.googleapis.com/8791_8292_sWhsBMDwGdJf101716174591uHnJXdSB_attachment.mp3", "mime_type": "audio/mpeg", "file_name": "file_example_MP3_700KB.mp3"}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}

//CALENDLY
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": null, "id": null, "type": "visitor"}, "message": {"type": "calendly.response", "payload": {"variables": {"\u00bf\u00b7is_calendly_event_scheduled\u00b7?": true, "\u00bf\u00b7calendly_event\u00b7?": "https://api.calendly.com/scheduled_events/bddb81e6-36d4-4950-963d-1c436b9f9696", "\u00bf\u00b7calendly_invitee\u00b7?": "https://api.calendly.com/scheduled_events/bddb81e6-36d4-4950-963d-1c436b9f9696/invitees/84a6fc15-eee8-4e37-b976-0c77e3d70083"}}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:45.503552"}]}

//VIDEO
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "message": {"type": "video", "payload": {"link": "https://bucket-dev.storage.googleapis.com/8791_8292_2PoWjoofeMhP101802210051O8eGJvkH_attachment.mp4", "mime_type": "video/mp4", "file_name": "file_example_MP4_480_1_5MG.mp4"}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}

//LIST (WHATSAPP)
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "message": {"type": "list", "payload": {"header": {"type": "text", "text": "Hello"}, "footer": "", "title": "What would you like to choose?", "list": {"title": "b-1", "sections": [{"title": "c-1", "items": [{"title": "Item 1", "description": "Item-1", "next_dialog": "2"}]}, {"title": "c-2", "items": [{"title": "Item 2", "description": "Item-2", "next_dialog": "2"}]}]}}}}}, "conversation": {"key": "8e6884db0c7a480e90b2118f6daae12c1693797745", "id": 7525719}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 4395}}, "visitor": {"key": "8eef41bf4d4248dd82d6a57c5b42fca9", "id": 826389}, "timestamp": "2023-09-04 03:41:27.335786"}]}

//JAVASCRIPT
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "message": {"type": "javascript", "payload": {"script": "wn.setContactVariables({\"JS1\": \"hj\"});\nwn.setConversationVariables({\"JS2\": \"Mtech\"});\nwindow.alert(5 + 6);\nconsole.log(\"Hello World!\");", "execute_at": "client"}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}

//BUTTON
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "message": {"type": "button", "payload": {"search_enabled": false, "multi_select_enabled": false, "buttons_layout": "horizontal", "buttons_order": "as defined", "buttons": [{"title": "Button 1", "type": "branch", "callback": "", "next_dialog": "6"}, {"title": "Button 2", "type": "web_url", "callback": "{\"web_url\": \"https://www.google.com\", \"browser_window\": \"new\"}", "next_dialog": "5"}, {"title": "Button 3", "type": "branch", "callback": "", "next_dialog": "14"}], "title": "What would you like to choose?"}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}

//DOCUMENT
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "message": {"type": "document", "payload": {"link": "https://bucket-dev.storage.googleapis.com/8791_8292_B9DwdqiUy5Ea101257098374GOoPO0Mc_attachment.pdf", "mime_type": "application/pdf", "file_name": "TICKETS.pdf"}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}

//CAROUSEL
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "message": {"type": "carousel", "payload": {"title": "Image Carousel 1", "items": [{"image": "https://swiftsell-conversation-attachment-dev.storage.googleapis.com/8861_8292_2uMHreVKUmDc100237912704NbQFNlWF_attachment.jpg", "action": ""}]}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}

//JAVASCRIPT RESPONSE
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": null, "id": null, "type": "visitor"}, "message": {"type": "javascript.response", "payload": {"variables": {"\u00bf\u00b7$user.info.JS1\u00b7?": "hj", "\u00bf\u00b7JS2\u00b7?": "Mtech"}}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:45.503552"}]}

//SLIDER RESPONSE
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": null, "id": null, "type": "visitor"}, "message": {"type": "slider.response", "payload": {"value": 30, "text": "30"}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:45.503552"}]}

//SLIDER
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "message": {"type": "slider", "payload": {"title": "What is your preferred value?", "min": 10, "max": 50, "step": "None", "unit": {"label": "", "value": "", "formatter": ""}}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}

//APPOINTMENT BOOKING RESPONSE
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": null, "id": null, "type": "visitor"}, "message": {"type": "appointment_booking.response", "payload": {"event_id": 622, "is_booking_confirmed": true, "is_booking_failed": false, "event_name": "fsefgr", "visitor_timezone": "(GMT+05:30) Asia/Calcutta", "variables": [{"type": "text", "name": "visitor_name", "value": "nik1"}, {"type": "text", "name": "param__gcal_selected_slot_time", "value": "10:00"}, {"type": "text", "name": "param__gcal_selected_slot_date", "value": "01/09/2023"}, {"type": "text", "name": "param__gcal_selected_slot_day", "value": "Friday"}]}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:45.503552"}]}

//BUTTON RESPONSE
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": null, "id": null, "type": "visitor"}, "message": {"type": "button.response", "payload": {"body": "Button 1", "callback": {}}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:45.503552"}]}

//FORM RESPONSE
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": null, "id": null, "type": "visitor"}, "message": {"type": "form.response", "payload": {"fields": [{"label": "Name", "variable": "\u00bf\u00b7$user.info.age\u00b7?", "type": "text", "value": "abc", "extra": "None"}, {"label": "Email", "variable": "\u00bf\u00b7$user.info.email\u00b7?", "type": "email", "value": "abc@gmail.com", "extra": "None"}, {"label": "Phone", "variable": "\u00bf\u00b7$user.info.phone\u00b7?", "type": "phone", "value": "+916767667676", "extra": {"country_code": "91"}}]}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:45.503552"}]}

//FILE UPLOAD RESPONSE
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": null, "id": null, "type": "visitor"}, "message": {"type": "file_upload.response", "payload": {"type": "image", "payload": {"mime_type": "image/jpeg", "link": "https://swiftsell-conversation-attachment-dev.storage.googleapis.com/8861/Visitor%20-%20A27187-355aaabc63aa46aaa31b4a6ab1a89dd01693458824/30cb79cc-47bd-11ee-8b81-a241eeeaf60f_sample-clouds-400x300.jpg", "file_name": "sample-clouds-400x300.jpg"}}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:45.503552"}]}

//APPOINTMENT BOOKING
{"events": [{"event": {"type": "message", "payload": {"message_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "message": {"type": "appointment_booking", "payload": {"event_id": 622, "duration": {"label": "minutes", "value": 30}, "title": "fsefgr"}}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}
```

### Status change

When the conversation status changes i.e. chat changes to open or closed.

```json
{"events": [{"event": {"type": "status", "payload": {"closed_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "status": "Close"}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}
```

### Assignee exchange

When the assignee of the chat changes from bot to agent or amongst agents.

```json
{"events": [{"event": {"type": "assignee_change", "payload": {"changed_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "to": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "from": {"id": "8181", "email": "seq_user@swiftsell.biz", "type": "bot"}}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}
```

### Variable

Creation or updation of the value stored in the variable.

```json
// TEXT
{"events": [{"event": {"type": "variables", "payload": {"action_performed_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "variables": [{"type": "text", "name": "visitor_var12", "value": true}]}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}

//NUMBER
{"events": [{"event": {"type": "variables", "payload": {"action_performed_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "variables": [{"type": "number", "name": "visitor_phone123", "value": "123456789"}]}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}
```

### Label

Creation or attachment of a label to a chat.

```json
{"events": [{"event": {"type": "conversation_labels", "payload": {"action_performed_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "action": "deleted", "labels": [{"id": 2014}]}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}
```

### Note

When a note has been added to a chat.

```json
{"events": [{"event": {"type": "note", "payload": {"note_by": {"email": "himanshu@swiftsell.biz", "id": "8292", "type": "user"}, "note": "Hello"}}, "conversation": {"key": "42bb83f00d8240e5bb41290a12eb44401693552452", "id": 7525695}, "account": {"key": "VGYh5KEUxnaS043726528180Llb9R8pe", "id": 476, "bot": {"id": 8861}}, "visitor": {"key": "a569015fa03d41a283ed4c66c4601966", "id": 826373}, "timestamp": "2023-09-01 14:13:32.141788"}]}
```

***

## Subscribing to events

To subscribe to events, follow the below steps:

### Step 1: Enable the events feature

Turn on the feature, and enter your webhook endpoint and a token that will be passed when the event is published.

### Step 2: Select events

Select the events that you want to listen to and save.&#x20;

{% hint style="info" %}
Refer to the payload as shown in the above events.
{% endhint %}

### Step 3: Test the webhook

Upon saving, we'll send an HTTP POST request to the provided endpoint along with the token. We will expect the same token provided as a response with 200 OK.

<figure><img src="https://2580337444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2FUhzC3pwmSsnDHYmVqea1%2FCleanShot%202023-09-19%20at%2016.20.53.png?alt=media&#x26;token=3cef939a-a16a-44ba-8ab1-f7f717de98c6" alt=""><figcaption><p>Expected response when endpoint is invoked</p></figcaption></figure>


# Service Call

Action block allows you to set up the custom integration between Swiftsell & third-party tools having REST APIs

REST APIs are used to push/pull data to/from third-party systems. Using the Service Call action block, you can directly integrate a third-party system's REST APIs in the flow.&#x20;

You can integrate GET, POST, or PUT type REST API through the Service Call action block from the bot builder page.&#x20;

### How do I set up the integration?&#x20;

To set up the integration with a third-party tool, you can use a Service Call block. You can follow the following steps to configure the same;&#x20;

* Add an action block on Canvas by clicking on '**+**' <br>
* Choose '**Service Call**' <br>
* Double-click on '**Service Call**' to configure it on the right panel\
  \
  Below are various fields that you would be filling values in. If you are a developer, you would feel at home here. For others, you may need to refer to the API documentation to find what to fill on the right panel. <br>
  1. **Type of Method:**\
     &#x20;\
     You first need to select the 'Type of Method' from the drop-down list of the available options. Swiftsell currently supports three methods, they are; <br>
     * GET
     * POST
     * PUT<br>

  2. **Endpoint URL:** \
     \
     You will need to provide the absolute URL i.e URL starting with HTTP or HTTPS. You can use the variables too in the URL by typing '#' as some of the APIs do not have headers and everything is mentioned in the URL itself. \
     \
     For Instance: <br>

     <pre class="language-html" data-overflow="wrap"><code class="lang-html">https://api.weatherapi.com/v1/current.json?key=e943b863ebed4572b55140350200312&#x26;q=#city#

     Here in the above URL #city# is the variable that has been used
     </code></pre>

  3. **Headers:** \
     \
     'Request Headers' allows you to authenticate the API based on its tokens. You can also use the variables as tokens by typing '#'<br>

     <pre data-overflow="wrap"><code>You need to ensure that you add the following token in the header: 

     Key: Content-type
     Value/Variable: application/JSON
     </code></pre>

  4. **Body:** \
     \
     Under 'Request Body' you can define what information needs to be sent or retrieved by calling the API. There are two ways through which the information can be sent or retrieved, they are; <br>
     * **Raw:**\
       \
       It is normal JSON format in which the request needs to be passed<br>

       <pre class="language-json" data-overflow="wrap"><code class="lang-json">{	
       	"User_name": "John",
       	"City": "New York"
       }
       </code></pre>

     * **Form:**\
       \
       It allows you to map the fields. You can either provide static value or map the variables<br>

       <pre data-overflow="wrap"><code>The values can be mapped in the following way

       Key1: User_name
       Value/Variable1: John / #name#

       Key 2: City
       Value/Variable: New York / #city#
       </code></pre>

  5. **Response:** \
     \
     You can further store the responses received from the API into variables that can be further used in the bot flow or message. Swiftsell follows the dot pattern to store the responses into the variables. Below are a few of how the path can be defined<br>

     <pre data-overflow="wrap"><code>Object path for storing the response into the variable where the list is returned

     result.data.list[0].'variable name'

     Here the 'variable name' is the name of the variable where the response will be stored
     </code></pre>

     <pre data-overflow="wrap"><code>Object path for storing the response into the variable where a single value is returned

     result.data.'variable name' 

     Here the 'variable name' is the name of the variable where the response will be stored
     </code></pre>

### Can I test the integration?&#x20;

With the recent upgrades, you now have the ability not only to test the API within the block itself but also to define the variables and store the responses in them.&#x20;

### How do I test it?&#x20;

To test the integration, you can follow the following steps;&#x20;

* Click on '**Test this API**' <br>
* Provide the input in the variable (optional)<br>
* Click on '**Test the API**' again to check the results

### How do I store the responses?&#x20;

To store the API responses directly into the variables, you can follow the following steps;&#x20;

* Click on '**Expand Icon**' to expand the results<br>
* Click on the '**+**' sign against the field to store the value in the variable<br>
* Define the variable in '**Save the field in this variable**' <br>
* Click on '**Right Tick**' to save the variable


# Google Sheets

Action block allows you to set up the integration with Google Sheets in-order to collect the bot responses or leads at single location

### How do I set it up?&#x20;

To set up the integration between Swiftsell and Google Sheets, you can follow the following steps;&#x20;

* Add an action block on Canvas by clicking on '**+**' <br>
* Choose '**Google Sheets**' <br>
* Double-click on '**Google Sheets**' to configure it on the right panel<br>
  * **Authorise the account:** \
    \
    Authorize your Google account and provide all the necessary permissions asked for, so that Swiftsell can push the data to the Google Sheet as soon as it is captured\
    \
    To authorize your Google account, you can either click on '**+ Add account**' or you can go to '**App Market -> Google Sheets -> Accounts -> Add Google Account**' <br>
  * **Select the sheet:**\
    \
    All the sheets that are shared with you will be displayed in the dropdown. You need to select the Google Sheet where you would like the chatbot to send the data<br>
  * **Select the variable:** \
    \
    Select the variables for which the value needs to be pushed to Google Sheet

{% hint style="info" %}
The header row will always contain the name of the variable \
\
A new row is created on Google Sheets as soon as the data has been captured&#x20;
{% endhint %}

{% hint style="warning" %}
Deleting the column on Google Sheet will lead to loss of data\
\
Deleting that sheet will result in a loss of data
{% endhint %}


# Google Calendar

Collaborate with your visitors and make it easy for them to view and book appointments.

### Step 1: Create an event

For the chatbot to be able to book events on your calendar, you need to create an event.&#x20;

To do this, click the "+Create event" button, give it an event name, and choose the teammates/team whose availability needs to be shown.&#x20;

{% hint style="info" %}
When an event is booked, the availability of all user's calendars will be shown to the visitor. And when an event is booked, it is only with one user based on whose schedule was available.&#x20;
{% endhint %}

{% hint style="warning" %}
You will only be able to see the users and teams who have connected their Google calendars. To connect your calendar, go to Settings > Calendar > Connect Google Calendar
{% endhint %}

### Step 2: Configure the general configurations for your event

After creating your event, customize the configurations of your event. The following options can be customized,

<table><thead><tr><th width="227">Configurations</th><th>Description</th></tr></thead><tbody><tr><td>Slot duration</td><td>Length of the event. From 5 mins to 120 mins</td></tr><tr><td>Buffer time</td><td>Gap that will always be maintained between two events booked from the chatbot. From 5 mins to 120 mins.</td></tr><tr><td>Notice time</td><td>Meetings will only be booked X minutes in advance.  </td></tr><tr><td>Limit future bookings</td><td>The calendar will only show these many days in the future. Also, you can choose to show weekends or only business days.</td></tr></tbody></table>

<figure><img src="https://2580337444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2FazDhGmBBYgfwopYgPEbX%2FCleanShot%202023-10-09%20at%2016.31.41.png?alt=media&#x26;token=b13ee428-4c77-4d1e-825a-af2c2eb43642" alt=""><figcaption><p>Configurations for an event</p></figcaption></figure>

### Step 3: Define the copy for your event&#x20;

Once the meeting is booked, a calendar event will be sent to the attendee and the host. You can define the copy of that meeting here.

<figure><img src="https://2580337444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2FqNqQV3EIn2eWmfHiFZPY%2FCleanShot%202023-10-09%20at%2016.43.25.png?alt=media&#x26;token=d74adcfb-2348-460f-bd29-587994e5ec73" alt=""><figcaption><p>Defining copy for the event</p></figcaption></figure>

<table><thead><tr><th width="248">Configuration</th><th>Description</th></tr></thead><tbody><tr><td>Subject</td><td>Subject of the meeting invite sent to the attendee. You can  use variables to personalize the event name like "Meeting with #name#" </td></tr><tr><td>Description</td><td>Define the description in the field, providing little more information about what the scheduled meeting is about. <br></td></tr><tr><td>Location</td><td>Usually used to share the place of meeting. There is an option to enable Google Meet link, if not selected, you can type in your location manually. </td></tr></tbody></table>

### Step 4: Collect contact details to book the meeting

To book the event, it is mandatory to collect the name and email of the attendee.

You can customize this form to include other fields by creating new fields.&#x20;

Also, you can enable the "Skip form" configuration which will automatically skip this screen if data is available in the variables defined.&#x20;

As users who speak with your bot may have previously provided their contact details, the chatbot will smartly skip asking for the details again if it already knows the answer.&#x20;

<figure><img src="https://2580337444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2Fvyk7rQVvPDdkep5L9EII%2FCleanShot%202023-10-09%20at%2016.42.52.png?alt=media&#x26;token=fdafeaaf-8c3f-49a7-bbd6-71e709f4a519" alt=""><figcaption><p>Contact details</p></figcaption></figure>

### Step 5: Define the message copy (If used on WhatsApp / SMS channel)

If you are using Google Calendar on WhatsApp or SMS, you can change the copy of the message used in collecting the date and timeslot.

Copy that can be changed:

<table><thead><tr><th width="157">Type<select><option value="6654e5f0cfe444058ce6147f8e354b08" label="Date selection" color="blue"></option><option value="ee8a587b63964216bd594fd3e6999ba2" label="Timeslot selection" color="blue"></option><option value="0687a69c12684b04a6b030cf0409b507" label="Confirmation" color="blue"></option></select></th><th width="146">Field</th><th>Description</th></tr></thead><tbody><tr><td><span data-option="6654e5f0cfe444058ce6147f8e354b08">Date selection</span></td><td>Question</td><td>Question asked while showing the list of dates</td></tr><tr><td><span data-option="6654e5f0cfe444058ce6147f8e354b08">Date selection</span></td><td>Button text</td><td>On WA, clicking on this button will show the list of dates in a drawer.</td></tr><tr><td><span data-option="6654e5f0cfe444058ce6147f8e354b08">Date selection</span></td><td>Error message</td><td>Error message when a invalid selection is made</td></tr><tr><td><span data-option="ee8a587b63964216bd594fd3e6999ba2">Timeslot selection</span></td><td>Question</td><td>Question asked while showing the list of timeslots</td></tr><tr><td><span data-option="ee8a587b63964216bd594fd3e6999ba2">Timeslot selection</span></td><td>Button text</td><td>On WA, clicking on this button will show the list of timeslot in a drawer.</td></tr><tr><td><span data-option="ee8a587b63964216bd594fd3e6999ba2">Timeslot selection</span></td><td>Error message</td><td>Error message when a invalid selection is made</td></tr><tr><td><span data-option="0687a69c12684b04a6b030cf0409b507">Confirmation</span></td><td>Confirmation message</td><td>Message sent once meeting is booked. </td></tr></tbody></table>

You can use the following system variables to post the booked date and time in the message:

* gcal\_selected\_slot\_time
* gcal\_selected\_slot\_date
* gcal\_selected\_slot\_day

{% hint style="info" %}
Click 'Save' on every section of the action panel to save your changes for that event.&#x20;
{% endhint %}

{% hint style="warning" %}
Choosing a different event from the event dropdown will show its configurations.&#x20;
{% endhint %}


# Calendly

Action block allows to setup the integration with third party tool for scheduling appointments using chatbot

### What is Calendly?&#x20;

Calendly is a popularly used appointment booking tool. Using Calendly, your prospects/customers can easily look at your availability and book a meeting when you are available.

Thereby, eliminating all the effort involved in the logistics of setting up a time slot and sending out the calendar invites.

### How do I configure my Calendly account?

There are two ways through which you can connect your Calendly account with Swiftsell;

1. Through App Market: \
   \
   To connect your account through App Market, you can go to 'App Market -> Calendly -> Accounts -> Add Account' <br>
2. Using the 'Calendly' action block: \
   \
   Or you can add the action block in the bot flow and click on 'Add Account'&#x20;

### How do I set it up?&#x20;

To set up the Calendly account and integrate with your chatbot, you can follow the following steps;&#x20;

* Add an action block on Canvas by clicking on '+' <br>
* Choose 'Calendly'<br>
* Double-click on the 'Calendly' block to configure it on the right panel<br>
  * Authorise 'Calendly' account: \
    \
    Authorize your 'Calendly' account by clicking on 'Connect your Calendly account' so that Swiftsell can access Calendly to book appointments on your behalf. <br>
  * Select Event: \
    \
    Select the event displayed to the visitor to book an appointment. All the available slots of this event will be displayed. <br>
* Define the 'Success' or 'Failure' message


# Public APIs

### Authorization <a href="#authorization" id="authorization"></a>

All of Swiftsell's APIs use a Bearer token based authentication.

Your account token can be found at Settings > Account Settings.

### Create a knowledge base <a href="#create-a-knowledge-base" id="create-a-knowledge-base"></a>

<mark style="color:green;">`POST`</mark> `/v1/ai/knowledge-base`

Using this API, you can create a knowledge base in the account.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

Copy

```json
{
  "name": "KNOWLEDGE_BASE_NAME"
}
```

**Response**

{% tabs %}
{% tab title="200" %}

<pre class="language-json"><code class="lang-json"><strong>{
</strong>    "ok": true,
    "id": KNOWLEDGE_BASE_ID,
    "message": "Knowledge base has been created.",
    "code": "CREATE_KNOWLEDGE_BASE_SUCCESS_MESSAGE"
}
</code></pre>

{% endtab %}

{% tab title="400" %}

```json
{
    "ok": false,
    "message": "You have reached the maximum number of knowledge bases. Upgrade your plan to create more knowledge bases.",
    "error": "MAX_KNOWLEDGE_BASE_COUNT_EXCEEDED",
    "code": "MAX_KNOWLEDGE_BASE_COUNT_EXCEEDED"
}

{
    "ok": false,
    "message": "Please reach out to support to use this feature",
    "error": "UNAUTHORIZED_FEATURE",
    "code": "UNAUTHORIZED_FEATURE"
}
```

{% endtab %}
{% endtabs %}

### Adding text/file data sources to a knowledge base <a href="#adding-text-file-data-sources-to-a-knowledge-base" id="adding-text-file-data-sources-to-a-knowledge-base"></a>

<mark style="color:green;">`POST`</mark> `/api/v1/ai/knowledge-base/<knowledge_base_id>/upload/sources`

Using this API, you can add a data source to an existing knowledge base.

**Headers**

| Name          | Value                 |
| ------------- | --------------------- |
| Content-Type  | `multipart/form-data` |
| Authorization | `Bearer <token>`      |

**Body**

The API accepts files and text as multipart form data for upload. Each form field should be a unique key and contain either a file or text content.

{% tabs %}
{% tab title="File" %}

| Name                     | Type      | Value         |
| ------------------------ | --------- | ------------- |
| file\_data\_source\_name | form-data | File location |
| {% endtab %}             |           |               |

{% tab title="Text" %}

| Name                     | Type      | Value        |
| ------------------------ | --------- | ------------ |
| text\_data\_source\_name | form-data | Text content |
| {% endtab %}             |           |              |
| {% endtabs %}            |           |              |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "q1": [
    {
      "id": 330783,
      "type": "text",
      "name": "sample.txt",
      "status": "in-progress",
      "errors": null
    },
    {
      "id": 330784,
      "type": "text",
      "name": "sample2.txt",
      "status": "in-progress",
      "errors": null
    },
    {
      "id": 330785,
      "type": "file",
      "name": "File.pdf",
      "status": "in-progress",
      "errors": null
    }
  ],
  "d2": [
    {
      "id": 330786,
      "type": "file",
      "name": "File2.pdf",
      "status": "in-progress",
      "errors": null
    }
  ],
  "knowledge_base_id": 876,
  "ok": true
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "ok": false,
  "error": "KNOWLEDGE_BASE_NOT_FOUND",
  "message": "KnowledgeBase Not Found in DB!",
  "code": "KNOWLEDGE_BASE_NOT_FOUND",
  "status": 404
}
{
  "ok": false,
  "error": "JWT_SIGNATURE_EXCEPTION",
  "message": "Invalid JWT token",
  "status": 401
}
{
  "ok": false,
  "error": "UNAUTHORIZED_FEATURE",
  "code": "UNAUTHORIZED_FEATURE",
  "status": 401,
  "message": "Please reach out to support to use this feature"
}
{
  "ok": false,
  "error": "ACCOUNT_DETAILS_NOT_FOUND",
  "code": "ACCOUNT_DETAILS_NOT_FOUND",
  "status": 404,
  "message": "Account Details are Not Found!"
}
{
  "ok": false,
  "error": "BAD_REQUEST",
  "code": "BAD_REQUEST",
  "status": 400,
  "message": "Knowledge base does not belong to the account(876)"
}
```

{% endtab %}
{% endtabs %}

### Adding individual URLs data sources to a knowledge base <a href="#adding-individual-urls-data-sources-to-a-knowledge-base" id="adding-individual-urls-data-sources-to-a-knowledge-base"></a>

<mark style="color:green;">`POST`</mark> `/v1/ai/knowledge-base/<knowledge_base_id>/data-sources/webpages`

Using this API, you can add individual URLs as data sources to an existing knowledge base.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

```json
{
    "urls": [
        "https://swiftsellai.com",
        "https://www.swiftsellai.com/automation-builder"
    ]
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```
{
    "ok": true,
    "data_sources": [
        {
            "knowledge_base_id": "29",
            "id": 1335,
            "name": "https://swiftsellai.com",
            "source_type": "url",
            "token": 0,
            "refresh_frequency": null,
            "last_trained_at": null,
            "status": "in-progress",
            "type": "url",
            "created_at": "2025-07-07 05:09:34.218507",
            "created_by": {
                "id": 2,
                "name": "System"
            }
        },
        {
            "knowledge_base_id": "29",
            "id": 1336,
            "name": "https://www.swiftsellai.com/automation-builder",
            "source_type": "url",
            "token": 0,
            "refresh_frequency": null,
            "last_trained_at": null,
            "status": "in-progress",
            "type": "url",
            "created_at": "2025-07-07 05:09:34.218507",
            "created_by": {
                "id": 2,
                "name": "System"
            }
        }
    ]
}
```

{% endtab %}

{% tab title="400" %}

```
{
    "error": "BAD_REQUEST",
    "ok": false,
    "status": 400,
    "message": [
        {
            "message": "\"urls[0]\" must be a valid uri",
            "path": [
                "urls",
                0
            ]
        },
        {
            "message": "\"urls\" does not contain 1 required value(s)",
            "path": [
                "urls"
            ]
        }
    ]
}
```

{% endtab %}

{% tab title="401" %}

```
{
    "message": "Please reach out to support to use this feature",
    "ok": false,
    "error": "UNAUTHORIZED_FEATURE",
    "code": "UNAUTHORIZED_FEATURE",
    "status": 401
}
```

{% endtab %}
{% endtabs %}

### Adding domain data source to a knowledge base <a href="#adding-domain-data-source-to-a-knowledge-base" id="adding-domain-data-source-to-a-knowledge-base"></a>

<mark style="color:green;">`POST`</mark> `/v1/ai/knowledge-base/<knowledge_base_id>/data-sources/domain`

Using this API, you can add domain as data source to an existing knowledge base.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

```json
{
    "type": "domain",
    "url": "https://swiftsellai.com",
    "exclude_urls": "",
    "refresh_frequency": null
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "ok": true,
    "domain_id": 8,
    "request_id": "3QWuobWJE3jF065037422196qAdTZ2Ct"
}
```

{% endtab %}

{% tab title="400" %}

```json5
{
    "message": "Maximum urls allowed 4",
    "ok": false,
    "error": "BAD_REQUEST",
    "code": "BAD_REQUEST",
    "status": 400
}

{
    "error": "BAD_REQUEST",
    "ok": false,
    "status": 400,
    "message": [
        {
            "message": "\"url\" must be a valid uri",
            "path": [
                "url"
            ]
        }
    ]
}
```

{% endtab %}

{% tab title="401" %}

```json
{
    "message": "Please reach out to support to use this feature",
    "ok": false,
    "error": "UNAUTHORIZED_FEATURE",
    "code": "UNAUTHORIZED_FEATURE",
    "status": 401
}
```

{% endtab %}
{% endtabs %}

### Get training status of a data source <a href="#get-training-status-of-a-data-source" id="get-training-status-of-a-data-source"></a>

<mark style="color:green;">`GET`</mark> `/api/v1/ai/status/sources`

Using this API, you can fetch the status of one or more data sources in a knowledge base to know it its training is - in progress / completed / failed.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

| Name         | Type         | Description                                                               |
| ------------ | ------------ | ------------------------------------------------------------------------- |
| `source_ids` | query params | Comma-separated list of data source IDs to be passed as **query params**. |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "sources": [
        {
            "id": 330778,
            "name": "sample.txt",
            "status": "in-progress",
            "knowledge_base_id": 876
        }
    ],
    "ok": true
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "ok": false,
  "error": "JWT_SIGNATURE_EXCEPTION",
  "message": "Invalid JWT token",
  "status": 401
}
{
  "ok": false,
  "error": "UNAUTHORIZED_FEATURE",
  "code": "UNAUTHORIZED_FEATURE",
  "status": 401,
  "message": "Please reach out to support to use this feature"
}
{
  "ok": false,
  "error": "ACCOUNT_DETAILS_NOT_FOUND",
  "code": "ACCOUNT_DETAILS_NOT_FOUND",
  "status": 404,
  "message": "Account Details are Not Found!"
}
```

{% endtab %}
{% endtabs %}

### Fetch knowledge base details <a href="#fetch-knowledge-base-details" id="fetch-knowledge-base-details"></a>

<mark style="color:green;">`GET`</mark> `/v1/ai/knowledge-base/<knowledge_base_id>`

Using this API, you can fetch knowledge base and it's relevant data sources details.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

```json
{
  "limit": 100,
  "offset": 1
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "ok": true,
  "id": KNOWLEDGE_BASE_ID,
  "name": "KNOWLEDGE_BASE_NAME",
  "total_tokens": TOTAL_TOKENS_USED_IN_KNOWLEDGE_BASE,
  "total_data_sources": TOTAL_NUMBER_OF_DATA_SOURCES,
  "data_source": [
    {
      "id": DATA_SOURCE_ID,
      "name": "DATA_SOURCE_NAME",
      "source": "DATA_SOURCE_URL_OR_CONTENT",
      "token": TOTAL_TOKENS_USED_IN_DATA_SOURCE,
      "domain_id": DOMAIN_ID,
      "refresh_frequency": null,
      "last_trained_at": "2024-12-27 09:10:11.870000",
      "status": "trained",
      "failed_reason": null,
      "type": "url",
      "created_at": "2024-12-27 09:10:02.411000",
      "created_by": USER_ID,
      "user_name": "USER_NAME"
    }
  ],
  "domains": [],
  "pagination": {
    "limit": 100,
    "offset": 1,
    "total": TOTAL_NUMBER_OF_DATA_SOURCES
  },
  "last_trained_at": "2024-12-27 09:13:26.905000"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "ok": false,
    "message": "Resource not found",
    "error": "RESOURCE_NOT_FOUND",
    "code": "RESOURCE_NOT_FOUND"
}
```

{% endtab %}
{% endtabs %}

### Creating a conversation <a href="#creating-a-conversation" id="creating-a-conversation"></a>

<mark style="color:green;">`POST`</mark> `/v1/conversations`

Using this endpoint, you can start/create a new conversation.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

Contains the message payload. Payload differs based on channel.

{% tabs %}
{% tab title="WhatsApp" %}

```json
{
   "channel": "WHATSAPP",
   "from": "1123123123",
   "to": {
       "phone": "11231231230",
       "name": "John Doe",
       "email": "example@domain.com"
   },
   "message": {
       "type": "template",
       "data": {
           "template": "test_template",
           "parameters": {
               "header": [
                   "John"
               ],
               "body": [
                   "Doe",
                   "Doe2"
               ],
               "buttons": {
                   "copy_code": "123456",
                   "otp": "123456",
                   "url": "any"
               }
           },
           "variables":{
               "name": "John Doe"
           }
       }
   },
   "assignee": "agent_email@domain.com"
}
```

{% endtab %}

{% tab title="SMS" %}

```json
{
   "channel": "SMS",
   "from": "1-123-1231230",
   "to": {
       "phone": "1-1321231320",
       "name": "John Doe",
       "email": "abc@acme.com"
   },
   "message": {
       "type": "text",
       "text": "Hii"
   },
   "assignee": "agent_email@domain.com"
}
```

{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "ok": true,
  "conversation": {
    "id": "12wfegrgt4t",
    "message_id": "sdvgret4353b",
    "created_at": "",
    "assignee": {
      "id": 123,
      "to": "agent_email@domain.com"
    }
  },
  "contact": {
    "id": "11111111",
    "name": "John Doe",
    "phone": "1234567890",
    "email": "example@domain.com"
  }
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "ok": false,
  "error": "CHANNEL_TOKEN_EXPIRED",
  "code": "CHANNEL_TOKEN_EXPIRED",
  "message": "Token used to configure the channel is expired. Please reconfigure the channel.",
  "status": 400
}

{
  "ok": false,
  "error": "CONVERSATION_CREATION_EXCEPTION",
  "code": "CONVERSATION_CREATION_EXCEPTION",
  "message": "Conversation is not created. Please try again after some time.",
  "status": 400
}

{
  "ok": false,
  "error": "CHANNEL_NOT_ENABLED",
  "code": "CHANNEL_NOT_ENABLED",
  "message": "This channel is not enabled in the account.",
  "status": 400
}

{
  "ok": false,
  "error": "CONTACT_IS_BLOCKED",
  "code": "CONTACT_IS_BLOCKED",
  "message": "Conversation cannot be created for blocked contact.",
  "status": 400
}

{
  "ok": false,
  "error": "CONTACT_IS_BLOCKED",
  "code": "CONTACT_IS_BLOCKED",
  "message": "Conversation cannot be created for blocked contact.",
  "status": 400
}

{
  "ok": false,
  "error": "CONTACT_IS_BLOCKED",
  "code": "CONTACT_IS_BLOCKED",
  "message": "Conversation cannot be created for blocked contact.",
  "status": 400
}

{
  "ok": false,
  "error": "CONVERSATION_NOT_CREATED",
  "code": "CONVERSATION_NOT_CREATED",
  "message": "Conversation is not created due to user limit validation",
  "status": 400
}
```

{% endtab %}

{% tab title="401" %}

```json
{
   "error": "JWT_SIGNATURE_EXCEPTION",
   "message": "Invalid JWT token",
   "ok": false,
   "status": 401
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "ok": false,
  "error": "PHONE_NUMBER_IS_NOT_CONFIGURED",
  "code": "PHONE_NUMBER_IS_NOT_CONFIGURED",
  "message": "’From’ phone number is not configured in the account.",
  "status": 404
}

{
  "ok": false,
  "error": "WHATSAPP_TEMPLATE_NOT_FOUND",
  "code": "WHATSAPP_TEMPLATE_NOT_FOUND",
  "message": "WhatsApp template is not available in the account.",
  "status": 404
}

{
  "ok": false,
  "error": "TEMPLATE_NOT_APPROVED",
  "code": "TEMPLATE_NOT_APPROVED",
  "message": "Oops, template is not approved",
  "status": 404
}
```

{% endtab %}
{% endtabs %}

### Send agent response to a conversation <a href="#send-agent-response-to-a-conversation" id="send-agent-response-to-a-conversation"></a>

<mark style="color:green;">`POST`</mark> `/api/v1/conversation/<conversation_id>/messages`

For every response sent by the agent on the third-party system, this API is to be invoked so it can relay this response to the user.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

{% tabs %}
{% tab title="Text" %}

```json
{
  "message": {
    "data": {
      "body": "Hi"
    },
    "type": "text"
  },
  "user": {
    "by": "agent_email@domain.com"
  }
}
```

{% endtab %}

{% tab title="File" %}

```json
{
  "message": {
    "file": {
      "path": "https://framerusercontent.com/images/L2xfXiiCkddPZOjvWCGTusENwb4.png",
      "size": 1,
      "type": "image/png",
      "name": "L2xfXiiCkddPZOjvWCGTusENwb4.png"
    },
    "type": "file"
  },
  "user": {
    "by": "agent_email@domain.com"
  }
}
```

{% endtab %}

{% tab title="Voice" %}

```json
{
  "message": {
    "file": {
      "path": "https://file-examples.com/storage/fe32d8b189680228b9ad370/2017/11/file_example_WAV_1MG.wav",
      "size": 1,
      "type": "audio/wav",
      "name": "file_example_WAV_1MG.wav"
    },
    "type": "voice"
  },
  "user": {
    "by": "agent_email@domain.com"
  }
}
```

{% endtab %}

{% tab title="Template" %}

```json
{
  "message": {
    "data": {
      "template": "template_1"
    },
    "type": "template"
  },
  "user": {
    "by": "agent_email@domain.com"
  }
}
```

{% endtab %}
{% endtabs %}

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "ok": true,
  "message_id": "6HRBshHEcV8P103039226478taGDJQxC"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "ok": false,
  "error": "INVALID_DATA",
  "code": "INVALID_DATA",
  "message": "Error message",
  "status": 400
}

{
  "ok": false,
  "error": "CONVERSATION_CLOSED",
  "code": "CONVERSATION_CLOSED",
  "message": "Assignee cannot be changed on closed conversation.",
  "status": 400
}

{
  "ok": false,
  "error": "CONVERSATION_ASSIGNED_TO_BOT",
  "code": "CONVERSATION_ASSIGNED_TO_BOT",
  "message": "Agent message cannot be sent on bot assigned conversation.",
  "status": 400
}

{
  "ok": false,
  "error": "CONTACT_IS_BLOCKED",
  "code": "CONTACT_IS_BLOCKED",
  "message": "Conversation cannot be created for blocked contact.",
  "status": 400
}

{
  "ok": false,
  "error": "MESSAGE_NOT_SENT",
  "code": "MESSAGE_NOT_SENT",
  "message": "Message is not sent due to user limit validation.",
  "status": 400
}
```

{% endtab %}

{% tab title="401" %}

```json
{
  "ok": false,
  "error": "JWT_SIGNATURE_EXCEPTION",
  "code": "JWT_SIGNATURE_EXCEPTION",
  "message": "Invalid JWT token",
  "status": 401
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "ok": false,
  "error": "CONVERSATION_NOT_FOUND",
  "code": "CONVERSATION_NOT_FOUND",
  "message": "Conversation is not available.",
  "status": 404
}
```

{% endtab %}
{% endtabs %}

### Closing a conversation <a href="#closing-a-conversation" id="closing-a-conversation"></a>

<mark style="color:green;">`POST`</mark> `/api/v1/conversation/<conversation_id>/events`

Use this endpoint to close an open conversation.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

```json
{
  "event": "status",
  "status": "CLOSE",
  "user": {
    "by": "agent_email@domain.com"
  }
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "ok": true
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "ok": false,
  "error": "CONVERSATION_NOT_CLOSED",
  "code": "CONVERSATION_NOT_CLOSED",
  "message": "Conversation is not closed due to user limit validation.",
  "status": 400
}
```

{% endtab %}

{% tab title="401" %}

```json
{
  "ok": false,
  "error": "JWT_SIGNATURE_EXCEPTION",
  "code": "JWT_SIGNATURE_EXCEPTION",
  "message": "Invalid JWT token",
  "status": 401
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "ok": false,
  "error": "CONVERSATION_NOT_FOUND",
  "code": "CONVERSATION_NOT_FOUND",
  "message": "Conversation is not available.",
  "status": 404
}
```

{% endtab %}
{% endtabs %}

### Changing assignee in a conversation <a href="#changing-assignee-in-a-conversation" id="changing-assignee-in-a-conversation"></a>

<mark style="color:green;">`POST`</mark> `/api/v1/conversation/<conversation_id>/events`

Use this endpoint to change the assignee in an open conversation.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

```json
// Change from assignee to assignee
{
  "event": "assignee",
  "user": {
    "by": "agent_email@domain.com",
    "to": "assignee@domain.com"
  }
}

// Change from assignee to team
{
  "event": "assignee",
  "team": {
    "by": "agent_email@domain.com",
    "to": "Sales"
  }
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "ok": true
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "ok": false,
  "error": "TEAM_NOT_FOUND",
  "code": "TEAM_NOT_FOUND",
  "message": "Team does not exist.",
  "status": 400
}


{
  "ok": false,
  "error": "CONVERSATION_CLOSED",
  "code": "CONVERSATION_CLOSED",
  "message": "Assignee cannot be changed on closed conversation.",
  "status": 400
}


{
  "ok": false,
  "error": "ASSIGNEE_CHANGE_EXCEPTION",
  "code": "ASSIGNEE_CHANGE_EXCEPTION",
  "message": "By and To user are same. Can not assign conversation to same user.",
  "status": 400
}


{
  "ok": false,
  "error": "ASSIGNEE_NOT_CHANGED",
  "code": "ASSIGNEE_NOT_CHANGED",
  "message": "Assignee is not changed due to user limit validationt.",
  "status": 400
}
```

{% endtab %}

{% tab title="401" %}

```json
{
  "ok": false,
  "error": "JWT_SIGNATURE_EXCEPTION",
  "code": "JWT_SIGNATURE_EXCEPTION",
  "message": "Invalid JWT token",
  "status": 401
}
```

{% endtab %}

{% tab title="404" %}

```json
{
  "ok": false,
  "error": "CONVERSATION_NOT_FOUND",
  "code": "CONVERSATION_NOT_FOUND",
  "message": "Conversation is not available.",
  "status": 404
}
```

{% endtab %}
{% endtabs %}

### Update variable of a conversation <a href="#update-variable-of-a-conversation" id="update-variable-of-a-conversation"></a>

<mark style="color:green;">`POST`</mark> `/v1/accounts/<account_id>/conversations/<conversation_id>/variables`

Use this endpoint to update the variables in the conversation.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

```json
{
  "variables": [
    {
      "name": "name",
      "type": "conversation",
      "value": "John Doe"
    },
    {
      "name": "phone",
      "type": "contact",
      "value": "9999999999"
    },
    {
      "name": "company",
      "type": "conversation",
      "value": "Example"
    },
    {
      "name": "email",
      "type": "contact",
      "value": "john.doe@gmail.com"
    }
  ]
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "ok": true
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "ok": false,
    "message": {
        "variables": [
            "Shorter than minimum length 1."
        ]
    },
    "status": 400,
    "error": "BAD_REQUEST"
}
```

{% endtab %}

{% tab title="401" %}

```json
{
    "error": "UNAUTHORIZED",
    "ok": false,
    "status": 401,
    "message": "Invalid token. Provide the valid account token."
}
```

{% endtab %}

{% tab title="404" %}

```json
{
    "message": "Conversation is not found",
    "ok": false,
    "error": "CONVERSATION_NOT_FOUND",
    "code": "CONVERSATION_NOT_FOUND",
    "status": 404
}
```

{% endtab %}
{% endtabs %}

### Set webhook URL for Events feature <a href="#set-webhook-url-for-events-feature" id="set-webhook-url-for-events-feature"></a>

<mark style="color:green;">`POST`</mark> `/v1/accounts/<account_id>/webhook`

Use this endpoint to set webhook for receiving conversation related events from the account.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

```json
{
  "webhook_url": "",
  "subscribed_events": [
    {
      "key": "conversation_create",
      "is_subscribed": true
    },
    {
      "key": "message",
      "is_subscribed": true
    },
    {
      "key": "status",
      "is_subscribed": true
    },
    {
      "key": "assignee_change",
      "is_subscribed": true
    },
    {
      "key": "sla_breached",
      "is_subscribed": true
    },
    {
      "key": "variables",
      "is_subscribed": true
    },
    {
      "key": "conversation_labels",
      "is_subscribed": true
    },
    {
      "key": "note",
      "is_subscribed": true
    }
  ],
  "is_enabled": true,
  "token": "Test"
}
```

**Response**

200401Copy

{% tabs %}
{% tab title="200" %}

```json
{
  "ok": true
}
```

{% endtab %}

{% tab title="401" %}

```json
{
    "error": "UNAUTHORIZED",
    "ok": false,
    "status": 401,
    "message": "Invalid token. Provide the valid account token."
}
```

{% endtab %}
{% endtabs %}

### Create a bot <a href="#create-a-bot" id="create-a-bot"></a>

<mark style="color:green;">`POST`</mark> `/v1/bot`

Using this API, you can create a bot in account.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

```json
{
  "name": "BOT_NAME",
  "template_id": REFERENCE_BOT_ID,
  "channel": "API"
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "ok": true,
    "id": BOT_ID
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "ok": false,
    "message": "Maximum bots limit reached for the account.",
    "error": "MAXIMUM_BOTS_LIMIT_REACHED",
    "code": "MAXIMUM_BOTS_LIMIT_REACHED"
}
```

{% endtab %}
{% endtabs %}

### Fetch bot flow <a href="#fetch-bot-flow" id="fetch-bot-flow"></a>

<mark style="color:green;">`GET`</mark> `/v1/bots/<bot_id>/flow`

Using this API, you can fetch bot's flow data.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "ok": true,
    "data": "BOT_FLOW_JSON",
    "is_deployed": true,
    "last_deployed_at": "2025-05-05 10:37:43.128000"
}
```

{% endtab %}

{% tab title="404" %}

```json
{
    "error": "BOT_NOT_FOUND",
    "ok": false,
    "status": 404,
    "message": "Bot not found."
}
```

{% endtab %}
{% endtabs %}

### Deploy bot flow <a href="#deploy-bot-flow" id="deploy-bot-flow"></a>

<mark style="color:green;">`POST`</mark> `/v1/bots/<bot_id>/deploy`

Using this API, you can deploy the bot flow after modifying it's JSON data.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Body**

```json
{
  "flow_diagram": "BOT_FLOW_JSON"
}
```

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "ok": true,
    "data": "BOT_FLOW_JSON",
    "is_deployed": true,
    "last_deployed_at": "2025-05-05 10:37:43.128000"
}
```

{% endtab %}

{% tab title="404" %}

```json
{
    "error": "BOT_NOT_FOUND",
    "ok": false,
    "status": 404,
    "message": "Bot not found."
}
```

{% endtab %}
{% endtabs %}

### Fetch Bots List <a href="#fetch-bots-list" id="fetch-bots-list"></a>

<mark style="color:green;">`GET`</mark> `/v1/accounts/<account_id>/bots`

Use this endpoint to fetch list of bots available in the account.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
  "ok": true,
  "bots": [
    {
      "bot_title": "Appointment Booking",
      "channels": [
        {
          "name": "WEB"
        }
      ],
      "is_active": false,
      "bot_key": "7SgQLb4qUbp61059137828254t5QVE0H",
      "last_deployed_at": "2025-01-22 13:26:40.554000",
      "is_inactive_by_system": false,
      "priority": 1,
      "preferred_bot_language": {
        "label": "English",
        "code": "EN"
      },
      "type": "inbound",
      "outbound_type": null,
      "bot_owner": {
        "id": 14764,
        "name": "John Doe"
        "email": "john.doe@gmail.com"
      }
      "created_at": "2024-02-09 10:59:13.783000",
      "preview_key": "6H7PD4WwTmsU105913782825Zk3KCj3t",
      "bot_id": 9633
    }
  ]
}
```

{% endtab %}

{% tab title="401" %}

```json
{
    "error": "UNAUTHORIZED",
    "ok": false,
    "status": 401,
    "message": "Invalid token. Provide the valid account token."
}
```

{% endtab %}
{% endtabs %}

[<br>](https://help.wotnot.io/integrations/zapier)


# Overview

It is the platform that allows you to communicate with your customers on WhatsApp at scale

WhatsApp provides you with programmatic access to send and receive messages, automate interactions & integrate WhatsApp messaging into your existing system and workflows.&#x20;

Key Features of using WhatsApp Business API include:&#x20;

* **Messaging:** \
  \
  You can send various types of messages to customers, including text, images, documents, and media files<br>
* **Templates:** \
  \
  Allows you to create templates for structured messages & send them to visitors or customers for common use cases like order confirmations, appointment reminders, shipping notifications, etc. <br>
* **Two Way Communication:**\
  \
  You can engage in two-way communication with your customers & also allowing you to respond back to your customer inquiries, providing support & addressing their needs.\
  &#x20;
* **Automation:** \
  \
  With the help of the API, you can automate the message responses using predefined rules and logic to ensure quick and efficient customer service<br>
* **Rich Media:** \
  \
  You can leverage the rich media features such as sending images, videos, and interactive buttons to enhance customer interactions<br>
* **Account Verification:** \
  \
  Allows you to verify your customer accounts by adding credibility and authenticity in your communication with the customers  <br>
* **Integration:** \
  \
  APIs can be integrated with CRM platforms & chatbot frameworks to streamline business processes and provide seamless customer service<br>

{% hint style="info" %}
It's important to note that the WhatsApp Business API is separate from the regular WhatsApp application used by individuals. The API is designed specifically for businesses and requires approval from WhatsApp or Facebook before it can be used.\
\
Businesses interested in using the WhatsApp Business API, typically need to apply for access and adhere to specific guidelines and policies set by WhatsApp or Facebook.
{% endhint %}

### What providers does Swiftsell support for WhatsApp Business API?&#x20;

Swiftsell has integration with the following providers for WhatsApp Business API;&#x20;

1. Meta&#x20;
2. 360Dialog
3. Twilio&#x20;
4. Unifonic
5. GupShup

{% hint style="info" %}
To get the WhatsApp Business API for your business, you can either buy it directly from the above providers or send us an email at `support@swiftsell.biz` and our team will source it out for you at the best prices
{% endhint %}


# WhatsApp Business API from Meta

Process to get the WhatsApp Business API directly from Meta

Two get the WhatsApp Business API from Meta, you need to ensure that the following 2 criteria are met;&#x20;

1. Facebook Business Manager is verified&#x20;
2. You don't have an active WhatsApp account linked with the number

### How to get the WhatsApp Business API from Meta?&#x20;

The process to obtain the WhatsApp Business API from Meta is a bit lengthy and is divided into 4 parts;&#x20;

1. Creating an Application on the Meta Developer Portal
2. Configuring the Phone Number of the Sender
3. Generating Permanent Token from Meta
4. Configuring Meta Provider on Swiftsell and setting up the Web-hook URL on Meta

Now let's understand each step in detail;&#x20;

#### Creating an Application on the Meta Developer Portal:&#x20;

To create the application on the Meta Developer Portal, you can follow the following steps;&#x20;

1. Go to the website Meta for Developers - <https://developers.facebook.com/><br>
2. Sign in to your account by clicking on 'Log In' & providing your Facebook credentials\
   &#x20;
3. After successful login, click on 'My Apps' option in the top right corner<br>
4. Click on 'Create App' <br>
5. Choose 'Business' & click on 'Next' <br>
6. Configure following; <br>
   * App Name: \
     \
     Based on your preference you can provide an appropriate name to the application like test\_app, support\_app, etc.<br>
   * Contact Email: \
     \
     Provide your email address linked with your Facebook account<br>
   * Business Account: \
     \
     Select the verified business account with which you would like the app to be associated with<br>
7. Click on 'Create App' to create the app<br>
8. Under 'Add Products to your App', click on 'Set up' against 'WhatsApp'&#x20;

{% hint style="info" %}
Once the app is created for WhatsApp, you will get a temporary token (expires in 23 hours), sender's test number, phone number ID, WhatsApp Business ID & template for testing purpose
{% endhint %}

#### Configuring the phone number of the sender:&#x20;

To link the API & run the bot on your number, you will need to configure your number. You can follow the following steps to configure the same;&#x20;

1. Go to 'Getting Started' under 'WhatsApp' on the left panel<br>
2. Go to 'Step 5: Add a Phone Number' & click on 'Add Phone Number'\
   &#x20;
3. Configure the following; <br>
   * Business Name: \
     \
     Provide the name of your business<br>
   * Business Website: \
     \
     Provide the website address of your business<br>
   * Country: \
     \
     Select the country where the business is based in<br>
4. Click 'Next' to proceed further<br>
5. Configure the following to set up a WhatsApp Business profile; <br>
   * WhatsApp Business Profile Display Name: \
     \
     That name will appear to the visitors or customers on WhatsApp<br>
   * Timezone: \
     \
     The timezone in which your business will be operating in<br>
   * Category: \
     \
     Choose the category of business from the available options <br>
   * Business Description: \
     \
     Provide a short description of what the business does. This cannot be more than 512 characters and will be displayed to the visitors or customers <br>
6. Click 'Next' to proceed further<br>
7. Verify your phone number using the code received and click 'Next' to configure the phone number

#### Generating Permanent Token:&#x20;

The next step and most important step is to generate the permanent token for the API configured with the phone number. You can follow the following steps to generate the permanent token;

1. Go to [business.facebook.com](https://business.facebook.com/)<br>
2. Go to 'Settings -> Business Settings -> Users -> System Users' <br>
3. Create a new system user by clicking on 'Add' & configure the following; <br>
   * System Username: \
     \
     Provide appropriate system username as per our preference like developer\_test etc.. <br>
   * System User Role: \
     \
     Select the role of the system user as 'Admin' <br>
4. Click on 'Create System User' to create the system user<br>
5. Once the user is created, click on 'Add Assess' under the newly created system user to assign the assets. You need to follow the following steps to assign the assets; <br>
   * Select 'Apps' as 'Assets Type'&#x20;
   * Select the newly created 'App' under 'Select Assets'&#x20;
   * Switch on 'Manage App' under 'Full Control' in 'App' <br>
6. Click on 'Save Changes' to assign assets to the created user<br>
7. Go to 'Accounts -> WhatsApp Accounts' <br>
8. Click on 'Add People' & configure the following; <br>
   * Select the recently created system user under 'Select People'&#x20;
   * Switch on 'Manage WhatsApp Account' under 'Assign Access'\
     &#x20;
9. Click on 'Assign' to save the changes<br>
10. Go back to 'Users -> System Users' <br>
11. Select recently created 'System User'\
    &#x20;
12. Click on 'Generate New Token' to create a permanent token<br>
13. Choose your created 'WhatsApp Business App' <br>
14. Check the following three permissions; <br>
    * Token Type: Permanent
    * Whatsapp\_business\_management
    * Whatsapp\_business\_messaging<br>
15. Click on 'Generate' again to generate the new token

{% hint style="info" %}
We at Swiftsell recommend having the token copied and saved offline for easy access in the future
{% endhint %}

#### Configure Meta provider on Swiftsell & set up webhook URL on Meta:&#x20;

Once the permanent token is generated, you can follow the following steps to configure the bot on your WhatsApp Number:

1. Sign in to 'Swiftsell App' - <https://app.swiftsell.biz/><br>
2. Go to 'Channel Configuration -> WhatsApp -> Configuration' <br>
3. Click on '+ Configuration' <br>
4. Configure following; <br>
   * Phone Number: \
     \
     Enter the phone number with which the APIs are linked along with the country code however without the '+' sign<br>
   * WhatsApp Business Account ID: \
     \
     Copy the WhatsApp Business Account ID from the App created on the Meta Developer Portal and paste it into the space provided<br>
   * App ID: \
     \
     Copy the App ID from the App created on the Meta Developer Portal and paste it in the space provided<br>
   * Phone Number ID: \
     \
     Copy the Phone Number ID from the App created on the Meta Developer Portal and paste it in the space provided<br>
   * Permanent Token: \
     \
     Copy and paste the permanent token generated for the app into the space provided<br>
5. Click on 'Save' to save the configuration<br>
6. Once the configuration is successful, the web-hook URL will be generated by Swiftsell. Copy the 'web-hook' URL<br>
7. Go back to the App created on the Meta Developer Portal <br>
8. Go to 'WhatsApp -> Configuration' <br>
9. Click on 'Edit' against 'Callback URL' <br>
10. Paste the 'Web-hook URL' generated by Swiftsell along with the 'Permanent Token' <br>
11. Click on 'Verify & Save' <br>
12. Click on 'Manage' against 'web-hook fields' <br>
13. Click on 'Subscribe' against 'Messages' <br>
14. Click 'Done' to activate the API on WhatsApp

{% hint style="info" %}
Once you have completed these steps, you should be able to see the bot active on WhatsApp number and able to exchange messages with the bot on WhatsApp
{% endhint %}


# Overview

Interface where you can see all the ongoing and historical conversations handled by the bot or the agents

### What is Live Chat?&#x20;

It is one feature that allows you to have text-based conversations with visitors visiting the company's media properties like the Website, WhatsApp number, or Facebook page.

### Why use Live Chat?&#x20;

It is a simple yet very effective recipe for improving customer service and loyalty. It allows you to:&#x20;

* Personalized conversations with humans
* Monitor conversations in real time
* Monitoring agents
* Proactive outreach
* Quick response to questions about the product or the service


# Live Chat Screen

All the actions that can be performed on the Live Chat screen of Swiftsell

## What functions does a Live Chat screen offer?&#x20;

|                Function                |                                             Description                                            |
| :------------------------------------: | :------------------------------------------------------------------------------------------------: |
|          Conversation Category         |                    Menu that displays the category, conversation is currently in                   |
|            Conversation List           |          List of conversations in given category. Multiple conversations make up the list          |
|          Conversation History          |             Displays the conversation history between the visitors and the bot or agent            |
|          Conversation Details          |      Right most section of the Live Chat screen that displays the details of the conversations     |
|                 Labels                 |                   Allows you to group the conversations for easy future reference                  |
|              Saved Replies             | Allows you to define the SLA, ensuring the commitment towards visitors and customers is maintained |
|          Related Conversations         |             Displays the historic conversation a visitor had with the bot or the agent             |
|         Filtering Conversation         |            Allows you to filter the conversation based on bot, visitors, category etc..            |
| Copying or Downloading Chat Transcript |    Allows you to download or copy the conversation between the visitor and the bot or the agent    |

## What qualification details are covered during the Live Chat?&#x20;

The details will be auto-populated if the System defined variables are used. Below are a few of the details that will be visible during the conversation;

<table><thead><tr><th width="198" align="center">Field</th><th align="center">Description</th></tr></thead><tbody><tr><td align="center">Name</td><td align="center">Displays the name of the visitor if they have shared it during the conversation with the bot<br></td></tr><tr><td align="center">Email</td><td align="center">Displays the email address of the visitor if the same is shared during the conversation with the bot<br></td></tr><tr><td align="center">Phone</td><td align="center">Displays the contact details of the visitor if the same is shared during the conversation with the bot<br><br>Details like Name, Email or Phone number can be edited by you or manually added as per your preference to set the context of the conversation for easy reference in future</td></tr><tr><td align="center">URL</td><td align="center">Displays the URL of the page from which the chatbot was invoked<br></td></tr><tr><td align="center">City</td><td align="center">City from where the visitor has initiated the interaction with the bot<br></td></tr><tr><td align="center">Country</td><td align="center">Country from where the visitor has initiated the interaction with the bot</td></tr><tr><td align="center">Zipcode</td><td align="center">Zipcode from where the visitor has initiated the interaction with the bot</td></tr><tr><td align="center">Country Code</td><td align="center">Two letter country code of the country from which the chat has been initiated</td></tr><tr><td align="center">Bot Name</td><td align="center">The bot with which the interaction had started</td></tr><tr><td align="center">Channel</td><td align="center">Displays the channel on which the bot is active i.e Website, WhatsApp, Facebook or SMS<br></td></tr><tr><td align="center">IP Address</td><td align="center">IP address of the visitor</td></tr><tr><td align="center">Timezone</td><td align="center">Displays the timezone of the visitor </td></tr><tr><td align="center">Browser</td><td align="center">Displays the browser through which the interaction with the bot was initiated by the visitor<br></td></tr><tr><td align="center">Browser Language</td><td align="center">Displays the language of the browser through which the conversation with the bot was initiated by the visitor <br></td></tr><tr><td align="center">OS</td><td align="center">Displays the Operating System used by the visitor during the conversation i.e Mac, Windows, Linux etc.. </td></tr><tr><td align="center">Custom Fields </td><td align="center">You can also configure the fields as per your preference that you would like to see in the conversation details. This will however be visible for web channel</td></tr></tbody></table>

{% hint style="info" %}
Details related to City, Country, and Zip Code are displayed via a third-party tool and are not always accurate
{% endhint %}

## What modifications can be performed on qualification details in Live Chat?&#x20;

You can follow the following actions to modify the qualification details in the Live Chat screen;&#x20;

<details>

<summary>Create</summary>

This feature allows you to create your own custom field and view the data by fetching it either from the variable or external source\
\
In-order to create the custom field, you can follow the following steps;&#x20;

* Click on 'Add Detail'&#x20;
* Give 'Title or Name' to the field
* Provide data source for the data to be collected from and reflected in the field
* Click on 'Save' to apply changes &#x20;

</details>

<details>

<summary>Re-Order</summary>

You have the ability to re-order or re-arrange the fields as per your preference.&#x20;

In-order to do so, you need to click on 'Top-Down Arrow' on the left of the field and 'drag & drop' to the desired position

</details>

<details>

<summary>Hide or Show</summary>

Using this feature, you can also hide or show the fields as per your preference. In-order to do so, you can follow the following steps;&#x20;

* Click on 'Edit'&#x20;
* Click on 'Eye' icon appearing on the left of the field to hide or show the particular field
* Click on 'Save' to apply the changes

</details>

<details>

<summary>Delete </summary>

Using this feature, you can delete any fields that you wish to as per your preference. In-order to delete the fields, you can follow the following steps;&#x20;

* Click on 'Edit'&#x20;
* Click on 'Thrash' icon appearing against the field name
* Click on 'Save' to apply changes

</details>

## What are various criteria available to filter out conversation?&#x20;

You can use various sets of filters to filter out the conversations. They are;&#x20;

<table><thead><tr><th width="158" align="center">Filter</th><th align="center">Description</th></tr></thead><tbody><tr><td align="center">Bot</td><td align="center">This allows you to filter out the conversations on basis of the bot i.e. if there are multiple bots under one account, you can opt for the bot which you would like to see the conversation<br></td></tr><tr><td align="center">Status</td><td align="center">This allows you to filter out the conversations based on the status of the conversation i.e. whether the conversation is open or closed<br></td></tr><tr><td align="center">Assignee</td><td align="center">Allows you to filter out the conversations based on whom the conversation is assigned to i.e. whether it is assigned to agent or bot<br></td></tr><tr><td align="center">Status</td><td align="center">This allows you to filter out the conversations based on the status of the conversation i.e. whether the conversation is open or closed<br></td></tr><tr><td align="center">Label</td><td align="center">Allows you to filter out the conversations based on the labels tagged to them<br></td></tr><tr><td align="center">Rating</td><td align="center">Allows you to filter out the conversations based on their CSAT rating<br></td></tr><tr><td align="center">Date</td><td align="center">Allows you to filter out the conversations based on the date i.e it can be single date on which the conversation happened or it can be a month during which the conversations happened or custom time frame based on your preference<br></td></tr><tr><td align="center">Keywords</td><td align="center">Allows you to filter out the conversations based on the set of keywords used in the conversation</td></tr></tbody></table>

{% hint style="info" %}
You can select either one filter or a set of filters to filter out the conversations
{% endhint %}

## How to apply filters?&#x20;

To apply filters to filter out the conversations, you can follow the following steps;&#x20;

* Access the '**Live Chat**' screen
* Click on '**Menu**' gear
* Select the '**Criteria or Filters**'&#x20;
* Click on '**Apply**' to apply the filters

{% hint style="info" %}
To reset the filters, you can click on 'Reset'&#x20;
{% endhint %}

## What kind of conversation status are there in Live Chat?&#x20;

| Conversation Status |                                         Description                                         |
| :-----------------: | :-----------------------------------------------------------------------------------------: |
|         Open        |                     A conversation which is currently active and ongoing                    |
|        Closed       | A conversation which has already happened in past & is either closed by the bot or an agent |

## In what states can the conversation be open?&#x20;

| Conversation State |                                    Description                                    |
| :----------------: | :-------------------------------------------------------------------------------: |
|         You        | Conversation where the visitor is speaking with you or any agent who is logged in |
|      Assigned      |               Conversation undertaken either by the bot or the agent              |
|     Unassigned     |   Displays all those conversations which does not have owner associated with it   |

## How do I close ongoing conversations?&#x20;

With Swiftsell, you can close the conversation with the visitor once the resolution to the query is provided by you or the agent as it indicates that there is no further action required, and also manage the ongoing chats without creating any further confusion.&#x20;

{% hint style="info" %}
You will be able to close the conversation that is either assigned to you or the agent\
\
Any conversation assigned to the bot will automatically close after a defined time
{% endhint %}

To close the conversation, you can follow the following steps;&#x20;

* Access the conversation assigned to you or an agent
* Click on 'Mark Done' on the top right corner to close the conversation

{% hint style="info" %}
The option to close the conversation will be greyed out if the conversation is assigned to the bot
{% endhint %}

## How do I copy the chat transcript?&#x20;

To copy the Chat Transcript of the Conversation, you can follow the following steps;&#x20;

* Access the '**Live Chat**' screen
* Select the conversation for which the transcript needs to be copied or downloaded
* Click on the '**Page**' icon at the top to copy the Chat Transcript
* Paste the Transcript in the Email Body or Word Document as per your preference

{% hint style="info" %}
The chat transcript will consist of a time of the chat along with the messages exchanged between the visitor and the bot
{% endhint %}

## What are Labels?&#x20;

With labels, you will not be able to group the conversations as per your preference, allowing you to filter out the conversations and access the same at any given point in time.&#x20;

### Benefits of using Labels:&#x20;

There are various benefits of using Labels however to list down a few;&#x20;

* Grouping the conversation as per their objective
* Easy access to the historic conversations&#x20;
* Prevents time consumption from filtering out the conversations&#x20;

### Use-Case Scenario:&#x20;

Let's suppose the primary objective of the bot is to generate leads. It does get difficult for the users to identify the potential lead among many conversations that the bot is handling on a day-to-day basis.&#x20;

In the above screenshot, we can notice that the user has created four labels “Intent to purchase”, “Good Lead”, “Student”, and “Debugging needed” allowing the user to group the conversation based on the purpose it serves.

### How do I access Labels?&#x20;

There are two ways through which you can access the labels in Swiftsell. They are;&#x20;

{% tabs %}
{% tab title="Live Chat" %}
The labels will be visible to you on the live chat screen along with the number of conversations tagged to them
{% endtab %}

{% tab title="Settings" %}
You can also access the labels from the 'Settings' tab by going into 'Settings -> Live Chat -> Labels'&#x20;

This screen displays all the details about the labels i.e. the name of the label, conversations tagged to it, created by, along with the date of creation and options to edit and delete the same&#x20;
{% endtab %}
{% endtabs %}

### How do I manage Labels?&#x20;

There are three ways by which labels in Swiftsell can be managed. They are;&#x20;

{% tabs %}
{% tab title="Create" %}

Creating labels in Swiftsell is pretty easy. There are two ways through which you can create the labels, they are;&#x20;

1. Through Live Chat: \
   \
   You can follow the following steps to create the labels using the Live Chat screen; <br>

   * Click on '+' or '+ Create Label'&#x20;
   * Give a name to the label as per your preference
   * Click on 'Save' to create the label

   \
   You can also click on '+ Create Another' to automatically save the current label and create the new label<br>
2. Through the Settings tab: \
   \
   This is another area from where you can create labels. You can follow the following steps to create the label using the settings tab; <br>
   * Go to 'Settings'&#x20;
   * Click on 'Live Chat'&#x20;
   * Click on 'Create Label' on the top right corner
   * Give a name to the label as per your preference
   * Click on 'Save' to create the label
     {% endtab %}

{% tab title="Modify" %}

With Swiftsell, you have the ability to modify the created labels at any given point of time i.e. you can change the name of the labels as per your preference.&#x20;

There are two ways through which the labels in Swiftsell can be modified, they are;&#x20;

1. Through Live Chat: \
   \
   You can follow the following steps to modify the created labels in Swiftsell; <br>
   * Go to 'Live Chat'&#x20;
   * Double click on 'Label Name'&#x20;
   * Edit the name of the label
   * Hit 'Enter' to save the changes<br>
2. Through Settings tab: \
   \
   You can follow the following steps to modify the created labels in Swiftsell through Settings tab; <br>
   * Go to 'Settings'&#x20;
   * Click on 'Live Chat'&#x20;
   * Click on 'Edit' against the label you wish to modify
   * Change the name of the label
   * Click on 'Update' to save the changes
     {% endtab %}

{% tab title="Delete" %}
You have the ability to delete the labels at any given point of time i.e when you feel that the label has served the purpose and that is not being used as much, they can proceed with deleting the same

There are two ways through which you can delete the created labels, they are;&#x20;

1. Through Live Chat: \
   \
   You have the ability to delete the labels through the live chat screen. You can follow the following steps in order to delete the labels; <br>
   * Go to 'Live Chat'&#x20;
   * Hover the mouse over the conversation count against the label
   * Click on 'Thrash' icon to delete the label<br>
2. Through Settings tab: \
   \
   You can follow the following steps to delete the label from the Settings tab; <br>
   * Go to 'Settings'&#x20;
   * Click on 'Live Chat'&#x20;
   * Click on 'Remove' against the label that you wish to delete
   * Provide the confirmation to delete the label by clicking on 'Delete'&#x20;

In order to delete multiple labels at once, you can check the boxes assigned to the labels that you would like to delete and click on 'Delete' at the top right corner.
{% endtab %}
{% endtabs %}

## What are Saved Replies?&#x20;

It is a snippet of text that can be quickly added to the editor when replying to the customer or the visitor.&#x20;

### Benefits of using saved replies:&#x20;

There are many benefits of using quick responses or saved replies however to highlight a few;&#x20;

* Speed up the response time&#x20;
* Tackling those issues/messages that require simple response
* Provide consistent answers to the common questions&#x20;
* Manage multiple conversations&#x20;

### Use-Case Scenario:&#x20;

Users probably get lots of routine questions that saved replies can help answer. Below are a few instances where users can try out saved replies,&#x20;

* **Hours of operation**: “Thank you for asking! Our hours are Monday – Friday from 9 am to 5 pm. We look forward to seeing you in soon!”<br>
* **Holiday Hours:** Yes! We will be closed on Christmas Day but will be open until 4 pm on Christmas Eve. Do you have any items that you are shopping for specifically?”<br>
* **Hours for specific things:** “Our lunch hours are from 11 am to 2 pm, but we serve breakfast all day – including our famous blueberry pancakes!”<br>
* **Details about special deals:** “Yes! We are running our Black Friday sale starting at 9 pm on Thanksgiving Day. First come first served on all our specials, and you can get early access to what we will have available if you sign up for our email updates here”<br>
* **Your address:** “We are located at 123 Any Street, Anywhere, ST 49505. We are right between Cliff and Garrett St. with the blue door. Come in any time we are open!”

### How do I access Saved Replies?&#x20;

There are two ways through which the 'Saved Replies' can be accessed in Swiftsell. They are;&#x20;

{% tabs %}
{% tab title="Live Chat" %}
You can access Saved Replies from the Live Chat screen by joining the conversation & clicking on the 'Bookmark' sign or typing '/' in the chat window
{% endtab %}

{% tab title="Settings" %}
Or you can also access the Saved Replies in Swiftsell through 'Settings' tab. Following is the path to access the Saved Replies from Settings tab;&#x20;

'Go to Settings -> Live Chat -> Saved Replies' \
\
Every Saved Reply will be shared across with all the users of the account, allowing them to use the same message

Admin will have the ability to see which Saved Reply is being used the most
{% endtab %}
{% endtabs %}

### How do I manage Saved Replies?&#x20;

There are three ways to manage saved replies in Swiftsell. They are;&#x20;

{% tabs %}
{% tab title="Create" %}

Creating Saved Replies in Swiftsell is pretty easy. There are two ways through which the Saved Replies can be created;&#x20;

1. Through Live Chat:\
   \
   To create Saved Replies via Live Chat, you can follow the following steps; <br>
   * Go to 'Live Chat'&#x20;
   * Click on 'Join the Conversation'&#x20;
   * Click on 'Bookmark' or type '/'  to access the Saved Replies&#x20;
   * Click on '+ Create Saved Reply'&#x20;
   * Give 'Title' & define the 'Message or Reply'&#x20;
   * Click on 'Create' to create the Saved Reply<br>
2. Through Settings:\
   \
   To create the Saved Replies via Settings, you can follow the following steps; <br>
   * Go to 'Settings'&#x20;
   * Go to 'Live Chat'&#x20;
   * Go to 'Saved Replies'&#x20;
   * Click on 'Create Saved Reply' on the top right corner
   * Give 'Title' & define the 'Message or Reply'&#x20;
   * Click on 'Create' to create the Saved Reply
     {% endtab %}

{% tab title="Modify" %}

You have the ability to modify the existing created Saved Replies i.e at any given point of time, if you want, you can change the title or message of the saved reply as per your preference.&#x20;

There are two ways through which the Saved Replies can be modified, they are;&#x20;

1. Through Live Chat:\
   \
   To modify Saved Replies via Live Chat, you can follow the following steps; <br>
   * Go to 'Live Chat'&#x20;
   * Click on 'Join the Conversation'&#x20;
   * Click on 'Bookmark' or type '/' to access the Saved Replies&#x20;
   * Hover over the 'Saved Reply' to see the 'Pencil' icon&#x20;
   * Click on 'Pencil' icon to edit the 'Title & Message' of the Saved Reply&#x20;
   * Click on 'Update' to save the changes<br>
2. Through Settings:\
   \
   To create the Saved Replies via Settings, you can follow the following steps; <br>
   * Go to 'Settings'&#x20;
   * Go to 'Live Chat'&#x20;
   * Go to 'Saved Replies'&#x20;
   * Click on 'Edit' against the Saved Reply
   * Edit the 'Title & Message' of the Saved Reply&#x20;
   * Click on 'Update' to save the changes
     {% endtab %}

{% tab title="Delete" %}
You do have the ability to delete the Saved Replies through the Live Chat screen i.e if you feel that a particular Saved Reply is not being put to use often, you can further proceed and delete the same.&#x20;

There are two ways through which the Saved Replies can be deleted, they are;&#x20;

1. Through Live Chat:\
   \
   To delete the Saved Reply through the Live Chat, you can follow the following steps;\
   &#x20;
   * Go to 'Live Chat'&#x20;
   * Click on 'Join the Conversation'&#x20;
   * Click on 'Bookmark' or type '/' to access the Saved Reply
   * Hover over the 'Saved Reply' to see the 'Thrash' icon
   * Click on 'Thrash' icon to delete the Saved Reply \
     &#x20;
2. Through Settings: \
   \
   To delete the Saved Reply via Settings, you can follow the following steps; <br>
   * Go to 'Settings'&#x20;
   * Go to 'Live Chat'&#x20;
   * Go to 'Saved Replies'&#x20;
   * Click on 'Remove' against the Saved Reply
   * Click on 'Delete' to delete the Saved Reply

In-order to delete multiple Saved Replies, you can select the saved replies by checking the boxes on the left & then click on delete / remove at the top right corner.&#x20;

Saved Replies once deleted will not be recovered again and you will have to create the reply all over again
{% endtab %}
{% endtabs %}

## What are Related or Past conversations?&#x20;

In Swiftsell, you can access and review all the historical conversations between the bot or the agent and the visitors, providing you the insights about the talking points.&#x20;

It is quite helpful from a support use case as while the agent talks to the visitor, they can quickly check the previous conversations with the visitors so that accordingly further assistance can be provided.&#x20;

### How do I access Related or Past Conversations?&#x20;

You can follow the following steps to access the Related or Past Conversations;&#x20;

* Access the 'Live Chat' screen
* Select the conversation
* If the visitor is a known visitor, the details about the historical conversation will be visible under 'Related Conversation' on the right side of the screen
* Click on a conversation to review the historical conversation

{% hint style="info" %}
The related conversation will also display details about who closed the conversation and when it was closed

\
The historic conversation will open up in new window for review
{% endhint %}

## What is a historical conversation in Live Chat?&#x20;

It is part of the live chat screen that displays the historical conversation between the visitors and the bot or the agent

### What are the elements of historical conversation in live chat?&#x20;

|           Element          |                                                                                                                                                                                                                                                                                                                                                                         Description                                                                                                                                                                                                                                                                                                                                                                         |
| :------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|            Owner           |                                                                                                                                                                                                                                                                                                  <p>Displays the current owner of the conversation. By default it is the bot, however if there is no owner assigned, then 'Unassigned' is displayed<br></p>                                                                                                                                                                                                                                                                                                 |
|         Visitor ID         |                                                                                                                                                                                                                                                                                          <p>It reflects the unique ID assigned to the visitor by Swiftsell. The same is replaced by the name of the visitor if the same is provided during the conversation<br></p>                                                                                                                                                                                                                                                                                         |
|    Copy Chat Transcript    |                                                                                                                                                                                                                                                                                                       <p>Allows you to copy the entire conversation to the clipboard which can be further pasted in Email or any other tool as per preference<br></p>                                                                                                                                                                                                                                                                                                       |
|     Close Conversation     |                                                                                                                                                                                                                                                                                                                <p>There is a button 'Mark Done' that allows you to close or address the conversation & move it to the close category<br></p>                                                                                                                                                                                                                                                                                                                |
|    Transfer Conversation   |                                                                                                                                                                                                                                       <p>You do have the ability to transfer the conversation from one agent or bot to another depending upon their availability or requirement. <br><br>To transfer the conversation, you can click on the bot & select the agent or teammate to whom it needs to be transferred </p>                                                                                                                                                                                                                                      |
| Show or Hide Contact Panel |                                                                                                                                                                                                                                                                                                             <p>You have the ability to minimise or maximise the control panel on click of a button providing extra space and visibility<br></p>                                                                                                                                                                                                                                                                                                             |
|            Body            | <p>The body displays the messages that have been exchanged between the visitor and the bot or the agent, similar to what is shown in the chat interface. <br><br>This area of the screen allows you to respond back to the visitor's query or question either by joining the conversation or initiating the manual human handover. The agent can respond back to the visitors via text or media file.<br><br>Media only supports images. If any other file formats are uploaded, Swiftsell will send the public URL of that file.<br><br>Once you join the conversation, you have the ability to interact with the visitor and share the information as per the visitors requirements. You can also reply quickly to visitor by using the saved replies</p> |


# Live Chat Settings

All the configuration settings for the live chat i.e ensuring that the agents are not overburdened with the chats or defining the timeline within which the agents needs to respond

## What parameters can I configure?&#x20;

|           Parameter           |                                                                                                              Description                                                                                                             |
| :---------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|     Conversation Threshold    | <p>Allows you to set the limit for the number of chats an agent will be handling simultaneously. <br><br>This helps to ensure that agents are not overloaded with the chats. Maximum limit for the conversation threshold is 99 </p> |
| Service Level Agreement (SLA) |                                                             This setting allows you to set the timer within which the visitor message needs to be responded by the agent.                                                            |
|      Auto Close Duration      |                       Allows you to set the timer to close the conversation if no response is received from the customer. Maximum time post which the conversation will auto closed is 24 hours (1440 Minutes)                       |
|        Field Visibility       |                                              Defines the maximum number of fields that are visible in a list. Beyond this, you will see 'Show More' to expand the list and see its value                                             |
|  Conversation Card Properties |                                                          Configure what are the default fields visible to you or the agent on the conversation card column of the live chat                                                          |

## Agent Availability:&#x20;

You will be able to define the availability of the agents to ensure that the agents are available to speak with the visitors as per the request i.e. defining the time or day

### What are the parameters to define the availability of the agents?&#x20;

Below are a few of the parameters that you can configure to define the availability of the agents in Swiftsell;&#x20;

|        Parameter        |                                                                                                                                                                                                                                                                                                                                                                            Description                                                                                                                                                                                                                                                                                                                                                                            |
| :---------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
|  Human Handover Switch  |                                                                                                                                                                             <p>Turning this switch on, the system will continue to transfer the conversations to agents wherever the Human Handover action block is used<br><br>If it is turned off, even though you have used the Human Handover action block, the action will not take place<br><br>This will only work if you have created the Team in Swiftsell and have used the Human Handover action block in the bot flow</p>                                                                                                                                                                             |
| Unassigned Conversation |                                                                                                                                                                                                                         <p>Makes sure that the conversation is still available in the 'Unassigned' queue so that when the agents become available, they can take over the conversation. <br><br>Unchecking this setting will ensure that the conversation is closed if the Human Handover fails due to the unavailability of the team</p>                                                                                                                                                                                                                         |
|     Operation Hours     | <p></p><p>You can define the operational hours of the agents. This will be ensuring that the Human Handover is working only on the selected day & time<br></p><p><strong>Days:</strong> <br><br>You will be able to select the days i.e Monday, Tuesday etc.. when the agents will be available to speak with the visitors<br><br>Human Handover will fail if any visitor request to speak with the agent outside the selected / operated days<br></p><p><strong>Time:</strong> <br><br>You can select the time frame i.e for instance user can select the time from 8:00 AM to 6:00 PM when the agents will be available to speak with the visitors<br><br>Human Handover will fail if any visitor request to speak with the agent outside operational hours</p> |

## Human Handover Configuration:&#x20;

Allows you to configure the action block that would invoke the Human Handover action at a point in the conversation flow, thereby transferring the control of the chat from the bot to the agent&#x20;

### When should I use it?&#x20;

* Transferring the chat to a Human-agent
* Involving your support team when the bot does not answer the questions

### How do I set it up?&#x20;

You can follow the following steps to set the Human Handover functionality;&#x20;

* Go to 'Settings -> Live Chat -> Human Handover'
* Switch on the 'Human Handover' functionality
* Configure the agent availability under 'Operational Hours'&#x20;
* Add teammates in the 'Teammates' tab under 'Settings -> Account -> Teammates'&#x20;
* Create teams through the 'Teams' tab under 'Settings -> Account -> Teams'&#x20;
* Create a bot in the Bot Builder & add a 'Human Handover' action block in the flow
* Configure the 'Human Handover' block

### What happens when the Human Handover is successfully invoked?&#x20;

* The agents of the team will get the browser notification about the Human Handover action has occurred<br>
* The agents will be able to reply to the chat assigned to them from the Live Chat screen

{% hint style="info" %}
The agents will not be able to transfer the conversation back to the bot and hence this will be considered to be the end of the flow\
\
The agents will have to click on 'Mark Done' to close the conversation
{% endhint %}

### What are the different scenarios when Human Handover can fail?&#x20;

1. Human Handover is disabled&#x20;
2. When no agent is available&#x20;
3. When Human Handover occurs beyond operational hours

{% hint style="info" %}
Upon failure of this action block, the failure message configured by you in the action block will be sent to the visitor by the bot
{% endhint %}


# Overview

Looking forward to run campaigns on WhatsApp? Well we've got you covered.

Outbound bot is the marketing or sales initiative in which a company invest to reach out to their potential customers or clients proactively. It allows you to contact individuals or businesses via WhatsApp to promote a product, service, or special offer.&#x20;

Outbound bot helps in executing planned campaigns by businesses to generate leads, increase sales, or build brand awareness.&#x20;

### What are the types of Outbound bots I can build with Swiftsell?&#x20;

There are two types of outbound bots that can be built with Swiftsell;&#x20;

1. One Off Campaign
2. Ongoing Campaign


# Building One Off Campaign

Send a one-time campaign to a set of contacts on WhatsApp, SMS or email.

### Pre-requisites:&#x20;

Depending on the channel you want to run your campaigns on, you would need,

* Email API (Supported partner: TechAlpha)
* SMS API (Supported partner: Twilio)
* WhatsApp API (Supported partner: Meta, 360dialog, Twilio, GupShup, TechAlpha, Unifonic)

{% hint style="info" %}
If you do not have an API, you can reach out to sales at [**support@swiftsell.biz**](mail:support@swiftsell.biz)
{% endhint %}

### Step 1: Create an outbound bot using a one-off campaign

Go to the bot builder page, choose to create an outbound bot, and select one-off as your campaign preference.

### Step 2: Upload your contacts

Click on the 'Trigger' action block and upload a 'CSV' file which contains the contacts you want to reach out to.&#x20;

Once uploaded, you need to map the columns of the CSV with the variables on your account. This mapping is done to help you dynamically replace values in the messages of your campaigns.&#x20;

For example, if you want to include a message like *"Hello {name}, glad we could meet on {date}",* you need to store the name and date field in the contact mapping.

<figure><img src="https://2580337444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2FACxKfwMRjzdDHmC4S4L9%2FCleanShot%202023-12-29%20at%2018.42.46.png?alt=media&#x26;token=50bc2df9-1b44-4fdc-b0b7-69a3204a25f6" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
We consider the first row of the 'CSV' file as the column heading, these headings will be shown in the mapping of variables.
{% endhint %}

{% hint style="warning" %}
It is mandatory to have a phone/email field mapped, in order to be able to send a campaign to contacts.&#x20;
{% endhint %}

### Step 3: Create your outbound flow

Add an outbound block like **Send SMS** or **Send WhatsApp** and configure its fields on the right panel.

The configuration fields would differ based on the channel you use.&#x20;

### Step 4: Deploy your bot to run your campaign

Once your flow has been created, double-check all the messages for typos or any other mistakes and hit **Deploy**. \
\
A confirmation prompt will be shown to you for final approval before launching the campaign

{% hint style="info" %}
Once the bot is deployed, **it cannot be stopped**. All contacts will start getting the messages that you have defined&#x20;
{% endhint %}

### Step 5: See the results

Once the bot is deployed, it may take a few minutes for the bot to finish sending all the messages to the recipients. This delay may vary based on the contact list and the API provider you have used.&#x20;

Post that you can see the results of the campaign. Click on the numbers to go to a deeper view and be able to download a CSV which will contain the results of the campaign on a per-contact basis.

<figure><img src="https://2580337444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2FX8nzi3irZ06mrHU7V4IE%2FCleanShot%202023-12-29%20at%2018.50.19.png?alt=media&#x26;token=2a07a357-1de6-4b3e-b4b8-09152a0520b8" alt=""><figcaption><p>Results of a campaign</p></figcaption></figure>

Status fields you will see are,

<table><thead><tr><th width="144">Status</th><th>Meaning</th></tr></thead><tbody><tr><td>Sent</td><td>The contact has been sent the message.</td></tr><tr><td>Failed</td><td>The message was undeliverable to the contact.</td></tr><tr><td>Delivered</td><td>The message was delivered to the contact.</td></tr><tr><td>Seen</td><td>The message was seen by the contact (Only on WhatsApp)</td></tr><tr><td>Replied</td><td>The message was replied back by the contact.</td></tr><tr><td>Clicked</td><td>The message had a link which was clicked (Only on Email)</td></tr></tbody></table>


# Building Ongoing Campaign

Trigger the outbound bot to start its campaign using webhooks to send the contact data.

### Pre-requisites:&#x20;

Depending on the channel you want to run your campaigns on, you would need,

* Email API (Supported partner: TechAlpha)
* SMS API (Supported partner: Twilio)
* WhatsApp API (Supported partner: Meta, 360dialog, Twilio, GupShup, TechAlpha, Unifonic)

{% hint style="info" %}
If you do not have an API, you can reach out to sales at **`support@swiftsell.biz`**
{% endhint %}

### Step 1: Create an outbound bot using a one-off campaign

Go to the bot builder page, choose to create an outbound bot, and select **Ongoing** as your campaign preference.

### Step 2: Configuring the webhook

Click on the 'Trigger' action block and choose the **Webhook URL**. Our webhook will be listening for the required contact payload to trigger them into the outbound campaign.&#x20;

You will need the following to trigger this webhook URL,

* **Webhook URL** - Present on the trigger of the outbound bot
* **Authorization token** - Go to Settings > Account Settings > Token
* **Payload** - The contact data that you want to send

```json
// Example of a single contact payload
[
    {
    "name": "Nick Grey", 
    "phone": "18181818181",
    "email": "nick@swiftsell.biz"
    }
]

// You can send an array of contacts in a single request
[
    {
    "name": "Nick Grey", 
    "phone": "18181818181", 
    "email": "nick@swiftsell.biz"
    },
    {
    "name": "Shaun Williams", 
    "phone": "18282828282", 
    "email": "shaun@swiftsell.biz"
    }
]
```

{% hint style="info" %}
Max limit of contact records is **10,000 contacts** in a single request
{% endhint %}

### Step 3: Mapping the API response fields to variables

Simply map the API response fields with the contact variables that you want to save it in.&#x20;

This mapping is done to help you dynamically replace values in the messages of your campaigns.&#x20;

For example, if you want to include a message like *"Hello {name}, glad we could meet on {date}",* you need to store the name and date field in the contact mapping.

{% hint style="danger" %}
It is mandatory to have a phone/email field mapped, to be able to send a campaign to contacts.&#x20;
{% endhint %}

### Step 4: Create your outbound flow

Add an outbound block like **Send SMS** or **Send WhatsApp** and configure its fields on the right panel.

The configuration fields would differ based on the channel you use.&#x20;

### Step 5: Deploy your bot to run your campaign

Once your flow has been created, double-check all the messages for typos or any other mistakes and hit **Deploy**. \
\
A confirmation prompt will be shown to you for final approval before launching the campaign.

<figure><img src="https://2580337444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2F7dUaKMFOnRtq8NopAMZs%2FCleanShot%202023-12-29%20at%2019.10.40.png?alt=media&#x26;token=84c857de-6bd2-46ee-9bbe-87d6e6311ec8" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
You can turn off your outbound bot, if you do not want to accept any new requests.&#x20;
{% endhint %}

### Step 6: See the results

Once the bot is deployed, it may take a few minutes for the bot to finish sending all the messages to the recipients. This delay may vary based on the contact list and the API provider you have used.&#x20;

Post that you can see the results of the campaign. Click on the numbers to go to a deeper view and be able to download a CSV which will contain the results of the campaign on a per contact basis.

<figure><img src="https://2580337444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsrMxU8nO3RjusUiYuXBB%2Fuploads%2FX8nzi3irZ06mrHU7V4IE%2FCleanShot%202023-12-29%20at%2018.50.19.png?alt=media&#x26;token=2a07a357-1de6-4b3e-b4b8-09152a0520b8" alt=""><figcaption><p>Results of a campaign</p></figcaption></figure>

Status fields you will see are,

<table><thead><tr><th width="144">Status</th><th>Meaning</th></tr></thead><tbody><tr><td>Sent</td><td>The contact has been sent the message.</td></tr><tr><td>Failed</td><td>The message was undeliverable to the contact.</td></tr><tr><td>Delivered</td><td>The message was delivered to the contact.</td></tr><tr><td>Seen</td><td>The message was seen by the contact (Only on WhatsApp)</td></tr><tr><td>Replied</td><td>The message was replied back by the contact.</td></tr><tr><td>Clicked</td><td>The message had a link which was clicked (Only on Email)</td></tr></tbody></table>


# Creating a WhatsApp Template

WhatsApp templates are mandatory to send a proactive WhatsApp message to your contacts. With WhatsApp explicit approval on that template message, you are not allowed to send a message to a contact

With Swiftsell, you can create and submit your WhatsApp templates directly to WhatsApp for approval. You can easily view all templates that are Approved or Rejected.&#x20;

### Guidelines:&#x20;

Before we start creating the templates with Swiftsell, let us first understand the guidelines about the WhatsApp template message set by the Meta team that you need to follow;&#x20;

<table data-header-hidden><thead><tr><th width="166"></th><th></th></tr></thead><tbody><tr><td>Clarity</td><td>Be specific and clear. The reviewers at Meta team may not know about the business and hence needs more clarity</td></tr><tr><td>Avoid Promotion</td><td>Upselling, cold call message, sending poll to collect the data &#x26; including certain phrases that sound promotional are all considered promotional</td></tr><tr><td>Spelling</td><td>Check for the spelling and grammatical errors and proper formatting</td></tr><tr><td>Template Name</td><td>Make template name clear. Instead of using names like template or template0123 etc.. use names like welcome_new_user</td></tr><tr><td>Clear Context</td><td>Remember someone at the Meta team will be reviewing the templates and hence giving more clarity will give the reviewers more context about how the template will be used</td></tr><tr><td>Appropriate Category</td><td>Choosing the appropriate category will increase the chances of getting the template approved from Meta team. Various categories are Transactional, One Time Password &#x26; Marketing</td></tr><tr><td><strong>Header</strong></td><td><p></p><p>Adding the title or media file which will serve as the header of the message. You can use Title, Image, Video or PDF as the header</p></td></tr></tbody></table>

### &#x20;How do I build a WhatsApp Template?&#x20;

To build the template with Swiftsell, you need to follow the following steps;&#x20;

* Go to 'Channel Configuration -> WhatsApp -> Template Message' <br>
* Click on 'Add Template' to create a new template<br>
* Provide template name

{% hint style="info" %}
Since we cannot use 'Space' in the template name, for better understanding and identification '\_*'* can be used. \
\
The message template name field is limited to 512 characters. WhatsApp Business Account can have up to 250 templates & each of them can have multiple language translations. \
\
For example: welcome\_new\_user translated in two languages counts as single message templates in regards to this limit.&#x20;
{% endhint %}

* Select 'Template Category' from the list of available categories<br>
* Select 'Language' from the available list<br>
* Select the type of 'Header' from the available categories \
  \
  There are 4 types of categories available under Header. They are; <br>
  * Text
  * Image
  * Document
  * Video<br>
* Add 'Footer' <br>
* Select type of action on message: <br>

  You can select what type of response you are seeking from the message, that is, do you want the visitor to call you for more information or visit your website or have no response at all \
  \
  There are three types of actions that you can select for the message; <br>

  * No Buttons: \
    \
    You can opt to have no response back to the message that has been sent out to the visitors  by selecting 'No Buttons' <br>
  * Call to Action: \
    \
    Call-to-action buttons allow you to provide the option for the visitor to visit the website or call the customer care number. You will not be able to add more than two buttons<br>
  * Quick Reply: \
    \
    Allows you to provide options to the visitor to quickly reply back to the message that has been sent. A maximum of up to three buttons can be added to the message<br>
* Select 'WhatsApp Business Number'&#x20;

### Best Practices:&#x20;

Following are a few suggestions to maintain high-quality messages;&#x20;

* Message needs to be compliant with WhatsApp Business Policy
* Send Messages to only those who have opted in to receive messages from your business
* Messages need to be highly personalized and useful to visitors. Avoid open-ended messages
* Keeping track of the frequency of messages sent to the visitors during the day. Avoid sending too many messages in a single day
* Informational messages need to be optimized for content and length


