Voice APITra cứu cuộc gọi

Tra cứu cuộc gọi

Nhữ Hào Nam·17/4/2026

Nhóm API truy vấn nhật ký cuộc gọi (CDR – Call Detail Record): tìm kiếm danh sách cuộc gọi theo khoảng thời gian và xem chi tiết một cuộc gọi cụ thể (bao gồm recording_url và transcript).

Header xác thực chung

Header

Giá trị

Mô tả

Authorization

<api_key>

API key của tenant

X-ACCESS-TOKEN

<jwt_token>

JWT token sau khi đăng nhập

Content-Type

application/json

Bắt buộc với request có body (POST)

Lấy API key: Liên hệ Alohub để được cấp API key cho tenant.


1. Danh sách cuộc gọi (CDR)

POST https://app.alohub.vn:9909/api/report/call-logs

Lấy danh sách nhật ký cuộc gọi trong khoảng thời gian chỉ định, có phân trang.

Request Body

{
  "callStartTime": "2025-04-13T00:00:00+07:00",
  "callEndtime":   "2026-04-13T23:59:59+07:00",
  "page":          1,
  "limit":         50
}

Mô tả field

Field

Kiểu

Bắt buộc

Mô tả

callStartTime

string

Thời điểm bắt đầu (ISO 8601 với timezone). VD: "2025-04-13T00:00:00+07:00"

callEndtime

string

Thời điểm kết thúc (ISO 8601 với timezone)

page

number

Trang hiện tại (bắt đầu từ 1)

limit

number

Số record mỗi trang

Lưu ý: Tên field là callEndtime (không phải callEndTime) — chú ý chữ thường chữ hoa theo đúng spec backend.

Code mẫu

curl --location 'https://app.alohub.vn:9909/api/report/call-logs' \
  --header 'Accept: application/json, text/plain, */*' \
  --header 'Authorization: <api_key>' \
  --header 'X-ACCESS-TOKEN: <jwt_token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Requested-With: XMLHttpRequest' \
  --data '{
    "callStartTime": "2025-04-13T00:00:00+07:00",
    "callEndtime": "2026-04-13T23:59:59+07:00",
    "page": 1,
    "limit": 50
  }'
const axios = require('axios')

const response = await axios.post(
  'https://app.alohub.vn:9909/api/report/call-logs',
  {
    callStartTime: '2025-04-13T00:00:00+07:00',
    callEndtime: '2026-04-13T23:59:59+07:00',
    page: 1,
    limit: 50
  },
  {
    headers: {
      'Accept': 'application/json, text/plain, */*',
      'Authorization': '<api_key>',
      'X-ACCESS-TOKEN': '<jwt_token>',
      'Content-Type': 'application/json',
      'X-Requested-With': 'XMLHttpRequest'
    }
  }
)

console.log(response.data)
import requests

response = requests.post(
  'https://app.alohub.vn:9909/api/report/call-logs',
  json={
    'callStartTime': '2025-04-13T00:00:00+07:00',
    'callEndtime': '2026-04-13T23:59:59+07:00',
    'page': 1,
    'limit': 50
  },
  headers={
    'Accept': 'application/json, text/plain, */*',
    'Authorization': '',
    'X-ACCESS-TOKEN': '',
    'Content-Type': 'application/json',
    'X-Requested-With': 'XMLHttpRequest'
  }
)

print(response.json())

2. Chi tiết cuộc gọi

GET https://app.alohub.vn:9909/api/report/call-logs/{call_id}

Lấy thông tin chi tiết của một cuộc gọi cụ thể bao gồm recording_url và transcript (nếu có).

Path Parameter

Tham số

Bắt buộc

Kiểu

Mô tả

{call_id}

string

Mã định danh cuộc gọi, định dạng: YYYYMMDDHHMMSS-XXXXXXXX-XXX. VD: 20260121095227-IMCRRNJW-342

Code mẫu

curl --location 'https://app.alohub.vn:9909/api/report/call-logs/20260121095227-IMCRRNJW-342' \
  --header 'Accept: application/json, text/plain, */*' \
  --header 'Authorization: <api_key>' \
  --header 'X-ACCESS-TOKEN: <jwt_token>' \
  --header 'X-Requested-With: XMLHttpRequest'
const axios = require('axios')

const callId = '20260121095227-IMCRRNJW-342'

const response = await axios.get(
  `https://app.alohub.vn:9909/api/report/call-logs/${callId}`,
  {
    headers: {
      'Accept': 'application/json, text/plain, */*',
      'Authorization': '<api_key>',
      'X-ACCESS-TOKEN': '<jwt_token>',
      'X-Requested-With': 'XMLHttpRequest'
    }
  }
)

console.log(response.data)
import requests

call_id = '20260121095227-IMCRRNJW-342'

response = requests.get(
  f'https://app.alohub.vn:9909/api/report/call-logs/{call_id}',
  headers={
    'Accept': 'application/json, text/plain, */*',
    'Authorization': '',
    'X-ACCESS-TOKEN': '',
    'X-Requested-With': 'XMLHttpRequest'
  }
)

print(response.json())

Lưu ý: call_id lấy từ response của API danh sách cuộc gọi (mục 1). Định dạng ID là chuỗi gồm: timestamp + random chars + extension/session id.

Bài viết này có hữu ích không?
Cập nhật: 17/4/2026
để chuyển bài