Campaigns

Create Campaign Dispatch

Updated on October 4, 2024

Single Send

A Single Send is essentially the creation of a campaign dispatch for an existing campaign, targeting a single contact. This feature allows users to send individual messages, such as WhatsApp API Official template messages, or similar communications, to one specific recipient via the Talqui platform using the API.

However, in Talqui, we do not refer to these messages by channel-specific terms like "template messages." Instead, Talqui adopts a unified, omni-channel approach where all message dispatches, regardless of the channel—whether WhatsApp, Instagram, Telegram, or others—are called campaign dispatches. This terminology ensures that the system remains flexible and agnostic to the specific communication channel, making it suitable for any integrated messaging service.

How It Works

When you initiate a Single Send, what happens under the hood is the creation of a campaign dispatch for an existing campaign, which is then associated with the target contact. This dispatch can be sent immediately or scheduled for a later time, depending on your use case. The process remains consistent across all communication channels, allowing for seamless integration into workflows and other external systems.

The creation of a campaign dispatch for a single contact serves as an extension of an existing campaign. You add the contact to the campaign, and Talqui takes care of generating and sending the dispatch at the specified time, with full tracking and logging. This approach ensures consistency across channels, while providing you with detailed metrics on each dispatch's success, failure, or status.

Through this mechanism, the system offers flexibility for automated processes and ensures that content consistency, controlled delivery, and results tracking are always maintained. Whether used for immediate one-on-one interactions or integrated into larger, automated workflows, the creation of a campaign dispatch for a single contact is a powerful tool within Talqui’s omni-channel messaging system.


Step-by-Step Guide for Creating a Campaign Dispatch:

This step by step guide will introduce you how to integrate external apps requesting single campaign dispatch to specific contact, if you need a bulk send ( regular campaign experience ) do it using interface or regular API endpoints.

Step 1: Listing All Campaigns

The first step is to retrieve a list of all the existing campaigns. This will allow you to identify the Campaign ID of the campaign you want to use for the Single Send.

You, can request this below endpoint to read all campaigns at Talqui but to do it you must be be authenticated, if you don't know how authentication works, click here. The objective of that request is to find the Campaign ID of the campaign that you have been created earlier ( Or follow this guide. ). You will need this Campaign ID for the subsequent steps.

curl --location --request GET 'https://api.talqui.chat/tenants/:tenantID/campaigns' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_AUTH_TOKEN>'

Run In Postman


Step 2: Reading the Campaign via API

Once you have the Campaign ID, the next step is to retrieve the details of that specific campaign. This will allow you to confirm that the campaign is eligible for a Single Send. The request to read a campaign will provide detailed information about its status and content.

The campaign must meet the following conditions:

  • The status of the campaign must be success (indicating that it has already been successfully sent to at least one contact).
  • The campaign should not contain any cancellation flags (such as a canceledAt status).
If the campaign contains a canceledAt status, it will not be eligible for further dispatches or single sends.
curl --location --request GET 'https://api.talqui.chat/tenants/:tenantID/campaigns/:campaignID' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_AUTH_TOKEN>'

Step 3: Creating a Campaign Dispatch

Now that you have the Campaign ID, the final step is to create a new Campaign Dispatch. This request adds a contact to an existing campaign with a successful status, allowing the campaign to send a new message to the specified contact.

The primary goal of this request is to deliver the campaign message to a single contact by creating a Campaign Dispatch specifically for that contact.

curl --location --request POST 'https://api.talqui.chat/tenants/:tenantID/campaigns/:campaignID/dispatches' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <YOUR_AUTH_TOKEN>'
--data '{
 "contactFirstname": "Steve",
 "contactLastname": "Jobs",
 "contactEmail": "steve@apple.com",
 "contactPhone": "5511912939901",
 "contactExternalID": "5511912939901"
}'

When you execute this request, a new Campaign Dispatch will be created for the contact included in the payload. In this request, you can provide the Contact ID if you already know it, or simply include the contact external ID (contactExternalID), such as their WhatsApp number.

Here’s how the process works:

  • You can either pass the Contact ID if the contact already exists in Talqui, or provide the contact’s information (name, phone number) directly in the request payload.
  • Talqui will attempt to identify the contact based on the provided details. If the contact does not already exist in the database, Talqui will automatically create a new Contact ID synchronously at the time of the request.
  • Once the Contact ID is created or identified, it will be added to the campaign, and a Campaign Dispatch will be generated for that contact.

Retrieving Campaign Dispatch Details

After submitting the request, a Campaign Dispatch will be created for the specified contact. If you wish to request additional details about the dispatch or track its status, you can click here for more information on how to retrieve Campaign Dispatch details.