FAX Add
This service is used to add a sent FAX.
Note
To send a FAX as a file, the "file" field must have a value, and the "text" field should be removed from the input JSON.
Parameters
| Parameters | Required[**]/Logical[*] | Defined Data | Sample Data | Description |
|---|---|---|---|---|
| sender_id | * | - | username1 | Unique ID of the sender |
| to | * | - | 112233 | Destination number |
| ext | * | - | 558 | Destination internal extension |
| trunk_name | * | - | trunk_name1 | Output trunk |
| file | * | - | file-20200624051520-61681-FAX-test | Name of the uploaded file returned in the FAX upload response (if the "file" field has a value, the "text" field should be removed) |
| text | - | this is sample | For sending a text file | |
| description | - | just for test | 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/faxes/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 =>'{
"sender_id":"username1",
"to":"112233",
"ext":"558",
"trunk_name":"Cisco",
"file":"file-20200624051520-61681-Fax-test",
"description":"Just for test"
}',
CURLOPT_HTTPHEADER => array(
'X-APIKEY: SAMPLE_API_KEY',
'Authorization: Basic c2FkcjpTYWRyQDEyMw==',
'Content-Type: application/JSON'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>cURL
curl --location --request POST 'HTTP://192.168.1.100/API/v4/PBX/faxes/add' \
--header 'X-APIKEY: SAMPLE_API_KEY' \
--header 'Authorization: Basic c2FkcjpTYWRyQDEyMw==' \
--header 'Content-Type: application/JSON' \
--data-raw '{
"sender_id":"username1",
"to":"112233",
"ext":"558",
"trunk_name":"Cisco",
"file":"file-20200624051520-61681-Fax-test",
"description":"Just for test"
}'Example Output
{
"success": 1,
"message": "Requested operation is done successfully",
"data": {
"_id": "64b800977ec8cb8899ee28a2"
}
}