Voice APIOutbound calls by campaign

Outbound calls by campaign

Tạ Quốc Thắng·4/17/2026

1. Overview

to add customers to the automatic calling campaign on the Alohub platform.

Information Details
Base URL {{baseUrl}}/api— Alohub provides a separate one for each tenant
Authentication Header Authorization: {{apikey}}
Content-Type application/json
Protocol HTTPS
Note: The value {{baseUrl}}and {{apikey}}are provided by Alohub. Contact Alohub to receive information.

2. Add customers to the campaign

POST /crm/addCampaignCustomer?userName={{userName}}

Add customer phone numbers to the Auto Call campaign. The system will automatically queue and make calls according to the campaign configuration.

Query Parameters

Param Required Description
userName Yes The account name making the request (used for audit log recording)

Request Body

{
  "phone": "84901234567",
  "campaignId": 12345,
  "externalId": "CUST-2024-001",
  "otp": "123456"
}
Param Type Required Description
phone string Yes Customer phone number (recommended format 84xxx)
campaignId integer Yes Auto Call campaign code (obtained from the Alohub CRM interface)
externalId string No Reference code from the external system, used for reconciliation
otp string No Text-to-speech content for the OTP reading campaign. The system will read this value to the customer

Sample code

curl -X POST "{{baseUrl}}/api/crm/addCampaignCustomer?userName=admin01" \
  -H "Authorization: {{apikey}}" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "84901234567",
    "campaignId": 12345,
    "externalId": "CUST-2024-001",
    "otp": "123456"
  }'
const axios = require('axios')

const BASE_URL = '{{baseUrl}}/api'
const API_KEY  = '{{apikey}}'

async function addCampaignCustomer() {
  try {
    const response = await axios.post(
      `${BASE_URL}/crm/addCampaignCustomer`,
      {
        phone: '84901234567',
        campaignId: 12345,
        externalId: 'CUST-2024-001',
        otp: '123456'
      },
      {
        params: { userName: 'admin01' },
        headers: {
          'Authorization': API_KEY,
          'Content-Type': 'application/json'
        }
      }
    )
    console.log('Thành công:', response.data)
  } catch (error) {
    console.error('Lỗi:', error.response?.data || error.message)
  }
}

addCampaignCustomer()
import requests

BASE_URL = "{{baseUrl}}/api"
API_KEY  = "{{apikey}}"

response = requests.post(
    f"{BASE_URL}/crm/addCampaignCustomer",
    params={"userName": "admin01"},
    headers={
        "Authorization": API_KEY,
        "Content-Type": "application/json"
    },
    json={
        "phone": "84901234567",
        "campaignId": 12345,
        "externalId": "CUST-2024-001",
        "otp": "123456"
    }
)

if response.ok:
    print("Thành công:", response.json())
else:
    print("Lỗi:", response.status_code, response.text)

3. Usage scenarios

Automatic OTP call

otp, the system will use text-to-speech to read the code to the customer.

{
  "phone": "84912345678",
  "campaignId": 100,
  "otp": "482916"
}

Auto call marketing

otp

{
  "phone": "84987654321",
  "campaignId": 200,
  "externalId": "LEAD-2024-500"
}

Synchronization from external systems

externalIdto link customers between the external CRM system and Alohub,

Webhook: When the campaign call ends, Alohub sends real-time events via webhook. See detailed payload, status code, and sample code handling in the Webhook call event article.

4. Important notes

The campaign must be active: The value campaignIdmust be the code of the campaign that is in an active state (Active).
Phone number format: Phone numbers should be in the format 84xxx— drop the leading 0, add country code 84. 090123456784901234567.
Tracking with externalId: Use externalIdto link customers between your system and Alohub,
Was this article helpful?
Updated: 4/17/2026
để chuyển bài