Skip to main content

Announce Upload

This service is used for uploading audio files to the contact center. After uploading, the contact center returns the filename in the response, which is then used in the "Add Audio File" API.

Parameters

DescriptionDefined DataExample DataRequired Parameters[**]/Optional[*]Parameters
Audio file path-c:users\users\Desktop\file.mp3**file

Sample Invocation

Show Full Source Code PHP


<?php

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => 'http://192.168.51.20/api/v4/pbx/announcements/upload',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('/path/to/file')),
CURLOPT_HTTPHEADER => array(
'X-APIKEY: 9UV0BWKRL83PYIH9Gv1fI85d41lO4S932EeX3wHC47sHjMJOMG',
'Authorization: Basic c2FkcjpTYWRyQDEyMw=='
),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;
?>