Blacklist Add
This service is used to add a number to the blacklist.
Parameters
| Parameters | Required[]/Logical[] | Defined Data | Sample Data | Description |
|---|---|---|---|---|
| number | ** | - | 557 | Target Number |
| comment | - | - | Description |
Sample Invocation
Example Code
PHP
<?PHP
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'HTTP://192.168.1.100/API/v4/PBX/blacklists/add',
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 =>'{
"number":"557",
"comment":""
}',
CURLOPT_HTTPHEADER => array(
'X-APIKEY: SAMPLE_API_KEY',
'Authorization: Basic dGVzdDpBYTEyMzQ1Ng==',
'Content-Type: application/JSON'
),
));
$response = curl_exec($curl);
if (!curl_errno($curl)) {
$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
echo 'response code:'.$httpcode, '<br/>';
}
curl_close($curl);
echo $response;
?>