Voice APIGọi ra agent click-to-call

Gọi ra agent click-to-call

Lê Đức Tuệ·4/17/2026

API thực hiện cuộc gọi ra từ hệ thống đến số điện thoại khách hàng. Cuộc gọi sẽ được kết nối qua chiến dịch (campaign) đã chỉ định — phù hợp cho agent nhấn nút "Gọi" trên giao diện CRM/tổng đài để hệ thống tự quay số và kết nối với khách hàng.

Xác thực: Request cần gửi header X-Api-Key. Liên hệ Alohub để được cấp API Key.

Yêu cầu: Endpoint yêu cầu campaignId hợp lệ. Sử dụng Campaign API để lấy danh sách chiến dịch và ID tương ứng.


Endpoint

POST {{base_url}}/v1/voice/click-to-call

Headers

Header

Bắt buộc

Mô tả

X-Api-Key

API Key xác thực

Content-Type

application/json

Request Body

Tham số

Kiểu

Bắt buộc

Mô tả

phone

string

Số điện thoại khách hàng cần gọi

campaignId

number

ID chiến dịch

transactionId

string

Không

ID giao dịch do client tạo ra để đối chiếu kết quả qua webhook

Code mẫu

curl --location -g '{{base_url}}/v1/voice/click-to-call' \
  --header 'X-Api-Key: {{api_key}}' \
  --header 'Content-Type: application/json' \
  --data '{
    "phone": "0123456789",
    "campaignId": 1,
    "transactionId": "TXN_001"
  }'
const axios = require('axios')

const response = await axios.post('{{base_url}}/v1/voice/click-to-call', {
  phone: '0123456789',
  campaignId: 1,
  transactionId: 'TXN_001'
}, {
  headers: {
    'X-Api-Key': '{{api_key}}',
    'Content-Type': 'application/json'
  }
})

console.log(response.data)
import requests

response = requests.post('{{base_url}}/v1/voice/click-to-call',
  json={
    'phone': '0123456789',
    'campaignId': 1,
    'transactionId': 'TXN_001'
  },
  headers={
    'X-Api-Key': '{{api_key}}',
    'Content-Type': 'application/json'
  }
)

print(response.json())

Webhook callback: Sử dụng transactionId do client tạo để đối soát kết quả cuộc gọi khi Alohub gọi webhook trả kết quả. Xem Voice Webhook để biết format payload và cách xác thực.

Was this article helpful?
Updated: 4/17/2026
để chuyển bài