Voice APICalls, Lookup & Recording

Calls, Lookup & Recording

Tạ Quốc Thắng·6/2/2026

1. Overview

Base URL

{{protocol}}://{{host}}:{{port}}/api

Note: Parameters protocol, host, portwill be provided by Alohub. Contact to register for integration .

Authentication

Every request requires a header Authorizationcontaining the API Key provided by Alohub ( contact to receive the key ):

Authorization: {{api-key}}

Header

Value

Description

Authorization

{{api-key}}

API Key provided by Alohub. Contact Alohub to receive the API Key

Content-Type

application/json

Request body format (applies to POST)

Security: Do not share the API Key externally. Do not commit the API Key into source code. Always store it in an environment variable.

2. Make a call

POST /v1.0/base/makeCall

Make an outbound call (click-to-call). The system will first call the agent's IP Phone, and after the agent picks up, it will automatically call the customer's number.

Parameters

Required

Type

Description

phoneNumber

Yes

string

The customer's phone number to call

ipPhone

Yes

string

The IP Phone code (extension) of the agent making the call

transactionId

No

string

Transaction ID for tracking — useful for reconciliation or lookup later

Sample code

{
  "phoneNumber": "0123456789",
  "ipPhone": "6688",
  "transactionId": "ALOHUB_3432323435545"
}
curl -X POST "{{protocol}}://{{host}}:{{port}}/api/v1.0/base/makeCall" \
  -H "Authorization: {{api-key}}" \
  -H "Content-Type: application/json" \
  -d '{
    "phoneNumber": "0123456789",
    "ipPhone": "6688",
    "transactionId": "ALOHUB_3432323435545"
  }'

Suggestion: It is recommended to pass transactionIda unique ID for each call to facilitate lookup and reconciliation with your internal system.

3. Call lookup

Lookup call history by various criteria.

POST /v1.0/base/searchCallV2

Lookup call history version V2. Lookup detailed call information with complete details.

Recommendation: Use V2 for new integrations to receive complete call information.

Sample response

{
  "call_id": "20210222084953-NSOJCGOO-49278",
  "source": "ipcc",
  "direction": "OUTBOUND",
  "call_status": "answered",
  "starttime": "2024-01-13 15:00:30",
  "answertime": "2024-01-13 15:00:35",
  "endtime": "2024-01-13 15:05:30",
  "total_duration": "300",
  "holding_duration": "0",
  "hangup_by": "customer",
  "recording_url": "url_file.mp3",
  "caller_number": "0389900xxx",
  "destination_number": "888",
  "transactionId": "TRANSID_1111",
  "agent": "userName66"
}

Field

Type

Description

call_id

string

Unique identifier of the call

source

string

Call source

direction

string

Call direction: INBOUND/ OUTBOUND

call_status

string

Call status (see status code table)

starttime

string

Call start time

answertime

string

Call answered time

endtime

string

Call end time

total_duration

string

Total call duration (seconds)

holding_duration

string

Hold time (seconds)

hangup_by

string

Party that hung up: customer/ agent/ system

recording_url

string

URL of the call recording file

caller_number

string

Caller phone number

destination_number

string

Receiver phone number

transactionId

string

Transaction ID (if passed when makeCall)

agent

string

User agent name handling the call

4. Call recording

GET /IPCCMedia/MP3Export.do

Play or download the call recording file. The full URL is returned in the recording_urlfield of the call lookup response.

Parameters

Required

Type

Description

url

Yes

string

MP3 file name (taken from recording_urlin the lookup results)

source

Yes

string

Data source, default ipcc

Sample code

# Phát trực tiếp (stream)
curl "https://{{domain}}:{{port}}/IPCCMedia/MP3Export.do?url=recording_url.mp3&source=ipcc" \
  -H "Authorization: {{api-key}}"
# Tải xuống file
curl -o recording.mp3 \
  "https://{{domain}}:{{port}}/IPCCMedia/MP3Export.do?url=recording_url.mp3&source=ipcc" \
  -H "Authorization: {{api-key}}"

Note: The recording file has a storage duration depending on the service package. If long-term storage is needed, please download the file to your system.

5. Queue management

POST /setting/agent/updateQueue

Update the configuration of incoming (CALLIN) and outgoing (CALLOUT) queues for agents. Used to distribute calls to the correct group of agents.

Query Parameters:

Parameter

Required

Description

userName

Yes

The agent account name that needs to update the queue

Body Parameters:

Parameter

Required

Type

Description

action

Yes

string

Action: EDIT(update all) or ADD(add new)

callinId

Yes

array

List of incoming Queue IDs (callin). E.g.: [1, 2]

calloutId

No

number

Outgoing Queue ID (callout)

lstExtension

No

array

List of extensions (IP Phones) associated with the agent

Sample code

{
  "action": "EDIT",
  "callinId": [1, 2],
  "calloutId": 99999,
  "lstExtension": ["6688"]
}
curl -X POST "{{protocol}}://{{host}}:{{port}}/api/setting/agent/updateQueue?userName=userName66" \
  -H "Authorization: {{api-key}}" \
  -H "Content-Type: application/json" \
  -d '{
    "action": "EDIT",
    "callinId": [1, 2],
    "calloutId": 99999,
    "lstExtension": ["6688"]
  }'

Webhook: Alohub sends real-time call events via webhook. See detailed payload, status codes, and handling methods in the Call event webhook .

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