Table of Contents


This is where all the functions for dealing with faxing happens.

Controller: /fax
Full Url: https://apiv1.teleapi.net/fax/



Full Url: https://apiv1.teleapi.net/fax/list


Info: List all the faxes for a given did_id


Full Url: https://apiv1.teleapi.net/fax/get


Info: Get the actual fax data about a given fax_id. The file data itself is in base64 format. The mime type will almost always be application/pdf -- but it's there for you to check just in case

Example Response

    "code": 200,
    "status": "success",
    "data": {
        "id": 1,
        "did_id": 1,
        "fax_status": "read",
        "direction": "inbound",
        "source_did": "5555555555",
        "destination_did": "6666666666",
        "recipient": "Bobby Tables",
        "pages": 1,
        "fail_reason": null,
        "create_dt": "2017-05-01 00:00:00",
        "modify_dt": "2017-05-01 23:59:59",
        "data": "YXJlbid0IHlvdSBjbGV2ZXIgOi0p",
        "mime": "text/plain"


Full Url: https://apiv1.teleapi.net/fax/send


Info: This is sending a fax. For files itself, you can send more than one file (cover page, content, etc). We will put it all together and send it out. For this, we expect a JSON encoded array of the file data. I'll provide a bit of example PHP...

//setup token
$token = 'your token';

//setup the path to the files we want to send
$files = array(

//a very simple function you can copy/paste if you want
function send_fax($did_id, $destination, $recipient_name, $files) {
    global $token;
    //get the data and base64 the files
    foreach ($files as $i => $file) {
        $files[$i] = base64_encode(file_get_contents($file));
    $data = array(
        'token' => $token,
        'did_id' => $did_id, //I'll fix this so you can send source, but this is how I use it so it's already written this way
        'destination' => $destination,
        'recipient' => $recipient,
        'files' => json_encode($files)
    $data = http_build_query($data);
    $ch = curl_init('https://apiv1.teleapi.net/fax/send');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    $resp = curl_exec($ch);
    return json_decode($resp);

//code that actually sends a fax -- provided you pass a real did_id and destination number. and file(s). 
$resp = send_fax(555, 5555555555, 'Bobby Tables', $files);
if ($resp->code == 200) {
    die("Successfully sent fax\n");
die("Could not send fax: " . print_r($resp, true));


Full Url: https://apiv1.teleapi.net/fax/remove


Info: This will permanently delete a fax from our servers


Full Url: https://apiv1.teleapi.net/fax/emails/list


Info: This will list all the email addresses that get the inbound faxes to the associated fax number


Full Url: https://apiv1.teleapi.net/fax/emails/add


Info: Add an additional email address to receive inbound faxes for associated fax number


Full Url: https://apiv1.teleapi.net/fax/emails/remove


Info: Remove an email address as a recipeient of inbound faxes to a fax number