Fax Upload
This service is used to upload files for use in sending faxes.
Parameters
Description | Defined Data | Sample Data | Required[**]/Logical[*] | Parameters |
---|---|---|---|---|
File name | - | - | ** | file |
Sample Invocation
- Example Code To Use
- Example Output
- PHP
- Curl
Show Full Source Code PHP
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://192.168.51.21/api/v4/pbx/faxes/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: vZKtIKWsld0egNlkzHo8i5LVBqLNBSWARCQsPOSgDjFmAHM3tG',
'Authorization: Basic dGVzdDpBYTEyMzQ1Ng=='
),
));
$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;
?>
Show Full Source Code Curl
curl --location --request POST 'http://192.168.51.21/api/v4/pbx/faxes/upload' \
--header 'X-APIKEY: vZKtIKWsld0egNlkzHo8i5LVBqLNBSWARCQsPOSgDjFmAHM3tG' \
--header 'Authorization: Basic dGVzdDpBYTEyMzQ1Ng==' \
--form 'file=@"/path/to/file"'
{
"success": 1,
"message": "1 file(s) uploaded successfully",
"data": {
"filename": "sen_file-20210316094328-60069-simotel5128editi_.tiff"
}
}