Audio Files

List, upload, update and delete welcome, hold and campaign announcements. The uploaded file is automatically converted to 8 kHz mono for the phone line and appears under "Audio Files" in the panel. PBX key (key=K…). Rate limit: 10 requests per minute.

GETAudio file list

GET https://api.buluthat.com/api/announcements.php?key=K…
[
  { "id": 112, "name": "Firmamıza hoş geldiniz" },
  { "id": 113, "name": "Mesai dışındayız" },
  { "id": 115, "name": "Öğle molası" }
]

id values in auto call campaigns media_file_id, in click-to-call announcement_to_* is used as.

POSTUpload a new audio file

POST https://api.buluthat.com/api/announcements.php
Content-Type: application/x-www-form-urlencoded

key=K…&name=Karşılama+sesi&sounddata=data:audio/mp3;name:anons.mp3;base64,SUQzAwAAAAAH…
ParameterRequiredDescription
nameyesName to show in the list
sounddatayesFile content, Data URL in the format: data:<mime>;name:<dosyaadı>;base64,<içerik>

Accepted extensions: wav mp3 wma m4a aac ac3 amr flac gsm mpeg mp1 mp2 ra spx ogg 3gp. At most 20 MB.

Response 200 OK, the new record id in the body (859).

PUTUpdate an audio file

PUT https://api.buluthat.com/api/announcements.php/859
Content-Type: application/x-www-form-urlencoded

key=K…&name=Karşılama+sesi+v2&sounddata=data:audio/mp3;name:anons2.mp3;base64,…

Only to change the name sounddata do not send. Response OK.

DELETEDelete an audio file

DELETE https://api.buluthat.com/api/announcements.php/859?key=K…

A file used in an IVR, queue or campaign cannot be deleted; 400 announcement in use returns.

Announcement from text

To type text and voice it (TTS), in auto call campaigns tts_template use or generate it from the panel > Voice Studio; files generated in the studio are also in this list [Stüdyo] comes with the label.

Example: uploading with PHP

$file = 'anons.mp3';
$data = 'data:audio/mp3;name:' . rawurlencode(basename($file)) . ';base64,' . base64_encode(file_get_contents($file));
$ch = curl_init('https://api.buluthat.com/api/announcements.php');
curl_setopt_array($ch, [
    CURLOPT_POST => true,
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POSTFIELDS => http_build_query(['key' => $key, 'name' => 'Karşılama', 'sounddata' => $data]),
]);
$id = curl_exec($ch);   // "859"