# Building Ongoing Campaign

### 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>
