Skip to main content

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

DescriptionDefined DataSample DataRequired[**]/Logical[*]Parameters
Unique ID of the sender-username1*sender_id
Destination number-112233*to
Destination internal extension-558*ext
Output trunk-trunk_name1*trunk_name
Name of the uploaded file returned in the fax upload response (if the "file" field has a value, the "text" field should be removed)-file-20200624051520-61681-fax-test*file
For sending a text file-this is sampletext
Description-just for testdescription

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/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: 9UV0BWKRL83PYIH9Gv1fI85d41lO4S932EeX3wHC47sHjMJOMG',
'Authorization: Basic c2FkcjpTYWRyQDEyMw==',
'Content-Type: application/json'
),
));

$response = curl_exec($curl);

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