Repository files navigation

api-client-php

Monopond Fax API PHP Client

#Building a Request To use Monopond SOAP PHP Client, start by including the MonopondSOAPClient.php then creating an instance of the client by supplying your credentials. Your username and password should be enclosed in quotation marks.

<?phpinclude_once'./MonopondSOAPClient.php';
// TODO: Enter your own credentials here$client = newMonopondSOAPClientV2_1("myusername", "mypassword", MPENV::PRODUCTION);
// TODO: Set up your request here?>

SendFax

Description

This is the core function in the API allowing you to send faxes on the platform.

Your specific faxing requirements will dictate which send request type below should be used. The two common use cases would be the sending of a single fax document to one destination and the sending of a single fax document to multiple destinations.

Sending a single fax:

To send a fax to a single destination a request similar to the following example can be used:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents = array($document);
// TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
// Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know the definitions:

Assigning DocumentRef in MonopondDocument

DocumentRef must be unique and a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DocumentRef = "Sample DocumentRef";
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document2->DocumentRef = "Sample DocumentRef2";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here to check the definition of DocumentRef:

Assigning SendRef and BroadcastRef in MonopondSendFaxRequest

To assign SendRef and BroadcastRef in MonopondSendFaxRequest, a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "Testing";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BroadcastRef = "BroadcastRef";
$sendFaxRequest->SendRef = "SendRef";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Visit here to know the definitions of SendRef and BroadcastRef:

Sending a Fax with Retries inside a MonopondFaxMessage

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Retries = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Retries inside a MonopondSendFaxRequest

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Retries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondFaxMessage

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->BusyRetries = 1;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondSendFaxRequest

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BusyRetries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Resolution in MonopondFaxMessage

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Resolution = "normal";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with Resolution in MonopondSendFaxRequest

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Resolution = "fine";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with FaxDitheringTechnique in MonopondDocument:

To set the fax FaxDitheringTechnique, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DitheringTechnique = "turbo";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the different values of FaxDitheringTechnique here:

Assigning a Timezone in MonopondFaxMessage

The Timezone is used to format the datetime display in the fax header.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->TimeZone = "Australia/Adelaide";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning a Timezone in MonopondSendFaxRequest

The Timezone is used to format the datetime display in the fax header. Applying it to the MonopondSendFaxRequest will apply this to all MonopondFaxMessages in the request.

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->TimeZone = "Australia/Adelaide";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning SendFrom in MonopondFaxMessage

To send fax with SendFrom in MonopondFaxMessage a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Sample SendFrom";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning SendFrom in MonopondSendFaxRequest

To send fax with SendFrom in MonopondSendFaxRequest a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->SendFrom = "Test Example";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning a HeaderFormat in MonopondFaxMessage

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning a HeaderFormat in MonopondSendFaxRequest

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning CLI in MonopondFaxMessage

Assigning a CLI in the MonopondFaxMessage, a request similar to the following example below.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->CLI = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of CLI here:

Sending a Fax with DNCR enabled in MonopondFaxMessage

To check if a number is on the Do Not Call Register (Australian) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with FPS enabled in MonopondFaxMessage

To check if a number is on the FPS blacklist (UK) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->fps = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with Smartblock enabled in MonopondFaxMessage

To check if a number is on the Smartblock list before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->smartblock = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Add a Blocklists in MonopondSendFaxRequest

If you want to validate all numbers in DNCR or FPS or Smarblock, a request must be similiar to this example:

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Blocklists = $monopondBlocklists;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with ScheduledStartTime in MonopondFaxMessage

To set a ScheduledStartTime for the MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->ScheduledStartTime = "2017-06-25T12:00:00Z";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with ScheduledStartTime in MonopondSendFaxRequest

To set a ScheduledStartTime for the MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with MustBeSentBeforeDate in MonopondFaxMessage

To set a MustBeSentBeforeDate for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MustBeSentBeforeDate in MonopondSendFaxRequest

To set a MustBeSentBeforeDate for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MaxFaxPages in MonopondFaxMessage

To set a MaxFaxPages for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MaxFaxPages = 1;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MaxFaxPages = 2;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending a Fax with MaxFaxPages in MonopondSendFaxRequest

To set a MaxFaxPages for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MaxFaxPages = 2;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending multiple faxes:

To send faxes to multiple destinations a request similar to the following example can be used. Please note the addition of another FaxMessage:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName2.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document3 = newMonopondDocument();
$document3->FileName = "AnyFileName3.txt";
$document3->FileData = $filedata;
$document3->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents[] = $document;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->Documents[] = $document2;
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
$faxMessage3->Documents[] = $document3;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending faxes to multiple destinations with the same document (broadcasting):

To send the same fax content to multiple destinations (broadcasting) a request similar to the example below can be used.

This method is recommended for broadcasting as it takes advantage of the multiple tiers in the send request. This eliminates the repeated parameters out of the individual fax message elements which are instead inherited from the parent send fax request. An example below shows SendFrom being used for both FaxMessages. While not shown in the example below further control can be achieved over individual fax elements to override the parameters set in the parent.

When sending multiple faxes in batch it is recommended to group them into requests of around 600 fax messages for optimal performance. If you are sending the same document to multiple destinations it is strongly advised to only attach the document once in the root of the send request rather than attaching a document for each destination.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Microsoft Documents With DocMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request is used to send a Microsoft document with replaceable variables or merge fields. The merge field follows the pattern <mf:key>. If your key is field1, it should be typed as <mf:field1> in the document. Note that the key must be unique within the whole document. The screenshots below are examples of what the request does.

Original .doc file:

before

This is what the file looks like after the fields field1,field2 and field3 have been replaced with values lazy dog, fat pig and fat pig:

stamp

Sample Request

The example below shows field1 will be replaced by the value of Test.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "name";
$mergeField->Value = "Raspberry Pi";
$document1 = newMonopondDocument();
$document1->DocumentRef = "send-1-document";
$document1->DocMergeData[] = $mergeField;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "message-1";
$faxMessage->SendTo = "61290120211";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Resolution = "normal";
$faxMessage->Retries = 0;
$faxMessage->BusyRetries = 2;
$faxMessage->CLI = 61290120211;
$faxMessage->Documents = array($document1);
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "name";
$mergeField2->Value = "Raspberry Pi 2";
$document2 = newMonopondDocument();
$document2->DocumentRef = "send-1-document";
$document2->DocMergeData[] = $mergeField2;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "message-2";
$faxMessage2->SendTo = "61290120211";
$faxMessage2->SendFrom = "Test Fax 2";
$faxMessage2->Resolution = "normal";
$faxMessage2->Retries = 0;
$faxMessage2->BusyRetries = 2;
$faxMessage2->CLI = 61011114111;
$faxMessage2->Documents = array($document2);
$baseDocument = newMonopondDocument();
$baseDocument->DocumentRef = "send-1-document2";
$baseDocument->FileName = "file.doc";
$baseDocument->FileData = $filedata;
$baseDocument->Order = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "broadcast-1";
$sendFaxRequest->SendRef = "send-1";
$sendFaxRequest->HeaderFormat = "Testing";
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->FaxMessages[] = $faxMessage2;
$sendFaxRequest->Documents = array($baseDocument);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Tiff and PDF files with StampMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request allows a TIFF file to be stamped with an image or text, based on X-Y coordinates. The x and y coordinates (0,0) starts at the top left part of the document. The screenshots below are examples of what the request does.

Original tiff file:

before

Sample stamp image:

stamp

This is what the tiff file looks like after stamping it with the image above:

after

The same tiff file, but this time, with a text stamp:

after

Sample Request

The example below shows a TIFF that will be stamped with the text “Hello” at xCoord=“1287” and yCoord=“421”, and an image at xCoord=“283” and yCoord=“120”

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "1287";
$stampMergeFieldKey->yCoord = "421";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->TextValue = $stampMergeFieldTextValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

Request with Image Stamping

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "283";
$stampMergeFieldKey->yCoord = "120";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

DocMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Properties:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Properties:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Properties:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

Response

The response received from a SendFaxRequest matches the response you receive when calling the FaxStatus method call with a send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, DocumentContentTypeNotFoundException, or InternalServerException. You can find more details on these faults here.

FaxStatus

Description

This function provides you with a method of retrieving the status, details and results of fax messages sent. While this is a legitimate method of retrieving results we strongly advise that you take advantage of our callback service, which will push these fax results to you as they are completed.

When making a status request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow the request query.

  • Limiting by a BroadcastRef allows you to retrieve faxes contained in a group of send requests.
  • Limiting by SendRef allows you to retrieve faxes contained in a single send request.
  • Limiting by MessageRef allows you to retrieve a single fax message.

There are multiple levels of verbosity available in the request; these are explained in detail below.

FaxStatusRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.
VerbosityStringVerbosity String The level of detail in the status response. Please see below for a list of possible values.

Verbosity Levels:

ValueDescription
briefGives you an overall view of the messages. This simply shows very high-level statistics, consisting of counts of how many faxes are at each status (i.e. processing, queued,sending) and totals of the results of these faxes (success, failed, blocked).
sendsend Includes the results from “brief” while also including an itemised list of each fax message in the request.
detailsdetails Includes the results from “send” along with details of the properties used to send the fax messages.
resultsIncludes the results from “send” along with the sending results of the fax messages.
allall Includes the results from both “details” and “results” along with some extra uncommon fields.

Sending a faxStatus Request with “brief” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "brief";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “send” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "send";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “details” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "details";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “results” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "results";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Response

The response received depends entirely on the verbosity level specified.

FaxStatusResponse:

NameTypeVerbosityDescription
FaxStatusTotalsFaxStatusTotalsbriefCounts of how many faxes are at each status. See below for more details.
FaxResultsTotalsFaxResultsTotalsbriefFaxResultsTotals FaxResultsTotals brief Totals of the end results of the faxes. See below for more details.
FaxMessagesArray of FaxMessagesendsend List of each fax in the query. See below for more details.

FaxStatusTotals:

Contains the total count of how many faxes are at each status. To see more information on each fax status, view the FaxStatus table below.

NameTypeVerbosityDescription
pendingLongbriefFax is pending on the system and waiting to be processed.
processingLongbriefFax is in the initial processing stages.
queuedLongbriefFax has finished processing and is queued, ready to send out at the send time.
startingLongbriefFax is ready to be sent out.
sendingLongbriefFax has been spooled to our servers and is in the process of being sent out.
finalizingLongbriefFax has finished sending and the results are being processed.
doneLongbriefFax has completed and no further actions will take place. The detailed results are available at this status.

FaxResultsTotals:

Contains the total count of how many faxes ended in each result, as well as some additional totals. To view more information on each fax result, view the FaxResults table below.

NameTypeVerbosityDescription
successLongbriefFax has successfully been delivered to its destination.
blockedLongbriefDestination number was found in one of the block lists.
failedLongbriefFax failed getting to its destination.
totalAttemptsLongbriefTotal attempts made in the reference context.
totalFaxDurationLongbrieftotalFaxDuration Long brief Total time spent on the line in the reference context.
totalPagesLongbriefTotal pages sent in the reference context.

apiFaxMessageStatus:

NameTypeVerbosityDescription
messageRefStringsend
sendRefStringsend
broadcastRefStringsend
sendToStringsend
statussendThe current status of the fax message. See the FaxStatus table above for possible status values.
FaxDetailsFaxDetailsdetailsContains the details and settings the fax was sent with. See below for more details.
FaxResultsArray of FaxResultresultsContains the results of each attempt at sending the fax message and their connection details. See below for more details.

FaxDetails:

NameTypeVerbosity
sendFromAlphanumeric Stringdetails
resolutionStringdetails
retriesIntegerdetails
busyRetriesIntegerdetails
headerFormatStringdetails

FaxResults:

NameTypeVerbosityDescription
attemptIntegerresultsThe attempt number of the FaxResult.
resultStringresultsThe result of the fax message. See the FaxResults table above for all possible results values.
ErrorFaxErrorresultsThe fax error code if the fax was not successful. See below for all possible values.
costBigDecimalresultsThe final cost of the fax message.
pagesIntegerresultsTotal pages sent to the end fax machine.
scheduledStartTimeDateTimeresultsThe date and time the fax is scheduled to start.
dateCallStartedDateTimeresultsDate and time the fax started transmitting.
dateCallEndedDateTimeresultsDate and time the fax finished transmitting.

FaxError:

ValueError Name
DOCUMENT_EXCEEDS_PAGE_LIMITDocument exceeds page limit
DOCUMENT_UNSUPPORTEDUnsupported document type
DOCUMENT_FAILED_CONVERSIONDocument failed conversion
FUNDS_INSUFFICIENTInsufficient funds
FUNDS_FAILEDFailed to transfer funds
BLOCK_ACCOUNTNumber cannot be sent from this account
BLOCK_GLOBALNumber found in the Global blocklist
BLOCK_SMARTNumber found in the Smart blocklist
BLOCK_DNCRNumber found in the DNCR blocklist
BLOCK_CUSTOMNumber found in a user specified blocklist
FAX_NEGOTIATION_FAILEDNegotiation failed
FAX_EARLY_HANGUPEarly hang-up on call
FAX_INCOMPATIBLE_MACHINEIncompatible fax machine
FAX_BUSYPhone number busy
FAX_NUMBER_UNOBTAINABLENumber unobtainable
FAX_SENDING_FAILEDSending fax failed
FAX_CANCELLEDCancelled
FAX_NO_ANSWERNo answer
FAX_UNKNOWNUnknown fax error

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

StopFax

Description

Stops a fax message from sending. This fax message must either be paused, queued, starting or sending. Please note the fax cannot be stopped if the fax is currently in the process of being transmitted to the destination device.

When making a stop request you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

StopFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

StopFax Request limiting by BroadcastRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->BroadcastRef = "Broadcast-test-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by SendRef:

$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->SendRef = "Send-Ref-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by MessageRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->MessageRef = "Testing-message-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

Response

The response received from a StopFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PauseFax

Description

Pauses a fax message before it starts transmitting. This fax message must either be queued, starting or sending. Please note the fax cannot be paused if the message is currently being transmitted to the destination device.

When making a pause request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

PauseFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

PauseFax Request limiting by BroadcastRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->BroadcastRef = "Broadcast-test-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by SendRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->SendRef = "Send-Ref-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by MessageRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->MessageRef = "Testing-message-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

Response

The response received from a PauseFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults in here.

ResumeFax

When making a resume request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

ResumeFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

ResumeFax Request limiting by BroadcastRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->BroadcastRef = "Broadcast-test-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by SendRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->SendRef = "Send-Ref-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by MessageRef:

$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->MessageRef = "Testing-message-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

Response

The response received from a ResumeFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PreviewFaxDocument

Description

This function provides you with a method to generate a preview of a saved document at different resolutions with various dithering settings. It returns a tiff data in base64 along with a page count.

Normal PreviewFaxDocument Request

// TODO: Put your file path here$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello World!";
$monopondStampMergeField = newMonopondStampMergeField();
$monopondStampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$monopondStampMergeField->TextValue = $stampMergeFieldTextValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-document-ref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($monopondStampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($stampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with DocMergeData

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "field1";
$mergeField->Value = "Raspberry Pi";
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "field2";
$mergeField2->Value = "Human";
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-documentref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->DocMergeData = array($mergeField, $mergeField2);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

Request

FaxDocumentPreviewRequest Parameters:

NameRequiredTypeDescriptionDefault
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
DitheringTechniqueFaxDitheringTechniqueApplies a custom dithering method to the fax document before transmission.
DocMergeDataArray of DocMergeData MergeFieldsEach mergefield has a key and a value. The system will look for the keys in a document and replace them with their corresponding value.
StampMergeDataArray of StampMergeData MergeFieldsEach mergefield has a key a corressponding TextValue/ImageValue. The system will look for the keys in a document and replace them with their corresponding value.

DocMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Parameters:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Parameters:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Parameters:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

FaxDocumentPreviewResponse

NameTypeDescription
TiffPreviewStringA preview version of the document encoded in Base64 format.
NumberOfPagesIntTotal number of pages in the document preview.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException, UnsupportedDocumentContentType, MergeFieldDoesNotMatchDocumentTypeException, UnknownHostException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

SaveFaxDocument

Description

This function allows you to upload a document and save it under a document reference (DocumentRef) for later use. (Note: These saved documents only last 30 days on the system.)

Sample Request

$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$saveFaxDocumentRequest = newMonopondSaveFaxDocumentRequest();
$saveFaxDocumentRequest->DocumentRef = "sample-document-ref";
$saveFaxDocumentRequest->FileName = "test.pdf";
$saveFaxDocumentRequest->FileData = $filedata;
$saveFaxDocumentResponse = $client->saveFaxDocument($saveFaxDocumentRequest);
print_r($saveFaxDocumentResponse);

Request

SaveFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefXStringUnique identifier for the document to be uploaded.
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefAlreadyExistsException, DocumentContentTypeNotFoundException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

DeleteFaxDocument

Description

This function removes a saved fax document from the system.

Sample Request

// TODO: Put your file path here$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$deleteFaxDocumentRequest = newMonopondDeleteFaxDocumentRequest();
$deleteFaxDocumentRequest->DocumentRef = "sample-document-ref";
// Call delete FaxDocument method$deleteRespone = $client->deleteFaxDocument($deleteFaxDocumentRequest);
print_r($deleteRespone);

Request

DeleteFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefStringUnique identifier for the document to be deleted.
MessageRefStringUser-defined message reference.
SendRefStringUser-defined send reference.
BroadcastRefStringUser-defined broadcast reference.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

More Information

Exceptions/SOAP Faults

If an error occurs during a request on the Monopond Fax API the service will throw a SOAP fault or exception. Each exception is listed in detail below.

InvalidArgumentsException

One or more of the arguments passed in the request were invalid. Each element that failed validation is included in the fault details along with the reason for failure.

DocumentContentTypeNotFoundException

There was an error while decoding the document provided; we were unable to determine its content type.

DocumentRefAlreadyExistsException

There is already a document on your account with this DocumentRef.

DocumentContentTypeNotFoundException

Content type could not be found for the document.

NoMessagesFoundException

Based on the references sent in the request no messages could be found that match the criteria.

InternalServerException

An unusual error occurred on the platform. If this error occurs please contact support for further instruction.

General Properties and File Formatting

File Encoding

All files are encoded in the Base64 encoding specified in RFC 2045 - MIME (Multipurpose Internet Mail Extensions). The Base64 encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used, enabling 6 bits to be represented per printable character. For more information see http://tools.ietf.org/html/rfc2045 and http://en.wikipedia.org/wiki/Base64

Dates

Dates are always passed in ISO-8601 format with time zone. For example: “2012-07-17T19:27:23+08:00”

MonopondSendFaxRequest Properties

NameRequiredTypeDescriptionDefault
BroadcastRefStringAllows the user to tag all faxes in this request with a user-defined broadcastreference. These faxes can then be retrieved at a later point based on this reference.
SendRefStringSimilar to the BroadcastRef, this allows the user to tag all faxes in this request with a send reference. The SendRef is used to represent all faxes in this request only, so naturally it must be unique.
FaxMessagesXArray of FaxMessageFaxMessages describe each individual fax message and its destination. See below for details.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersFax
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Current time (immediate sending)
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details.WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Each account has a maximum number of busy retries that can be changed by consultation with your account manager.Account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20

MonopondFaxMessage Properties

This represents a single fax message being sent to a destination.

NameRequiredTypeDescriptionDefault
MessageRefXStringA unique user-provided identifier that is used to identify the fax message. This can be used at a later point to retrieve the results of the fax message.
SendToXStringThe phone number the fax message will be sent to.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersEmpty
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Start now
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details. WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Please consult with your account manager in regards to maximum value.account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20
CLIStringAllows a customer called ID. Note: Must be enabled on the account before it can be used.

MonopondDocument Properties

Represents a fax document to be sent through the system. Supported file types are: PDF, TIFF, PNG, JPG, GIF, TXT, PS, RTF, DOC, DOCX, XLS, XLSX, PPT, PPTX.

NameRequiredTypeDescriptionDefault
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.
OrderXIntegerIf multiple documents are defined on a message this value will determine the order in which they will be transmitted.0
DocMergeDataAn Array of MergeFields
StampMergeDataAn Array of MergeFields

Resolution Levels

ValueDescription
normalNormal standard resolution (98 scan lines per inch)
fineFine resolution (196 scan lines per inch)

FaxDitheringTechnique

ValueFax Dithering Technique
noneNo dithering.
normalNormal dithering.
turboTurbo dithering.
darkenDarken dithering.
darken_moreDarken more dithering.
darken_extraDarken extra dithering.
lightenLighten dithering.
lighten_moreLighten more dithering.
crosshatchCrosshatch dithering.
DETAILEDDetailed dithering.

Header Format

Determines the format of the header line that is printed on the top of the transmitted fax message. This is set to **rom %from%, To %to%|%a %b %d %H:%M %Y”**y default which produces the following:

From TSID, To 61022221234 Mon Aug 28 15:32 2012 1 of 1

ValueDescription
%from%The value of the SendFrom field in the message.
%to%The value of the SendTo field in the message.
%aWeekday name (abbreviated)
%AWeekday name
%bMonth name (abbreviated)
%BMonth name
%dDay of the month as a decimal (01 – 31)
%mMonth as a decimal (01 – 12)
%yYear as a decimal (abbreviated)
%YYear as a decimal
%HHour as a decimal using a 24-hour clock (00 – 23)
%IHour as a decimal using a 12-hour clock (01 – 12)
%MMinute as a decimal (00 – 59)
%SSecond as a decimal (00 – 59)
%pAM or PM
%jDay of the year as a decimal (001 – 366)
%UWeek of the year as a decimal (Monday as first day of the week) (00 – 53)
%WDay of the year as a decimal (001 – 366)
%wDay of the week as a decimal (0 – 6) (Sunday being 0)
%%A literal % character

TODO: The default value is set to: “From %from%, To %to%|%a %b %d %H:%M %Y”

Blocklists Parameters

NameRequiredTypeDescription
smartblockfalsebooleanBlocks sending to a number if it has consistently failed in the past.
fpsfalsebooleanWash numbers against the fps blocklist.
dncrfalsebooleanWash numbers against the dncr blocklist.

About

Monopond Fax API PHP Client

Resources

Stars

3 stars

Watchers

17 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

api-client-php

Monopond Fax API PHP Client

#Building a Request To use Monopond SOAP PHP Client, start by including the MonopondSOAPClient.php then creating an instance of the client by supplying your credentials. Your username and password should be enclosed in quotation marks.

<?phpinclude_once'./MonopondSOAPClient.php';
// TODO: Enter your own credentials here$client = newMonopondSOAPClientV2_1("myusername", "mypassword", MPENV::PRODUCTION);
// TODO: Set up your request here?>

SendFax

Description

This is the core function in the API allowing you to send faxes on the platform.

Your specific faxing requirements will dictate which send request type below should be used. The two common use cases would be the sending of a single fax document to one destination and the sending of a single fax document to multiple destinations.

Sending a single fax:

To send a fax to a single destination a request similar to the following example can be used:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents = array($document);
// TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
// Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know the definitions:

Assigning DocumentRef in MonopondDocument

DocumentRef must be unique and a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DocumentRef = "Sample DocumentRef";
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document2->DocumentRef = "Sample DocumentRef2";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here to check the definition of DocumentRef:

Assigning SendRef and BroadcastRef in MonopondSendFaxRequest

To assign SendRef and BroadcastRef in MonopondSendFaxRequest, a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "Testing";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BroadcastRef = "BroadcastRef";
$sendFaxRequest->SendRef = "SendRef";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Visit here to know the definitions of SendRef and BroadcastRef:

Sending a Fax with Retries inside a MonopondFaxMessage

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Retries = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Retries inside a MonopondSendFaxRequest

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Retries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondFaxMessage

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->BusyRetries = 1;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondSendFaxRequest

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BusyRetries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Resolution in MonopondFaxMessage

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Resolution = "normal";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with Resolution in MonopondSendFaxRequest

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Resolution = "fine";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with FaxDitheringTechnique in MonopondDocument:

To set the fax FaxDitheringTechnique, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DitheringTechnique = "turbo";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the different values of FaxDitheringTechnique here:

Assigning a Timezone in MonopondFaxMessage

The Timezone is used to format the datetime display in the fax header.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->TimeZone = "Australia/Adelaide";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning a Timezone in MonopondSendFaxRequest

The Timezone is used to format the datetime display in the fax header. Applying it to the MonopondSendFaxRequest will apply this to all MonopondFaxMessages in the request.

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->TimeZone = "Australia/Adelaide";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning SendFrom in MonopondFaxMessage

To send fax with SendFrom in MonopondFaxMessage a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Sample SendFrom";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning SendFrom in MonopondSendFaxRequest

To send fax with SendFrom in MonopondSendFaxRequest a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->SendFrom = "Test Example";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning a HeaderFormat in MonopondFaxMessage

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning a HeaderFormat in MonopondSendFaxRequest

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning CLI in MonopondFaxMessage

Assigning a CLI in the MonopondFaxMessage, a request similar to the following example below.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->CLI = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of CLI here:

Sending a Fax with DNCR enabled in MonopondFaxMessage

To check if a number is on the Do Not Call Register (Australian) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with FPS enabled in MonopondFaxMessage

To check if a number is on the FPS blacklist (UK) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->fps = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with Smartblock enabled in MonopondFaxMessage

To check if a number is on the Smartblock list before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->smartblock = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Add a Blocklists in MonopondSendFaxRequest

If you want to validate all numbers in DNCR or FPS or Smarblock, a request must be similiar to this example:

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Blocklists = $monopondBlocklists;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with ScheduledStartTime in MonopondFaxMessage

To set a ScheduledStartTime for the MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->ScheduledStartTime = "2017-06-25T12:00:00Z";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with ScheduledStartTime in MonopondSendFaxRequest

To set a ScheduledStartTime for the MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with MustBeSentBeforeDate in MonopondFaxMessage

To set a MustBeSentBeforeDate for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MustBeSentBeforeDate in MonopondSendFaxRequest

To set a MustBeSentBeforeDate for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MaxFaxPages in MonopondFaxMessage

To set a MaxFaxPages for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MaxFaxPages = 1;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MaxFaxPages = 2;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending a Fax with MaxFaxPages in MonopondSendFaxRequest

To set a MaxFaxPages for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MaxFaxPages = 2;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending multiple faxes:

To send faxes to multiple destinations a request similar to the following example can be used. Please note the addition of another FaxMessage:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName2.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document3 = newMonopondDocument();
$document3->FileName = "AnyFileName3.txt";
$document3->FileData = $filedata;
$document3->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents[] = $document;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->Documents[] = $document2;
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
$faxMessage3->Documents[] = $document3;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending faxes to multiple destinations with the same document (broadcasting):

To send the same fax content to multiple destinations (broadcasting) a request similar to the example below can be used.

This method is recommended for broadcasting as it takes advantage of the multiple tiers in the send request. This eliminates the repeated parameters out of the individual fax message elements which are instead inherited from the parent send fax request. An example below shows SendFrom being used for both FaxMessages. While not shown in the example below further control can be achieved over individual fax elements to override the parameters set in the parent.

When sending multiple faxes in batch it is recommended to group them into requests of around 600 fax messages for optimal performance. If you are sending the same document to multiple destinations it is strongly advised to only attach the document once in the root of the send request rather than attaching a document for each destination.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Microsoft Documents With DocMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request is used to send a Microsoft document with replaceable variables or merge fields. The merge field follows the pattern <mf:key>. If your key is field1, it should be typed as <mf:field1> in the document. Note that the key must be unique within the whole document. The screenshots below are examples of what the request does.

Original .doc file:

before

This is what the file looks like after the fields field1,field2 and field3 have been replaced with values lazy dog, fat pig and fat pig:

stamp

Sample Request

The example below shows field1 will be replaced by the value of Test.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "name";
$mergeField->Value = "Raspberry Pi";
$document1 = newMonopondDocument();
$document1->DocumentRef = "send-1-document";
$document1->DocMergeData[] = $mergeField;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "message-1";
$faxMessage->SendTo = "61290120211";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Resolution = "normal";
$faxMessage->Retries = 0;
$faxMessage->BusyRetries = 2;
$faxMessage->CLI = 61290120211;
$faxMessage->Documents = array($document1);
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "name";
$mergeField2->Value = "Raspberry Pi 2";
$document2 = newMonopondDocument();
$document2->DocumentRef = "send-1-document";
$document2->DocMergeData[] = $mergeField2;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "message-2";
$faxMessage2->SendTo = "61290120211";
$faxMessage2->SendFrom = "Test Fax 2";
$faxMessage2->Resolution = "normal";
$faxMessage2->Retries = 0;
$faxMessage2->BusyRetries = 2;
$faxMessage2->CLI = 61011114111;
$faxMessage2->Documents = array($document2);
$baseDocument = newMonopondDocument();
$baseDocument->DocumentRef = "send-1-document2";
$baseDocument->FileName = "file.doc";
$baseDocument->FileData = $filedata;
$baseDocument->Order = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "broadcast-1";
$sendFaxRequest->SendRef = "send-1";
$sendFaxRequest->HeaderFormat = "Testing";
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->FaxMessages[] = $faxMessage2;
$sendFaxRequest->Documents = array($baseDocument);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Tiff and PDF files with StampMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request allows a TIFF file to be stamped with an image or text, based on X-Y coordinates. The x and y coordinates (0,0) starts at the top left part of the document. The screenshots below are examples of what the request does.

Original tiff file:

before

Sample stamp image:

stamp

This is what the tiff file looks like after stamping it with the image above:

after

The same tiff file, but this time, with a text stamp:

after

Sample Request

The example below shows a TIFF that will be stamped with the text “Hello” at xCoord=“1287” and yCoord=“421”, and an image at xCoord=“283” and yCoord=“120”

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "1287";
$stampMergeFieldKey->yCoord = "421";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->TextValue = $stampMergeFieldTextValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

Request with Image Stamping

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "283";
$stampMergeFieldKey->yCoord = "120";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

DocMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Properties:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Properties:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Properties:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

Response

The response received from a SendFaxRequest matches the response you receive when calling the FaxStatus method call with a send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, DocumentContentTypeNotFoundException, or InternalServerException. You can find more details on these faults here.

FaxStatus

Description

This function provides you with a method of retrieving the status, details and results of fax messages sent. While this is a legitimate method of retrieving results we strongly advise that you take advantage of our callback service, which will push these fax results to you as they are completed.

When making a status request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow the request query.

  • Limiting by a BroadcastRef allows you to retrieve faxes contained in a group of send requests.
  • Limiting by SendRef allows you to retrieve faxes contained in a single send request.
  • Limiting by MessageRef allows you to retrieve a single fax message.

There are multiple levels of verbosity available in the request; these are explained in detail below.

FaxStatusRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.
VerbosityStringVerbosity String The level of detail in the status response. Please see below for a list of possible values.

Verbosity Levels:

ValueDescription
briefGives you an overall view of the messages. This simply shows very high-level statistics, consisting of counts of how many faxes are at each status (i.e. processing, queued,sending) and totals of the results of these faxes (success, failed, blocked).
sendsend Includes the results from “brief” while also including an itemised list of each fax message in the request.
detailsdetails Includes the results from “send” along with details of the properties used to send the fax messages.
resultsIncludes the results from “send” along with the sending results of the fax messages.
allall Includes the results from both “details” and “results” along with some extra uncommon fields.

Sending a faxStatus Request with “brief” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "brief";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “send” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "send";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “details” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "details";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “results” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "results";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Response

The response received depends entirely on the verbosity level specified.

FaxStatusResponse:

NameTypeVerbosityDescription
FaxStatusTotalsFaxStatusTotalsbriefCounts of how many faxes are at each status. See below for more details.
FaxResultsTotalsFaxResultsTotalsbriefFaxResultsTotals FaxResultsTotals brief Totals of the end results of the faxes. See below for more details.
FaxMessagesArray of FaxMessagesendsend List of each fax in the query. See below for more details.

FaxStatusTotals:

Contains the total count of how many faxes are at each status. To see more information on each fax status, view the FaxStatus table below.

NameTypeVerbosityDescription
pendingLongbriefFax is pending on the system and waiting to be processed.
processingLongbriefFax is in the initial processing stages.
queuedLongbriefFax has finished processing and is queued, ready to send out at the send time.
startingLongbriefFax is ready to be sent out.
sendingLongbriefFax has been spooled to our servers and is in the process of being sent out.
finalizingLongbriefFax has finished sending and the results are being processed.
doneLongbriefFax has completed and no further actions will take place. The detailed results are available at this status.

FaxResultsTotals:

Contains the total count of how many faxes ended in each result, as well as some additional totals. To view more information on each fax result, view the FaxResults table below.

NameTypeVerbosityDescription
successLongbriefFax has successfully been delivered to its destination.
blockedLongbriefDestination number was found in one of the block lists.
failedLongbriefFax failed getting to its destination.
totalAttemptsLongbriefTotal attempts made in the reference context.
totalFaxDurationLongbrieftotalFaxDuration Long brief Total time spent on the line in the reference context.
totalPagesLongbriefTotal pages sent in the reference context.

apiFaxMessageStatus:

NameTypeVerbosityDescription
messageRefStringsend
sendRefStringsend
broadcastRefStringsend
sendToStringsend
statussendThe current status of the fax message. See the FaxStatus table above for possible status values.
FaxDetailsFaxDetailsdetailsContains the details and settings the fax was sent with. See below for more details.
FaxResultsArray of FaxResultresultsContains the results of each attempt at sending the fax message and their connection details. See below for more details.

FaxDetails:

NameTypeVerbosity
sendFromAlphanumeric Stringdetails
resolutionStringdetails
retriesIntegerdetails
busyRetriesIntegerdetails
headerFormatStringdetails

FaxResults:

NameTypeVerbosityDescription
attemptIntegerresultsThe attempt number of the FaxResult.
resultStringresultsThe result of the fax message. See the FaxResults table above for all possible results values.
ErrorFaxErrorresultsThe fax error code if the fax was not successful. See below for all possible values.
costBigDecimalresultsThe final cost of the fax message.
pagesIntegerresultsTotal pages sent to the end fax machine.
scheduledStartTimeDateTimeresultsThe date and time the fax is scheduled to start.
dateCallStartedDateTimeresultsDate and time the fax started transmitting.
dateCallEndedDateTimeresultsDate and time the fax finished transmitting.

FaxError:

ValueError Name
DOCUMENT_EXCEEDS_PAGE_LIMITDocument exceeds page limit
DOCUMENT_UNSUPPORTEDUnsupported document type
DOCUMENT_FAILED_CONVERSIONDocument failed conversion
FUNDS_INSUFFICIENTInsufficient funds
FUNDS_FAILEDFailed to transfer funds
BLOCK_ACCOUNTNumber cannot be sent from this account
BLOCK_GLOBALNumber found in the Global blocklist
BLOCK_SMARTNumber found in the Smart blocklist
BLOCK_DNCRNumber found in the DNCR blocklist
BLOCK_CUSTOMNumber found in a user specified blocklist
FAX_NEGOTIATION_FAILEDNegotiation failed
FAX_EARLY_HANGUPEarly hang-up on call
FAX_INCOMPATIBLE_MACHINEIncompatible fax machine
FAX_BUSYPhone number busy
FAX_NUMBER_UNOBTAINABLENumber unobtainable
FAX_SENDING_FAILEDSending fax failed
FAX_CANCELLEDCancelled
FAX_NO_ANSWERNo answer
FAX_UNKNOWNUnknown fax error

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

StopFax

Description

Stops a fax message from sending. This fax message must either be paused, queued, starting or sending. Please note the fax cannot be stopped if the fax is currently in the process of being transmitted to the destination device.

When making a stop request you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

StopFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

StopFax Request limiting by BroadcastRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->BroadcastRef = "Broadcast-test-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by SendRef:

$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->SendRef = "Send-Ref-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by MessageRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->MessageRef = "Testing-message-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

Response

The response received from a StopFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PauseFax

Description

Pauses a fax message before it starts transmitting. This fax message must either be queued, starting or sending. Please note the fax cannot be paused if the message is currently being transmitted to the destination device.

When making a pause request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

PauseFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

PauseFax Request limiting by BroadcastRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->BroadcastRef = "Broadcast-test-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by SendRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->SendRef = "Send-Ref-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by MessageRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->MessageRef = "Testing-message-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

Response

The response received from a PauseFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults in here.

ResumeFax

When making a resume request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

ResumeFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

ResumeFax Request limiting by BroadcastRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->BroadcastRef = "Broadcast-test-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by SendRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->SendRef = "Send-Ref-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by MessageRef:

$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->MessageRef = "Testing-message-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

Response

The response received from a ResumeFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PreviewFaxDocument

Description

This function provides you with a method to generate a preview of a saved document at different resolutions with various dithering settings. It returns a tiff data in base64 along with a page count.

Normal PreviewFaxDocument Request

// TODO: Put your file path here$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello World!";
$monopondStampMergeField = newMonopondStampMergeField();
$monopondStampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$monopondStampMergeField->TextValue = $stampMergeFieldTextValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-document-ref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($monopondStampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($stampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with DocMergeData

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "field1";
$mergeField->Value = "Raspberry Pi";
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "field2";
$mergeField2->Value = "Human";
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-documentref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->DocMergeData = array($mergeField, $mergeField2);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

Request

FaxDocumentPreviewRequest Parameters:

NameRequiredTypeDescriptionDefault
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
DitheringTechniqueFaxDitheringTechniqueApplies a custom dithering method to the fax document before transmission.
DocMergeDataArray of DocMergeData MergeFieldsEach mergefield has a key and a value. The system will look for the keys in a document and replace them with their corresponding value.
StampMergeDataArray of StampMergeData MergeFieldsEach mergefield has a key a corressponding TextValue/ImageValue. The system will look for the keys in a document and replace them with their corresponding value.

DocMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Parameters:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Parameters:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Parameters:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

FaxDocumentPreviewResponse

NameTypeDescription
TiffPreviewStringA preview version of the document encoded in Base64 format.
NumberOfPagesIntTotal number of pages in the document preview.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException, UnsupportedDocumentContentType, MergeFieldDoesNotMatchDocumentTypeException, UnknownHostException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

SaveFaxDocument

Description

This function allows you to upload a document and save it under a document reference (DocumentRef) for later use. (Note: These saved documents only last 30 days on the system.)

Sample Request

$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$saveFaxDocumentRequest = newMonopondSaveFaxDocumentRequest();
$saveFaxDocumentRequest->DocumentRef = "sample-document-ref";
$saveFaxDocumentRequest->FileName = "test.pdf";
$saveFaxDocumentRequest->FileData = $filedata;
$saveFaxDocumentResponse = $client->saveFaxDocument($saveFaxDocumentRequest);
print_r($saveFaxDocumentResponse);

Request

SaveFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefXStringUnique identifier for the document to be uploaded.
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefAlreadyExistsException, DocumentContentTypeNotFoundException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

DeleteFaxDocument

Description

This function removes a saved fax document from the system.

Sample Request

// TODO: Put your file path here$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$deleteFaxDocumentRequest = newMonopondDeleteFaxDocumentRequest();
$deleteFaxDocumentRequest->DocumentRef = "sample-document-ref";
// Call delete FaxDocument method$deleteRespone = $client->deleteFaxDocument($deleteFaxDocumentRequest);
print_r($deleteRespone);

Request

DeleteFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefStringUnique identifier for the document to be deleted.
MessageRefStringUser-defined message reference.
SendRefStringUser-defined send reference.
BroadcastRefStringUser-defined broadcast reference.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

More Information

Exceptions/SOAP Faults

If an error occurs during a request on the Monopond Fax API the service will throw a SOAP fault or exception. Each exception is listed in detail below.

InvalidArgumentsException

One or more of the arguments passed in the request were invalid. Each element that failed validation is included in the fault details along with the reason for failure.

DocumentContentTypeNotFoundException

There was an error while decoding the document provided; we were unable to determine its content type.

DocumentRefAlreadyExistsException

There is already a document on your account with this DocumentRef.

DocumentContentTypeNotFoundException

Content type could not be found for the document.

NoMessagesFoundException

Based on the references sent in the request no messages could be found that match the criteria.

InternalServerException

An unusual error occurred on the platform. If this error occurs please contact support for further instruction.

General Properties and File Formatting

File Encoding

All files are encoded in the Base64 encoding specified in RFC 2045 - MIME (Multipurpose Internet Mail Extensions). The Base64 encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used, enabling 6 bits to be represented per printable character. For more information see http://tools.ietf.org/html/rfc2045 and http://en.wikipedia.org/wiki/Base64

Dates

Dates are always passed in ISO-8601 format with time zone. For example: “2012-07-17T19:27:23+08:00”

MonopondSendFaxRequest Properties

NameRequiredTypeDescriptionDefault
BroadcastRefStringAllows the user to tag all faxes in this request with a user-defined broadcastreference. These faxes can then be retrieved at a later point based on this reference.
SendRefStringSimilar to the BroadcastRef, this allows the user to tag all faxes in this request with a send reference. The SendRef is used to represent all faxes in this request only, so naturally it must be unique.
FaxMessagesXArray of FaxMessageFaxMessages describe each individual fax message and its destination. See below for details.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersFax
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Current time (immediate sending)
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details.WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Each account has a maximum number of busy retries that can be changed by consultation with your account manager.Account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20

MonopondFaxMessage Properties

This represents a single fax message being sent to a destination.

NameRequiredTypeDescriptionDefault
MessageRefXStringA unique user-provided identifier that is used to identify the fax message. This can be used at a later point to retrieve the results of the fax message.
SendToXStringThe phone number the fax message will be sent to.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersEmpty
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Start now
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details. WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Please consult with your account manager in regards to maximum value.account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20
CLIStringAllows a customer called ID. Note: Must be enabled on the account before it can be used.

MonopondDocument Properties

Represents a fax document to be sent through the system. Supported file types are: PDF, TIFF, PNG, JPG, GIF, TXT, PS, RTF, DOC, DOCX, XLS, XLSX, PPT, PPTX.

NameRequiredTypeDescriptionDefault
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.
OrderXIntegerIf multiple documents are defined on a message this value will determine the order in which they will be transmitted.0
DocMergeDataAn Array of MergeFields
StampMergeDataAn Array of MergeFields

Resolution Levels

ValueDescription
normalNormal standard resolution (98 scan lines per inch)
fineFine resolution (196 scan lines per inch)

FaxDitheringTechnique

ValueFax Dithering Technique
noneNo dithering.
normalNormal dithering.
turboTurbo dithering.
darkenDarken dithering.
darken_moreDarken more dithering.
darken_extraDarken extra dithering.
lightenLighten dithering.
lighten_moreLighten more dithering.
crosshatchCrosshatch dithering.
DETAILEDDetailed dithering.

Header Format

Determines the format of the header line that is printed on the top of the transmitted fax message. This is set to **rom %from%, To %to%|%a %b %d %H:%M %Y”**y default which produces the following:

From TSID, To 61022221234 Mon Aug 28 15:32 2012 1 of 1

ValueDescription
%from%The value of the SendFrom field in the message.
%to%The value of the SendTo field in the message.
%aWeekday name (abbreviated)
%AWeekday name
%bMonth name (abbreviated)
%BMonth name
%dDay of the month as a decimal (01 – 31)
%mMonth as a decimal (01 – 12)
%yYear as a decimal (abbreviated)
%YYear as a decimal
%HHour as a decimal using a 24-hour clock (00 – 23)
%IHour as a decimal using a 12-hour clock (01 – 12)
%MMinute as a decimal (00 – 59)
%SSecond as a decimal (00 – 59)
%pAM or PM
%jDay of the year as a decimal (001 – 366)
%UWeek of the year as a decimal (Monday as first day of the week) (00 – 53)
%WDay of the year as a decimal (001 – 366)
%wDay of the week as a decimal (0 – 6) (Sunday being 0)
%%A literal % character

TODO: The default value is set to: “From %from%, To %to%|%a %b %d %H:%M %Y”

Blocklists Parameters

NameRequiredTypeDescription
smartblockfalsebooleanBlocks sending to a number if it has consistently failed in the past.
fpsfalsebooleanWash numbers against the fps blocklist.
dncrfalsebooleanWash numbers against the dncr blocklist.

About

Monopond Fax API PHP Client

Resources

Stars

3 stars

Watchers

17 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

api-client-php

Monopond Fax API PHP Client

#Building a Request To use Monopond SOAP PHP Client, start by including the MonopondSOAPClient.php then creating an instance of the client by supplying your credentials. Your username and password should be enclosed in quotation marks.

<?phpinclude_once'./MonopondSOAPClient.php';
// TODO: Enter your own credentials here$client = newMonopondSOAPClientV2_1("myusername", "mypassword", MPENV::PRODUCTION);
// TODO: Set up your request here?>

SendFax

Description

This is the core function in the API allowing you to send faxes on the platform.

Your specific faxing requirements will dictate which send request type below should be used. The two common use cases would be the sending of a single fax document to one destination and the sending of a single fax document to multiple destinations.

Sending a single fax:

To send a fax to a single destination a request similar to the following example can be used:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents = array($document);
// TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
// Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know the definitions:

Assigning DocumentRef in MonopondDocument

DocumentRef must be unique and a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DocumentRef = "Sample DocumentRef";
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document2->DocumentRef = "Sample DocumentRef2";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here to check the definition of DocumentRef:

Assigning SendRef and BroadcastRef in MonopondSendFaxRequest

To assign SendRef and BroadcastRef in MonopondSendFaxRequest, a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "Testing";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BroadcastRef = "BroadcastRef";
$sendFaxRequest->SendRef = "SendRef";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Visit here to know the definitions of SendRef and BroadcastRef:

Sending a Fax with Retries inside a MonopondFaxMessage

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Retries = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Retries inside a MonopondSendFaxRequest

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Retries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondFaxMessage

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->BusyRetries = 1;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondSendFaxRequest

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BusyRetries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Resolution in MonopondFaxMessage

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Resolution = "normal";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with Resolution in MonopondSendFaxRequest

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Resolution = "fine";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with FaxDitheringTechnique in MonopondDocument:

To set the fax FaxDitheringTechnique, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DitheringTechnique = "turbo";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the different values of FaxDitheringTechnique here:

Assigning a Timezone in MonopondFaxMessage

The Timezone is used to format the datetime display in the fax header.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->TimeZone = "Australia/Adelaide";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning a Timezone in MonopondSendFaxRequest

The Timezone is used to format the datetime display in the fax header. Applying it to the MonopondSendFaxRequest will apply this to all MonopondFaxMessages in the request.

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->TimeZone = "Australia/Adelaide";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning SendFrom in MonopondFaxMessage

To send fax with SendFrom in MonopondFaxMessage a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Sample SendFrom";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning SendFrom in MonopondSendFaxRequest

To send fax with SendFrom in MonopondSendFaxRequest a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->SendFrom = "Test Example";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning a HeaderFormat in MonopondFaxMessage

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning a HeaderFormat in MonopondSendFaxRequest

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning CLI in MonopondFaxMessage

Assigning a CLI in the MonopondFaxMessage, a request similar to the following example below.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->CLI = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of CLI here:

Sending a Fax with DNCR enabled in MonopondFaxMessage

To check if a number is on the Do Not Call Register (Australian) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with FPS enabled in MonopondFaxMessage

To check if a number is on the FPS blacklist (UK) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->fps = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with Smartblock enabled in MonopondFaxMessage

To check if a number is on the Smartblock list before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->smartblock = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Add a Blocklists in MonopondSendFaxRequest

If you want to validate all numbers in DNCR or FPS or Smarblock, a request must be similiar to this example:

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Blocklists = $monopondBlocklists;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with ScheduledStartTime in MonopondFaxMessage

To set a ScheduledStartTime for the MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->ScheduledStartTime = "2017-06-25T12:00:00Z";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with ScheduledStartTime in MonopondSendFaxRequest

To set a ScheduledStartTime for the MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with MustBeSentBeforeDate in MonopondFaxMessage

To set a MustBeSentBeforeDate for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MustBeSentBeforeDate in MonopondSendFaxRequest

To set a MustBeSentBeforeDate for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MaxFaxPages in MonopondFaxMessage

To set a MaxFaxPages for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MaxFaxPages = 1;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MaxFaxPages = 2;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending a Fax with MaxFaxPages in MonopondSendFaxRequest

To set a MaxFaxPages for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MaxFaxPages = 2;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending multiple faxes:

To send faxes to multiple destinations a request similar to the following example can be used. Please note the addition of another FaxMessage:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName2.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document3 = newMonopondDocument();
$document3->FileName = "AnyFileName3.txt";
$document3->FileData = $filedata;
$document3->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents[] = $document;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->Documents[] = $document2;
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
$faxMessage3->Documents[] = $document3;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending faxes to multiple destinations with the same document (broadcasting):

To send the same fax content to multiple destinations (broadcasting) a request similar to the example below can be used.

This method is recommended for broadcasting as it takes advantage of the multiple tiers in the send request. This eliminates the repeated parameters out of the individual fax message elements which are instead inherited from the parent send fax request. An example below shows SendFrom being used for both FaxMessages. While not shown in the example below further control can be achieved over individual fax elements to override the parameters set in the parent.

When sending multiple faxes in batch it is recommended to group them into requests of around 600 fax messages for optimal performance. If you are sending the same document to multiple destinations it is strongly advised to only attach the document once in the root of the send request rather than attaching a document for each destination.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Microsoft Documents With DocMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request is used to send a Microsoft document with replaceable variables or merge fields. The merge field follows the pattern <mf:key>. If your key is field1, it should be typed as <mf:field1> in the document. Note that the key must be unique within the whole document. The screenshots below are examples of what the request does.

Original .doc file:

before

This is what the file looks like after the fields field1,field2 and field3 have been replaced with values lazy dog, fat pig and fat pig:

stamp

Sample Request

The example below shows field1 will be replaced by the value of Test.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "name";
$mergeField->Value = "Raspberry Pi";
$document1 = newMonopondDocument();
$document1->DocumentRef = "send-1-document";
$document1->DocMergeData[] = $mergeField;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "message-1";
$faxMessage->SendTo = "61290120211";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Resolution = "normal";
$faxMessage->Retries = 0;
$faxMessage->BusyRetries = 2;
$faxMessage->CLI = 61290120211;
$faxMessage->Documents = array($document1);
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "name";
$mergeField2->Value = "Raspberry Pi 2";
$document2 = newMonopondDocument();
$document2->DocumentRef = "send-1-document";
$document2->DocMergeData[] = $mergeField2;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "message-2";
$faxMessage2->SendTo = "61290120211";
$faxMessage2->SendFrom = "Test Fax 2";
$faxMessage2->Resolution = "normal";
$faxMessage2->Retries = 0;
$faxMessage2->BusyRetries = 2;
$faxMessage2->CLI = 61011114111;
$faxMessage2->Documents = array($document2);
$baseDocument = newMonopondDocument();
$baseDocument->DocumentRef = "send-1-document2";
$baseDocument->FileName = "file.doc";
$baseDocument->FileData = $filedata;
$baseDocument->Order = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "broadcast-1";
$sendFaxRequest->SendRef = "send-1";
$sendFaxRequest->HeaderFormat = "Testing";
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->FaxMessages[] = $faxMessage2;
$sendFaxRequest->Documents = array($baseDocument);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Tiff and PDF files with StampMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request allows a TIFF file to be stamped with an image or text, based on X-Y coordinates. The x and y coordinates (0,0) starts at the top left part of the document. The screenshots below are examples of what the request does.

Original tiff file:

before

Sample stamp image:

stamp

This is what the tiff file looks like after stamping it with the image above:

after

The same tiff file, but this time, with a text stamp:

after

Sample Request

The example below shows a TIFF that will be stamped with the text “Hello” at xCoord=“1287” and yCoord=“421”, and an image at xCoord=“283” and yCoord=“120”

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "1287";
$stampMergeFieldKey->yCoord = "421";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->TextValue = $stampMergeFieldTextValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

Request with Image Stamping

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "283";
$stampMergeFieldKey->yCoord = "120";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

DocMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Properties:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Properties:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Properties:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

Response

The response received from a SendFaxRequest matches the response you receive when calling the FaxStatus method call with a send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, DocumentContentTypeNotFoundException, or InternalServerException. You can find more details on these faults here.

FaxStatus

Description

This function provides you with a method of retrieving the status, details and results of fax messages sent. While this is a legitimate method of retrieving results we strongly advise that you take advantage of our callback service, which will push these fax results to you as they are completed.

When making a status request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow the request query.

  • Limiting by a BroadcastRef allows you to retrieve faxes contained in a group of send requests.
  • Limiting by SendRef allows you to retrieve faxes contained in a single send request.
  • Limiting by MessageRef allows you to retrieve a single fax message.

There are multiple levels of verbosity available in the request; these are explained in detail below.

FaxStatusRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.
VerbosityStringVerbosity String The level of detail in the status response. Please see below for a list of possible values.

Verbosity Levels:

ValueDescription
briefGives you an overall view of the messages. This simply shows very high-level statistics, consisting of counts of how many faxes are at each status (i.e. processing, queued,sending) and totals of the results of these faxes (success, failed, blocked).
sendsend Includes the results from “brief” while also including an itemised list of each fax message in the request.
detailsdetails Includes the results from “send” along with details of the properties used to send the fax messages.
resultsIncludes the results from “send” along with the sending results of the fax messages.
allall Includes the results from both “details” and “results” along with some extra uncommon fields.

Sending a faxStatus Request with “brief” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "brief";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “send” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "send";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “details” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "details";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “results” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "results";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Response

The response received depends entirely on the verbosity level specified.

FaxStatusResponse:

NameTypeVerbosityDescription
FaxStatusTotalsFaxStatusTotalsbriefCounts of how many faxes are at each status. See below for more details.
FaxResultsTotalsFaxResultsTotalsbriefFaxResultsTotals FaxResultsTotals brief Totals of the end results of the faxes. See below for more details.
FaxMessagesArray of FaxMessagesendsend List of each fax in the query. See below for more details.

FaxStatusTotals:

Contains the total count of how many faxes are at each status. To see more information on each fax status, view the FaxStatus table below.

NameTypeVerbosityDescription
pendingLongbriefFax is pending on the system and waiting to be processed.
processingLongbriefFax is in the initial processing stages.
queuedLongbriefFax has finished processing and is queued, ready to send out at the send time.
startingLongbriefFax is ready to be sent out.
sendingLongbriefFax has been spooled to our servers and is in the process of being sent out.
finalizingLongbriefFax has finished sending and the results are being processed.
doneLongbriefFax has completed and no further actions will take place. The detailed results are available at this status.

FaxResultsTotals:

Contains the total count of how many faxes ended in each result, as well as some additional totals. To view more information on each fax result, view the FaxResults table below.

NameTypeVerbosityDescription
successLongbriefFax has successfully been delivered to its destination.
blockedLongbriefDestination number was found in one of the block lists.
failedLongbriefFax failed getting to its destination.
totalAttemptsLongbriefTotal attempts made in the reference context.
totalFaxDurationLongbrieftotalFaxDuration Long brief Total time spent on the line in the reference context.
totalPagesLongbriefTotal pages sent in the reference context.

apiFaxMessageStatus:

NameTypeVerbosityDescription
messageRefStringsend
sendRefStringsend
broadcastRefStringsend
sendToStringsend
statussendThe current status of the fax message. See the FaxStatus table above for possible status values.
FaxDetailsFaxDetailsdetailsContains the details and settings the fax was sent with. See below for more details.
FaxResultsArray of FaxResultresultsContains the results of each attempt at sending the fax message and their connection details. See below for more details.

FaxDetails:

NameTypeVerbosity
sendFromAlphanumeric Stringdetails
resolutionStringdetails
retriesIntegerdetails
busyRetriesIntegerdetails
headerFormatStringdetails

FaxResults:

NameTypeVerbosityDescription
attemptIntegerresultsThe attempt number of the FaxResult.
resultStringresultsThe result of the fax message. See the FaxResults table above for all possible results values.
ErrorFaxErrorresultsThe fax error code if the fax was not successful. See below for all possible values.
costBigDecimalresultsThe final cost of the fax message.
pagesIntegerresultsTotal pages sent to the end fax machine.
scheduledStartTimeDateTimeresultsThe date and time the fax is scheduled to start.
dateCallStartedDateTimeresultsDate and time the fax started transmitting.
dateCallEndedDateTimeresultsDate and time the fax finished transmitting.

FaxError:

ValueError Name
DOCUMENT_EXCEEDS_PAGE_LIMITDocument exceeds page limit
DOCUMENT_UNSUPPORTEDUnsupported document type
DOCUMENT_FAILED_CONVERSIONDocument failed conversion
FUNDS_INSUFFICIENTInsufficient funds
FUNDS_FAILEDFailed to transfer funds
BLOCK_ACCOUNTNumber cannot be sent from this account
BLOCK_GLOBALNumber found in the Global blocklist
BLOCK_SMARTNumber found in the Smart blocklist
BLOCK_DNCRNumber found in the DNCR blocklist
BLOCK_CUSTOMNumber found in a user specified blocklist
FAX_NEGOTIATION_FAILEDNegotiation failed
FAX_EARLY_HANGUPEarly hang-up on call
FAX_INCOMPATIBLE_MACHINEIncompatible fax machine
FAX_BUSYPhone number busy
FAX_NUMBER_UNOBTAINABLENumber unobtainable
FAX_SENDING_FAILEDSending fax failed
FAX_CANCELLEDCancelled
FAX_NO_ANSWERNo answer
FAX_UNKNOWNUnknown fax error

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

StopFax

Description

Stops a fax message from sending. This fax message must either be paused, queued, starting or sending. Please note the fax cannot be stopped if the fax is currently in the process of being transmitted to the destination device.

When making a stop request you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

StopFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

StopFax Request limiting by BroadcastRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->BroadcastRef = "Broadcast-test-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by SendRef:

$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->SendRef = "Send-Ref-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by MessageRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->MessageRef = "Testing-message-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

Response

The response received from a StopFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PauseFax

Description

Pauses a fax message before it starts transmitting. This fax message must either be queued, starting or sending. Please note the fax cannot be paused if the message is currently being transmitted to the destination device.

When making a pause request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

PauseFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

PauseFax Request limiting by BroadcastRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->BroadcastRef = "Broadcast-test-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by SendRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->SendRef = "Send-Ref-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by MessageRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->MessageRef = "Testing-message-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

Response

The response received from a PauseFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults in here.

ResumeFax

When making a resume request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

ResumeFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

ResumeFax Request limiting by BroadcastRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->BroadcastRef = "Broadcast-test-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by SendRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->SendRef = "Send-Ref-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by MessageRef:

$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->MessageRef = "Testing-message-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

Response

The response received from a ResumeFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PreviewFaxDocument

Description

This function provides you with a method to generate a preview of a saved document at different resolutions with various dithering settings. It returns a tiff data in base64 along with a page count.

Normal PreviewFaxDocument Request

// TODO: Put your file path here$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello World!";
$monopondStampMergeField = newMonopondStampMergeField();
$monopondStampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$monopondStampMergeField->TextValue = $stampMergeFieldTextValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-document-ref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($monopondStampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($stampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with DocMergeData

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "field1";
$mergeField->Value = "Raspberry Pi";
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "field2";
$mergeField2->Value = "Human";
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-documentref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->DocMergeData = array($mergeField, $mergeField2);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

Request

FaxDocumentPreviewRequest Parameters:

NameRequiredTypeDescriptionDefault
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
DitheringTechniqueFaxDitheringTechniqueApplies a custom dithering method to the fax document before transmission.
DocMergeDataArray of DocMergeData MergeFieldsEach mergefield has a key and a value. The system will look for the keys in a document and replace them with their corresponding value.
StampMergeDataArray of StampMergeData MergeFieldsEach mergefield has a key a corressponding TextValue/ImageValue. The system will look for the keys in a document and replace them with their corresponding value.

DocMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Parameters:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Parameters:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Parameters:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

FaxDocumentPreviewResponse

NameTypeDescription
TiffPreviewStringA preview version of the document encoded in Base64 format.
NumberOfPagesIntTotal number of pages in the document preview.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException, UnsupportedDocumentContentType, MergeFieldDoesNotMatchDocumentTypeException, UnknownHostException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

SaveFaxDocument

Description

This function allows you to upload a document and save it under a document reference (DocumentRef) for later use. (Note: These saved documents only last 30 days on the system.)

Sample Request

$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$saveFaxDocumentRequest = newMonopondSaveFaxDocumentRequest();
$saveFaxDocumentRequest->DocumentRef = "sample-document-ref";
$saveFaxDocumentRequest->FileName = "test.pdf";
$saveFaxDocumentRequest->FileData = $filedata;
$saveFaxDocumentResponse = $client->saveFaxDocument($saveFaxDocumentRequest);
print_r($saveFaxDocumentResponse);

Request

SaveFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefXStringUnique identifier for the document to be uploaded.
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefAlreadyExistsException, DocumentContentTypeNotFoundException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

DeleteFaxDocument

Description

This function removes a saved fax document from the system.

Sample Request

// TODO: Put your file path here$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$deleteFaxDocumentRequest = newMonopondDeleteFaxDocumentRequest();
$deleteFaxDocumentRequest->DocumentRef = "sample-document-ref";
// Call delete FaxDocument method$deleteRespone = $client->deleteFaxDocument($deleteFaxDocumentRequest);
print_r($deleteRespone);

Request

DeleteFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefStringUnique identifier for the document to be deleted.
MessageRefStringUser-defined message reference.
SendRefStringUser-defined send reference.
BroadcastRefStringUser-defined broadcast reference.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

More Information

Exceptions/SOAP Faults

If an error occurs during a request on the Monopond Fax API the service will throw a SOAP fault or exception. Each exception is listed in detail below.

InvalidArgumentsException

One or more of the arguments passed in the request were invalid. Each element that failed validation is included in the fault details along with the reason for failure.

DocumentContentTypeNotFoundException

There was an error while decoding the document provided; we were unable to determine its content type.

DocumentRefAlreadyExistsException

There is already a document on your account with this DocumentRef.

DocumentContentTypeNotFoundException

Content type could not be found for the document.

NoMessagesFoundException

Based on the references sent in the request no messages could be found that match the criteria.

InternalServerException

An unusual error occurred on the platform. If this error occurs please contact support for further instruction.

General Properties and File Formatting

File Encoding

All files are encoded in the Base64 encoding specified in RFC 2045 - MIME (Multipurpose Internet Mail Extensions). The Base64 encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used, enabling 6 bits to be represented per printable character. For more information see http://tools.ietf.org/html/rfc2045 and http://en.wikipedia.org/wiki/Base64

Dates

Dates are always passed in ISO-8601 format with time zone. For example: “2012-07-17T19:27:23+08:00”

MonopondSendFaxRequest Properties

NameRequiredTypeDescriptionDefault
BroadcastRefStringAllows the user to tag all faxes in this request with a user-defined broadcastreference. These faxes can then be retrieved at a later point based on this reference.
SendRefStringSimilar to the BroadcastRef, this allows the user to tag all faxes in this request with a send reference. The SendRef is used to represent all faxes in this request only, so naturally it must be unique.
FaxMessagesXArray of FaxMessageFaxMessages describe each individual fax message and its destination. See below for details.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersFax
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Current time (immediate sending)
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details.WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Each account has a maximum number of busy retries that can be changed by consultation with your account manager.Account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20

MonopondFaxMessage Properties

This represents a single fax message being sent to a destination.

NameRequiredTypeDescriptionDefault
MessageRefXStringA unique user-provided identifier that is used to identify the fax message. This can be used at a later point to retrieve the results of the fax message.
SendToXStringThe phone number the fax message will be sent to.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersEmpty
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Start now
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details. WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Please consult with your account manager in regards to maximum value.account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20
CLIStringAllows a customer called ID. Note: Must be enabled on the account before it can be used.

MonopondDocument Properties

Represents a fax document to be sent through the system. Supported file types are: PDF, TIFF, PNG, JPG, GIF, TXT, PS, RTF, DOC, DOCX, XLS, XLSX, PPT, PPTX.

NameRequiredTypeDescriptionDefault
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.
OrderXIntegerIf multiple documents are defined on a message this value will determine the order in which they will be transmitted.0
DocMergeDataAn Array of MergeFields
StampMergeDataAn Array of MergeFields

Resolution Levels

ValueDescription
normalNormal standard resolution (98 scan lines per inch)
fineFine resolution (196 scan lines per inch)

FaxDitheringTechnique

ValueFax Dithering Technique
noneNo dithering.
normalNormal dithering.
turboTurbo dithering.
darkenDarken dithering.
darken_moreDarken more dithering.
darken_extraDarken extra dithering.
lightenLighten dithering.
lighten_moreLighten more dithering.
crosshatchCrosshatch dithering.
DETAILEDDetailed dithering.

Header Format

Determines the format of the header line that is printed on the top of the transmitted fax message. This is set to **rom %from%, To %to%|%a %b %d %H:%M %Y”**y default which produces the following:

From TSID, To 61022221234 Mon Aug 28 15:32 2012 1 of 1

ValueDescription
%from%The value of the SendFrom field in the message.
%to%The value of the SendTo field in the message.
%aWeekday name (abbreviated)
%AWeekday name
%bMonth name (abbreviated)
%BMonth name
%dDay of the month as a decimal (01 – 31)
%mMonth as a decimal (01 – 12)
%yYear as a decimal (abbreviated)
%YYear as a decimal
%HHour as a decimal using a 24-hour clock (00 – 23)
%IHour as a decimal using a 12-hour clock (01 – 12)
%MMinute as a decimal (00 – 59)
%SSecond as a decimal (00 – 59)
%pAM or PM
%jDay of the year as a decimal (001 – 366)
%UWeek of the year as a decimal (Monday as first day of the week) (00 – 53)
%WDay of the year as a decimal (001 – 366)
%wDay of the week as a decimal (0 – 6) (Sunday being 0)
%%A literal % character

TODO: The default value is set to: “From %from%, To %to%|%a %b %d %H:%M %Y”

Blocklists Parameters

NameRequiredTypeDescription
smartblockfalsebooleanBlocks sending to a number if it has consistently failed in the past.
fpsfalsebooleanWash numbers against the fps blocklist.
dncrfalsebooleanWash numbers against the dncr blocklist.

About

Monopond Fax API PHP Client

Resources

Stars

3 stars

Watchers

17 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

api-client-php

Monopond Fax API PHP Client

#Building a Request To use Monopond SOAP PHP Client, start by including the MonopondSOAPClient.php then creating an instance of the client by supplying your credentials. Your username and password should be enclosed in quotation marks.

<?phpinclude_once'./MonopondSOAPClient.php';
// TODO: Enter your own credentials here$client = newMonopondSOAPClientV2_1("myusername", "mypassword", MPENV::PRODUCTION);
// TODO: Set up your request here?>

SendFax

Description

This is the core function in the API allowing you to send faxes on the platform.

Your specific faxing requirements will dictate which send request type below should be used. The two common use cases would be the sending of a single fax document to one destination and the sending of a single fax document to multiple destinations.

Sending a single fax:

To send a fax to a single destination a request similar to the following example can be used:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents = array($document);
// TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
// Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know the definitions:

Assigning DocumentRef in MonopondDocument

DocumentRef must be unique and a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DocumentRef = "Sample DocumentRef";
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document2->DocumentRef = "Sample DocumentRef2";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here to check the definition of DocumentRef:

Assigning SendRef and BroadcastRef in MonopondSendFaxRequest

To assign SendRef and BroadcastRef in MonopondSendFaxRequest, a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "Testing";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BroadcastRef = "BroadcastRef";
$sendFaxRequest->SendRef = "SendRef";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Visit here to know the definitions of SendRef and BroadcastRef:

Sending a Fax with Retries inside a MonopondFaxMessage

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Retries = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Retries inside a MonopondSendFaxRequest

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Retries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondFaxMessage

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->BusyRetries = 1;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondSendFaxRequest

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BusyRetries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Resolution in MonopondFaxMessage

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Resolution = "normal";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with Resolution in MonopondSendFaxRequest

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Resolution = "fine";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with FaxDitheringTechnique in MonopondDocument:

To set the fax FaxDitheringTechnique, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DitheringTechnique = "turbo";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the different values of FaxDitheringTechnique here:

Assigning a Timezone in MonopondFaxMessage

The Timezone is used to format the datetime display in the fax header.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->TimeZone = "Australia/Adelaide";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning a Timezone in MonopondSendFaxRequest

The Timezone is used to format the datetime display in the fax header. Applying it to the MonopondSendFaxRequest will apply this to all MonopondFaxMessages in the request.

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->TimeZone = "Australia/Adelaide";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning SendFrom in MonopondFaxMessage

To send fax with SendFrom in MonopondFaxMessage a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Sample SendFrom";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning SendFrom in MonopondSendFaxRequest

To send fax with SendFrom in MonopondSendFaxRequest a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->SendFrom = "Test Example";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning a HeaderFormat in MonopondFaxMessage

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning a HeaderFormat in MonopondSendFaxRequest

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning CLI in MonopondFaxMessage

Assigning a CLI in the MonopondFaxMessage, a request similar to the following example below.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->CLI = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of CLI here:

Sending a Fax with DNCR enabled in MonopondFaxMessage

To check if a number is on the Do Not Call Register (Australian) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with FPS enabled in MonopondFaxMessage

To check if a number is on the FPS blacklist (UK) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->fps = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with Smartblock enabled in MonopondFaxMessage

To check if a number is on the Smartblock list before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->smartblock = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Add a Blocklists in MonopondSendFaxRequest

If you want to validate all numbers in DNCR or FPS or Smarblock, a request must be similiar to this example:

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Blocklists = $monopondBlocklists;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with ScheduledStartTime in MonopondFaxMessage

To set a ScheduledStartTime for the MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->ScheduledStartTime = "2017-06-25T12:00:00Z";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with ScheduledStartTime in MonopondSendFaxRequest

To set a ScheduledStartTime for the MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with MustBeSentBeforeDate in MonopondFaxMessage

To set a MustBeSentBeforeDate for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MustBeSentBeforeDate in MonopondSendFaxRequest

To set a MustBeSentBeforeDate for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MaxFaxPages in MonopondFaxMessage

To set a MaxFaxPages for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MaxFaxPages = 1;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MaxFaxPages = 2;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending a Fax with MaxFaxPages in MonopondSendFaxRequest

To set a MaxFaxPages for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MaxFaxPages = 2;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending multiple faxes:

To send faxes to multiple destinations a request similar to the following example can be used. Please note the addition of another FaxMessage:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName2.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document3 = newMonopondDocument();
$document3->FileName = "AnyFileName3.txt";
$document3->FileData = $filedata;
$document3->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents[] = $document;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->Documents[] = $document2;
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
$faxMessage3->Documents[] = $document3;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending faxes to multiple destinations with the same document (broadcasting):

To send the same fax content to multiple destinations (broadcasting) a request similar to the example below can be used.

This method is recommended for broadcasting as it takes advantage of the multiple tiers in the send request. This eliminates the repeated parameters out of the individual fax message elements which are instead inherited from the parent send fax request. An example below shows SendFrom being used for both FaxMessages. While not shown in the example below further control can be achieved over individual fax elements to override the parameters set in the parent.

When sending multiple faxes in batch it is recommended to group them into requests of around 600 fax messages for optimal performance. If you are sending the same document to multiple destinations it is strongly advised to only attach the document once in the root of the send request rather than attaching a document for each destination.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Microsoft Documents With DocMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request is used to send a Microsoft document with replaceable variables or merge fields. The merge field follows the pattern <mf:key>. If your key is field1, it should be typed as <mf:field1> in the document. Note that the key must be unique within the whole document. The screenshots below are examples of what the request does.

Original .doc file:

before

This is what the file looks like after the fields field1,field2 and field3 have been replaced with values lazy dog, fat pig and fat pig:

stamp

Sample Request

The example below shows field1 will be replaced by the value of Test.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "name";
$mergeField->Value = "Raspberry Pi";
$document1 = newMonopondDocument();
$document1->DocumentRef = "send-1-document";
$document1->DocMergeData[] = $mergeField;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "message-1";
$faxMessage->SendTo = "61290120211";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Resolution = "normal";
$faxMessage->Retries = 0;
$faxMessage->BusyRetries = 2;
$faxMessage->CLI = 61290120211;
$faxMessage->Documents = array($document1);
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "name";
$mergeField2->Value = "Raspberry Pi 2";
$document2 = newMonopondDocument();
$document2->DocumentRef = "send-1-document";
$document2->DocMergeData[] = $mergeField2;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "message-2";
$faxMessage2->SendTo = "61290120211";
$faxMessage2->SendFrom = "Test Fax 2";
$faxMessage2->Resolution = "normal";
$faxMessage2->Retries = 0;
$faxMessage2->BusyRetries = 2;
$faxMessage2->CLI = 61011114111;
$faxMessage2->Documents = array($document2);
$baseDocument = newMonopondDocument();
$baseDocument->DocumentRef = "send-1-document2";
$baseDocument->FileName = "file.doc";
$baseDocument->FileData = $filedata;
$baseDocument->Order = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "broadcast-1";
$sendFaxRequest->SendRef = "send-1";
$sendFaxRequest->HeaderFormat = "Testing";
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->FaxMessages[] = $faxMessage2;
$sendFaxRequest->Documents = array($baseDocument);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Tiff and PDF files with StampMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request allows a TIFF file to be stamped with an image or text, based on X-Y coordinates. The x and y coordinates (0,0) starts at the top left part of the document. The screenshots below are examples of what the request does.

Original tiff file:

before

Sample stamp image:

stamp

This is what the tiff file looks like after stamping it with the image above:

after

The same tiff file, but this time, with a text stamp:

after

Sample Request

The example below shows a TIFF that will be stamped with the text “Hello” at xCoord=“1287” and yCoord=“421”, and an image at xCoord=“283” and yCoord=“120”

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "1287";
$stampMergeFieldKey->yCoord = "421";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->TextValue = $stampMergeFieldTextValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

Request with Image Stamping

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "283";
$stampMergeFieldKey->yCoord = "120";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

DocMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Properties:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Properties:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Properties:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

Response

The response received from a SendFaxRequest matches the response you receive when calling the FaxStatus method call with a send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, DocumentContentTypeNotFoundException, or InternalServerException. You can find more details on these faults here.

FaxStatus

Description

This function provides you with a method of retrieving the status, details and results of fax messages sent. While this is a legitimate method of retrieving results we strongly advise that you take advantage of our callback service, which will push these fax results to you as they are completed.

When making a status request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow the request query.

  • Limiting by a BroadcastRef allows you to retrieve faxes contained in a group of send requests.
  • Limiting by SendRef allows you to retrieve faxes contained in a single send request.
  • Limiting by MessageRef allows you to retrieve a single fax message.

There are multiple levels of verbosity available in the request; these are explained in detail below.

FaxStatusRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.
VerbosityStringVerbosity String The level of detail in the status response. Please see below for a list of possible values.

Verbosity Levels:

ValueDescription
briefGives you an overall view of the messages. This simply shows very high-level statistics, consisting of counts of how many faxes are at each status (i.e. processing, queued,sending) and totals of the results of these faxes (success, failed, blocked).
sendsend Includes the results from “brief” while also including an itemised list of each fax message in the request.
detailsdetails Includes the results from “send” along with details of the properties used to send the fax messages.
resultsIncludes the results from “send” along with the sending results of the fax messages.
allall Includes the results from both “details” and “results” along with some extra uncommon fields.

Sending a faxStatus Request with “brief” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "brief";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “send” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "send";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “details” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "details";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “results” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "results";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Response

The response received depends entirely on the verbosity level specified.

FaxStatusResponse:

NameTypeVerbosityDescription
FaxStatusTotalsFaxStatusTotalsbriefCounts of how many faxes are at each status. See below for more details.
FaxResultsTotalsFaxResultsTotalsbriefFaxResultsTotals FaxResultsTotals brief Totals of the end results of the faxes. See below for more details.
FaxMessagesArray of FaxMessagesendsend List of each fax in the query. See below for more details.

FaxStatusTotals:

Contains the total count of how many faxes are at each status. To see more information on each fax status, view the FaxStatus table below.

NameTypeVerbosityDescription
pendingLongbriefFax is pending on the system and waiting to be processed.
processingLongbriefFax is in the initial processing stages.
queuedLongbriefFax has finished processing and is queued, ready to send out at the send time.
startingLongbriefFax is ready to be sent out.
sendingLongbriefFax has been spooled to our servers and is in the process of being sent out.
finalizingLongbriefFax has finished sending and the results are being processed.
doneLongbriefFax has completed and no further actions will take place. The detailed results are available at this status.

FaxResultsTotals:

Contains the total count of how many faxes ended in each result, as well as some additional totals. To view more information on each fax result, view the FaxResults table below.

NameTypeVerbosityDescription
successLongbriefFax has successfully been delivered to its destination.
blockedLongbriefDestination number was found in one of the block lists.
failedLongbriefFax failed getting to its destination.
totalAttemptsLongbriefTotal attempts made in the reference context.
totalFaxDurationLongbrieftotalFaxDuration Long brief Total time spent on the line in the reference context.
totalPagesLongbriefTotal pages sent in the reference context.

apiFaxMessageStatus:

NameTypeVerbosityDescription
messageRefStringsend
sendRefStringsend
broadcastRefStringsend
sendToStringsend
statussendThe current status of the fax message. See the FaxStatus table above for possible status values.
FaxDetailsFaxDetailsdetailsContains the details and settings the fax was sent with. See below for more details.
FaxResultsArray of FaxResultresultsContains the results of each attempt at sending the fax message and their connection details. See below for more details.

FaxDetails:

NameTypeVerbosity
sendFromAlphanumeric Stringdetails
resolutionStringdetails
retriesIntegerdetails
busyRetriesIntegerdetails
headerFormatStringdetails

FaxResults:

NameTypeVerbosityDescription
attemptIntegerresultsThe attempt number of the FaxResult.
resultStringresultsThe result of the fax message. See the FaxResults table above for all possible results values.
ErrorFaxErrorresultsThe fax error code if the fax was not successful. See below for all possible values.
costBigDecimalresultsThe final cost of the fax message.
pagesIntegerresultsTotal pages sent to the end fax machine.
scheduledStartTimeDateTimeresultsThe date and time the fax is scheduled to start.
dateCallStartedDateTimeresultsDate and time the fax started transmitting.
dateCallEndedDateTimeresultsDate and time the fax finished transmitting.

FaxError:

ValueError Name
DOCUMENT_EXCEEDS_PAGE_LIMITDocument exceeds page limit
DOCUMENT_UNSUPPORTEDUnsupported document type
DOCUMENT_FAILED_CONVERSIONDocument failed conversion
FUNDS_INSUFFICIENTInsufficient funds
FUNDS_FAILEDFailed to transfer funds
BLOCK_ACCOUNTNumber cannot be sent from this account
BLOCK_GLOBALNumber found in the Global blocklist
BLOCK_SMARTNumber found in the Smart blocklist
BLOCK_DNCRNumber found in the DNCR blocklist
BLOCK_CUSTOMNumber found in a user specified blocklist
FAX_NEGOTIATION_FAILEDNegotiation failed
FAX_EARLY_HANGUPEarly hang-up on call
FAX_INCOMPATIBLE_MACHINEIncompatible fax machine
FAX_BUSYPhone number busy
FAX_NUMBER_UNOBTAINABLENumber unobtainable
FAX_SENDING_FAILEDSending fax failed
FAX_CANCELLEDCancelled
FAX_NO_ANSWERNo answer
FAX_UNKNOWNUnknown fax error

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

StopFax

Description

Stops a fax message from sending. This fax message must either be paused, queued, starting or sending. Please note the fax cannot be stopped if the fax is currently in the process of being transmitted to the destination device.

When making a stop request you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

StopFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

StopFax Request limiting by BroadcastRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->BroadcastRef = "Broadcast-test-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by SendRef:

$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->SendRef = "Send-Ref-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by MessageRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->MessageRef = "Testing-message-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

Response

The response received from a StopFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PauseFax

Description

Pauses a fax message before it starts transmitting. This fax message must either be queued, starting or sending. Please note the fax cannot be paused if the message is currently being transmitted to the destination device.

When making a pause request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

PauseFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

PauseFax Request limiting by BroadcastRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->BroadcastRef = "Broadcast-test-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by SendRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->SendRef = "Send-Ref-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by MessageRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->MessageRef = "Testing-message-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

Response

The response received from a PauseFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults in here.

ResumeFax

When making a resume request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

ResumeFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

ResumeFax Request limiting by BroadcastRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->BroadcastRef = "Broadcast-test-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by SendRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->SendRef = "Send-Ref-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by MessageRef:

$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->MessageRef = "Testing-message-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

Response

The response received from a ResumeFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PreviewFaxDocument

Description

This function provides you with a method to generate a preview of a saved document at different resolutions with various dithering settings. It returns a tiff data in base64 along with a page count.

Normal PreviewFaxDocument Request

// TODO: Put your file path here$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello World!";
$monopondStampMergeField = newMonopondStampMergeField();
$monopondStampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$monopondStampMergeField->TextValue = $stampMergeFieldTextValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-document-ref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($monopondStampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($stampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with DocMergeData

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "field1";
$mergeField->Value = "Raspberry Pi";
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "field2";
$mergeField2->Value = "Human";
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-documentref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->DocMergeData = array($mergeField, $mergeField2);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

Request

FaxDocumentPreviewRequest Parameters:

NameRequiredTypeDescriptionDefault
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
DitheringTechniqueFaxDitheringTechniqueApplies a custom dithering method to the fax document before transmission.
DocMergeDataArray of DocMergeData MergeFieldsEach mergefield has a key and a value. The system will look for the keys in a document and replace them with their corresponding value.
StampMergeDataArray of StampMergeData MergeFieldsEach mergefield has a key a corressponding TextValue/ImageValue. The system will look for the keys in a document and replace them with their corresponding value.

DocMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Parameters:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Parameters:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Parameters:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

FaxDocumentPreviewResponse

NameTypeDescription
TiffPreviewStringA preview version of the document encoded in Base64 format.
NumberOfPagesIntTotal number of pages in the document preview.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException, UnsupportedDocumentContentType, MergeFieldDoesNotMatchDocumentTypeException, UnknownHostException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

SaveFaxDocument

Description

This function allows you to upload a document and save it under a document reference (DocumentRef) for later use. (Note: These saved documents only last 30 days on the system.)

Sample Request

$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$saveFaxDocumentRequest = newMonopondSaveFaxDocumentRequest();
$saveFaxDocumentRequest->DocumentRef = "sample-document-ref";
$saveFaxDocumentRequest->FileName = "test.pdf";
$saveFaxDocumentRequest->FileData = $filedata;
$saveFaxDocumentResponse = $client->saveFaxDocument($saveFaxDocumentRequest);
print_r($saveFaxDocumentResponse);

Request

SaveFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefXStringUnique identifier for the document to be uploaded.
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefAlreadyExistsException, DocumentContentTypeNotFoundException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

DeleteFaxDocument

Description

This function removes a saved fax document from the system.

Sample Request

// TODO: Put your file path here$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$deleteFaxDocumentRequest = newMonopondDeleteFaxDocumentRequest();
$deleteFaxDocumentRequest->DocumentRef = "sample-document-ref";
// Call delete FaxDocument method$deleteRespone = $client->deleteFaxDocument($deleteFaxDocumentRequest);
print_r($deleteRespone);

Request

DeleteFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefStringUnique identifier for the document to be deleted.
MessageRefStringUser-defined message reference.
SendRefStringUser-defined send reference.
BroadcastRefStringUser-defined broadcast reference.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

More Information

Exceptions/SOAP Faults

If an error occurs during a request on the Monopond Fax API the service will throw a SOAP fault or exception. Each exception is listed in detail below.

InvalidArgumentsException

One or more of the arguments passed in the request were invalid. Each element that failed validation is included in the fault details along with the reason for failure.

DocumentContentTypeNotFoundException

There was an error while decoding the document provided; we were unable to determine its content type.

DocumentRefAlreadyExistsException

There is already a document on your account with this DocumentRef.

DocumentContentTypeNotFoundException

Content type could not be found for the document.

NoMessagesFoundException

Based on the references sent in the request no messages could be found that match the criteria.

InternalServerException

An unusual error occurred on the platform. If this error occurs please contact support for further instruction.

General Properties and File Formatting

File Encoding

All files are encoded in the Base64 encoding specified in RFC 2045 - MIME (Multipurpose Internet Mail Extensions). The Base64 encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used, enabling 6 bits to be represented per printable character. For more information see http://tools.ietf.org/html/rfc2045 and http://en.wikipedia.org/wiki/Base64

Dates

Dates are always passed in ISO-8601 format with time zone. For example: “2012-07-17T19:27:23+08:00”

MonopondSendFaxRequest Properties

NameRequiredTypeDescriptionDefault
BroadcastRefStringAllows the user to tag all faxes in this request with a user-defined broadcastreference. These faxes can then be retrieved at a later point based on this reference.
SendRefStringSimilar to the BroadcastRef, this allows the user to tag all faxes in this request with a send reference. The SendRef is used to represent all faxes in this request only, so naturally it must be unique.
FaxMessagesXArray of FaxMessageFaxMessages describe each individual fax message and its destination. See below for details.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersFax
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Current time (immediate sending)
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details.WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Each account has a maximum number of busy retries that can be changed by consultation with your account manager.Account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20

MonopondFaxMessage Properties

This represents a single fax message being sent to a destination.

NameRequiredTypeDescriptionDefault
MessageRefXStringA unique user-provided identifier that is used to identify the fax message. This can be used at a later point to retrieve the results of the fax message.
SendToXStringThe phone number the fax message will be sent to.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersEmpty
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Start now
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details. WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Please consult with your account manager in regards to maximum value.account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20
CLIStringAllows a customer called ID. Note: Must be enabled on the account before it can be used.

MonopondDocument Properties

Represents a fax document to be sent through the system. Supported file types are: PDF, TIFF, PNG, JPG, GIF, TXT, PS, RTF, DOC, DOCX, XLS, XLSX, PPT, PPTX.

NameRequiredTypeDescriptionDefault
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.
OrderXIntegerIf multiple documents are defined on a message this value will determine the order in which they will be transmitted.0
DocMergeDataAn Array of MergeFields
StampMergeDataAn Array of MergeFields

Resolution Levels

ValueDescription
normalNormal standard resolution (98 scan lines per inch)
fineFine resolution (196 scan lines per inch)

FaxDitheringTechnique

ValueFax Dithering Technique
noneNo dithering.
normalNormal dithering.
turboTurbo dithering.
darkenDarken dithering.
darken_moreDarken more dithering.
darken_extraDarken extra dithering.
lightenLighten dithering.
lighten_moreLighten more dithering.
crosshatchCrosshatch dithering.
DETAILEDDetailed dithering.

Header Format

Determines the format of the header line that is printed on the top of the transmitted fax message. This is set to **rom %from%, To %to%|%a %b %d %H:%M %Y”**y default which produces the following:

From TSID, To 61022221234 Mon Aug 28 15:32 2012 1 of 1

ValueDescription
%from%The value of the SendFrom field in the message.
%to%The value of the SendTo field in the message.
%aWeekday name (abbreviated)
%AWeekday name
%bMonth name (abbreviated)
%BMonth name
%dDay of the month as a decimal (01 – 31)
%mMonth as a decimal (01 – 12)
%yYear as a decimal (abbreviated)
%YYear as a decimal
%HHour as a decimal using a 24-hour clock (00 – 23)
%IHour as a decimal using a 12-hour clock (01 – 12)
%MMinute as a decimal (00 – 59)
%SSecond as a decimal (00 – 59)
%pAM or PM
%jDay of the year as a decimal (001 – 366)
%UWeek of the year as a decimal (Monday as first day of the week) (00 – 53)
%WDay of the year as a decimal (001 – 366)
%wDay of the week as a decimal (0 – 6) (Sunday being 0)
%%A literal % character

TODO: The default value is set to: “From %from%, To %to%|%a %b %d %H:%M %Y”

Blocklists Parameters

NameRequiredTypeDescription
smartblockfalsebooleanBlocks sending to a number if it has consistently failed in the past.
fpsfalsebooleanWash numbers against the fps blocklist.
dncrfalsebooleanWash numbers against the dncr blocklist.

About

Monopond Fax API PHP Client

Resources

Stars

3 stars

Watchers

17 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

api-client-php

Monopond Fax API PHP Client

#Building a Request To use Monopond SOAP PHP Client, start by including the MonopondSOAPClient.php then creating an instance of the client by supplying your credentials. Your username and password should be enclosed in quotation marks.

<?phpinclude_once'./MonopondSOAPClient.php';
// TODO: Enter your own credentials here$client = newMonopondSOAPClientV2_1("myusername", "mypassword", MPENV::PRODUCTION);
// TODO: Set up your request here?>

SendFax

Description

This is the core function in the API allowing you to send faxes on the platform.

Your specific faxing requirements will dictate which send request type below should be used. The two common use cases would be the sending of a single fax document to one destination and the sending of a single fax document to multiple destinations.

Sending a single fax:

To send a fax to a single destination a request similar to the following example can be used:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents = array($document);
// TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
// Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know the definitions:

Assigning DocumentRef in MonopondDocument

DocumentRef must be unique and a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DocumentRef = "Sample DocumentRef";
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document2->DocumentRef = "Sample DocumentRef2";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here to check the definition of DocumentRef:

Assigning SendRef and BroadcastRef in MonopondSendFaxRequest

To assign SendRef and BroadcastRef in MonopondSendFaxRequest, a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "Testing";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BroadcastRef = "BroadcastRef";
$sendFaxRequest->SendRef = "SendRef";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Visit here to know the definitions of SendRef and BroadcastRef:

Sending a Fax with Retries inside a MonopondFaxMessage

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Retries = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Retries inside a MonopondSendFaxRequest

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Retries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondFaxMessage

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->BusyRetries = 1;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondSendFaxRequest

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BusyRetries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Resolution in MonopondFaxMessage

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Resolution = "normal";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with Resolution in MonopondSendFaxRequest

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Resolution = "fine";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with FaxDitheringTechnique in MonopondDocument:

To set the fax FaxDitheringTechnique, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DitheringTechnique = "turbo";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the different values of FaxDitheringTechnique here:

Assigning a Timezone in MonopondFaxMessage

The Timezone is used to format the datetime display in the fax header.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->TimeZone = "Australia/Adelaide";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning a Timezone in MonopondSendFaxRequest

The Timezone is used to format the datetime display in the fax header. Applying it to the MonopondSendFaxRequest will apply this to all MonopondFaxMessages in the request.

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->TimeZone = "Australia/Adelaide";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning SendFrom in MonopondFaxMessage

To send fax with SendFrom in MonopondFaxMessage a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Sample SendFrom";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning SendFrom in MonopondSendFaxRequest

To send fax with SendFrom in MonopondSendFaxRequest a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->SendFrom = "Test Example";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning a HeaderFormat in MonopondFaxMessage

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning a HeaderFormat in MonopondSendFaxRequest

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning CLI in MonopondFaxMessage

Assigning a CLI in the MonopondFaxMessage, a request similar to the following example below.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->CLI = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of CLI here:

Sending a Fax with DNCR enabled in MonopondFaxMessage

To check if a number is on the Do Not Call Register (Australian) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with FPS enabled in MonopondFaxMessage

To check if a number is on the FPS blacklist (UK) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->fps = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with Smartblock enabled in MonopondFaxMessage

To check if a number is on the Smartblock list before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->smartblock = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Add a Blocklists in MonopondSendFaxRequest

If you want to validate all numbers in DNCR or FPS or Smarblock, a request must be similiar to this example:

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Blocklists = $monopondBlocklists;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with ScheduledStartTime in MonopondFaxMessage

To set a ScheduledStartTime for the MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->ScheduledStartTime = "2017-06-25T12:00:00Z";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with ScheduledStartTime in MonopondSendFaxRequest

To set a ScheduledStartTime for the MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with MustBeSentBeforeDate in MonopondFaxMessage

To set a MustBeSentBeforeDate for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MustBeSentBeforeDate in MonopondSendFaxRequest

To set a MustBeSentBeforeDate for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MaxFaxPages in MonopondFaxMessage

To set a MaxFaxPages for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MaxFaxPages = 1;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MaxFaxPages = 2;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending a Fax with MaxFaxPages in MonopondSendFaxRequest

To set a MaxFaxPages for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MaxFaxPages = 2;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending multiple faxes:

To send faxes to multiple destinations a request similar to the following example can be used. Please note the addition of another FaxMessage:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName2.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document3 = newMonopondDocument();
$document3->FileName = "AnyFileName3.txt";
$document3->FileData = $filedata;
$document3->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents[] = $document;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->Documents[] = $document2;
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
$faxMessage3->Documents[] = $document3;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending faxes to multiple destinations with the same document (broadcasting):

To send the same fax content to multiple destinations (broadcasting) a request similar to the example below can be used.

This method is recommended for broadcasting as it takes advantage of the multiple tiers in the send request. This eliminates the repeated parameters out of the individual fax message elements which are instead inherited from the parent send fax request. An example below shows SendFrom being used for both FaxMessages. While not shown in the example below further control can be achieved over individual fax elements to override the parameters set in the parent.

When sending multiple faxes in batch it is recommended to group them into requests of around 600 fax messages for optimal performance. If you are sending the same document to multiple destinations it is strongly advised to only attach the document once in the root of the send request rather than attaching a document for each destination.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Microsoft Documents With DocMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request is used to send a Microsoft document with replaceable variables or merge fields. The merge field follows the pattern <mf:key>. If your key is field1, it should be typed as <mf:field1> in the document. Note that the key must be unique within the whole document. The screenshots below are examples of what the request does.

Original .doc file:

before

This is what the file looks like after the fields field1,field2 and field3 have been replaced with values lazy dog, fat pig and fat pig:

stamp

Sample Request

The example below shows field1 will be replaced by the value of Test.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "name";
$mergeField->Value = "Raspberry Pi";
$document1 = newMonopondDocument();
$document1->DocumentRef = "send-1-document";
$document1->DocMergeData[] = $mergeField;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "message-1";
$faxMessage->SendTo = "61290120211";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Resolution = "normal";
$faxMessage->Retries = 0;
$faxMessage->BusyRetries = 2;
$faxMessage->CLI = 61290120211;
$faxMessage->Documents = array($document1);
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "name";
$mergeField2->Value = "Raspberry Pi 2";
$document2 = newMonopondDocument();
$document2->DocumentRef = "send-1-document";
$document2->DocMergeData[] = $mergeField2;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "message-2";
$faxMessage2->SendTo = "61290120211";
$faxMessage2->SendFrom = "Test Fax 2";
$faxMessage2->Resolution = "normal";
$faxMessage2->Retries = 0;
$faxMessage2->BusyRetries = 2;
$faxMessage2->CLI = 61011114111;
$faxMessage2->Documents = array($document2);
$baseDocument = newMonopondDocument();
$baseDocument->DocumentRef = "send-1-document2";
$baseDocument->FileName = "file.doc";
$baseDocument->FileData = $filedata;
$baseDocument->Order = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "broadcast-1";
$sendFaxRequest->SendRef = "send-1";
$sendFaxRequest->HeaderFormat = "Testing";
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->FaxMessages[] = $faxMessage2;
$sendFaxRequest->Documents = array($baseDocument);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Tiff and PDF files with StampMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request allows a TIFF file to be stamped with an image or text, based on X-Y coordinates. The x and y coordinates (0,0) starts at the top left part of the document. The screenshots below are examples of what the request does.

Original tiff file:

before

Sample stamp image:

stamp

This is what the tiff file looks like after stamping it with the image above:

after

The same tiff file, but this time, with a text stamp:

after

Sample Request

The example below shows a TIFF that will be stamped with the text “Hello” at xCoord=“1287” and yCoord=“421”, and an image at xCoord=“283” and yCoord=“120”

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "1287";
$stampMergeFieldKey->yCoord = "421";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->TextValue = $stampMergeFieldTextValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

Request with Image Stamping

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "283";
$stampMergeFieldKey->yCoord = "120";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

DocMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Properties:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Properties:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Properties:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

Response

The response received from a SendFaxRequest matches the response you receive when calling the FaxStatus method call with a send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, DocumentContentTypeNotFoundException, or InternalServerException. You can find more details on these faults here.

FaxStatus

Description

This function provides you with a method of retrieving the status, details and results of fax messages sent. While this is a legitimate method of retrieving results we strongly advise that you take advantage of our callback service, which will push these fax results to you as they are completed.

When making a status request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow the request query.

  • Limiting by a BroadcastRef allows you to retrieve faxes contained in a group of send requests.
  • Limiting by SendRef allows you to retrieve faxes contained in a single send request.
  • Limiting by MessageRef allows you to retrieve a single fax message.

There are multiple levels of verbosity available in the request; these are explained in detail below.

FaxStatusRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.
VerbosityStringVerbosity String The level of detail in the status response. Please see below for a list of possible values.

Verbosity Levels:

ValueDescription
briefGives you an overall view of the messages. This simply shows very high-level statistics, consisting of counts of how many faxes are at each status (i.e. processing, queued,sending) and totals of the results of these faxes (success, failed, blocked).
sendsend Includes the results from “brief” while also including an itemised list of each fax message in the request.
detailsdetails Includes the results from “send” along with details of the properties used to send the fax messages.
resultsIncludes the results from “send” along with the sending results of the fax messages.
allall Includes the results from both “details” and “results” along with some extra uncommon fields.

Sending a faxStatus Request with “brief” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "brief";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “send” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "send";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “details” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "details";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “results” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "results";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Response

The response received depends entirely on the verbosity level specified.

FaxStatusResponse:

NameTypeVerbosityDescription
FaxStatusTotalsFaxStatusTotalsbriefCounts of how many faxes are at each status. See below for more details.
FaxResultsTotalsFaxResultsTotalsbriefFaxResultsTotals FaxResultsTotals brief Totals of the end results of the faxes. See below for more details.
FaxMessagesArray of FaxMessagesendsend List of each fax in the query. See below for more details.

FaxStatusTotals:

Contains the total count of how many faxes are at each status. To see more information on each fax status, view the FaxStatus table below.

NameTypeVerbosityDescription
pendingLongbriefFax is pending on the system and waiting to be processed.
processingLongbriefFax is in the initial processing stages.
queuedLongbriefFax has finished processing and is queued, ready to send out at the send time.
startingLongbriefFax is ready to be sent out.
sendingLongbriefFax has been spooled to our servers and is in the process of being sent out.
finalizingLongbriefFax has finished sending and the results are being processed.
doneLongbriefFax has completed and no further actions will take place. The detailed results are available at this status.

FaxResultsTotals:

Contains the total count of how many faxes ended in each result, as well as some additional totals. To view more information on each fax result, view the FaxResults table below.

NameTypeVerbosityDescription
successLongbriefFax has successfully been delivered to its destination.
blockedLongbriefDestination number was found in one of the block lists.
failedLongbriefFax failed getting to its destination.
totalAttemptsLongbriefTotal attempts made in the reference context.
totalFaxDurationLongbrieftotalFaxDuration Long brief Total time spent on the line in the reference context.
totalPagesLongbriefTotal pages sent in the reference context.

apiFaxMessageStatus:

NameTypeVerbosityDescription
messageRefStringsend
sendRefStringsend
broadcastRefStringsend
sendToStringsend
statussendThe current status of the fax message. See the FaxStatus table above for possible status values.
FaxDetailsFaxDetailsdetailsContains the details and settings the fax was sent with. See below for more details.
FaxResultsArray of FaxResultresultsContains the results of each attempt at sending the fax message and their connection details. See below for more details.

FaxDetails:

NameTypeVerbosity
sendFromAlphanumeric Stringdetails
resolutionStringdetails
retriesIntegerdetails
busyRetriesIntegerdetails
headerFormatStringdetails

FaxResults:

NameTypeVerbosityDescription
attemptIntegerresultsThe attempt number of the FaxResult.
resultStringresultsThe result of the fax message. See the FaxResults table above for all possible results values.
ErrorFaxErrorresultsThe fax error code if the fax was not successful. See below for all possible values.
costBigDecimalresultsThe final cost of the fax message.
pagesIntegerresultsTotal pages sent to the end fax machine.
scheduledStartTimeDateTimeresultsThe date and time the fax is scheduled to start.
dateCallStartedDateTimeresultsDate and time the fax started transmitting.
dateCallEndedDateTimeresultsDate and time the fax finished transmitting.

FaxError:

ValueError Name
DOCUMENT_EXCEEDS_PAGE_LIMITDocument exceeds page limit
DOCUMENT_UNSUPPORTEDUnsupported document type
DOCUMENT_FAILED_CONVERSIONDocument failed conversion
FUNDS_INSUFFICIENTInsufficient funds
FUNDS_FAILEDFailed to transfer funds
BLOCK_ACCOUNTNumber cannot be sent from this account
BLOCK_GLOBALNumber found in the Global blocklist
BLOCK_SMARTNumber found in the Smart blocklist
BLOCK_DNCRNumber found in the DNCR blocklist
BLOCK_CUSTOMNumber found in a user specified blocklist
FAX_NEGOTIATION_FAILEDNegotiation failed
FAX_EARLY_HANGUPEarly hang-up on call
FAX_INCOMPATIBLE_MACHINEIncompatible fax machine
FAX_BUSYPhone number busy
FAX_NUMBER_UNOBTAINABLENumber unobtainable
FAX_SENDING_FAILEDSending fax failed
FAX_CANCELLEDCancelled
FAX_NO_ANSWERNo answer
FAX_UNKNOWNUnknown fax error

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

StopFax

Description

Stops a fax message from sending. This fax message must either be paused, queued, starting or sending. Please note the fax cannot be stopped if the fax is currently in the process of being transmitted to the destination device.

When making a stop request you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

StopFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

StopFax Request limiting by BroadcastRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->BroadcastRef = "Broadcast-test-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by SendRef:

$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->SendRef = "Send-Ref-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by MessageRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->MessageRef = "Testing-message-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

Response

The response received from a StopFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PauseFax

Description

Pauses a fax message before it starts transmitting. This fax message must either be queued, starting or sending. Please note the fax cannot be paused if the message is currently being transmitted to the destination device.

When making a pause request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

PauseFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

PauseFax Request limiting by BroadcastRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->BroadcastRef = "Broadcast-test-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by SendRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->SendRef = "Send-Ref-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by MessageRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->MessageRef = "Testing-message-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

Response

The response received from a PauseFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults in here.

ResumeFax

When making a resume request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

ResumeFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

ResumeFax Request limiting by BroadcastRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->BroadcastRef = "Broadcast-test-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by SendRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->SendRef = "Send-Ref-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by MessageRef:

$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->MessageRef = "Testing-message-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

Response

The response received from a ResumeFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PreviewFaxDocument

Description

This function provides you with a method to generate a preview of a saved document at different resolutions with various dithering settings. It returns a tiff data in base64 along with a page count.

Normal PreviewFaxDocument Request

// TODO: Put your file path here$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello World!";
$monopondStampMergeField = newMonopondStampMergeField();
$monopondStampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$monopondStampMergeField->TextValue = $stampMergeFieldTextValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-document-ref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($monopondStampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($stampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with DocMergeData

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "field1";
$mergeField->Value = "Raspberry Pi";
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "field2";
$mergeField2->Value = "Human";
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-documentref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->DocMergeData = array($mergeField, $mergeField2);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

Request

FaxDocumentPreviewRequest Parameters:

NameRequiredTypeDescriptionDefault
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
DitheringTechniqueFaxDitheringTechniqueApplies a custom dithering method to the fax document before transmission.
DocMergeDataArray of DocMergeData MergeFieldsEach mergefield has a key and a value. The system will look for the keys in a document and replace them with their corresponding value.
StampMergeDataArray of StampMergeData MergeFieldsEach mergefield has a key a corressponding TextValue/ImageValue. The system will look for the keys in a document and replace them with their corresponding value.

DocMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Parameters:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Parameters:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Parameters:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

FaxDocumentPreviewResponse

NameTypeDescription
TiffPreviewStringA preview version of the document encoded in Base64 format.
NumberOfPagesIntTotal number of pages in the document preview.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException, UnsupportedDocumentContentType, MergeFieldDoesNotMatchDocumentTypeException, UnknownHostException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

SaveFaxDocument

Description

This function allows you to upload a document and save it under a document reference (DocumentRef) for later use. (Note: These saved documents only last 30 days on the system.)

Sample Request

$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$saveFaxDocumentRequest = newMonopondSaveFaxDocumentRequest();
$saveFaxDocumentRequest->DocumentRef = "sample-document-ref";
$saveFaxDocumentRequest->FileName = "test.pdf";
$saveFaxDocumentRequest->FileData = $filedata;
$saveFaxDocumentResponse = $client->saveFaxDocument($saveFaxDocumentRequest);
print_r($saveFaxDocumentResponse);

Request

SaveFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefXStringUnique identifier for the document to be uploaded.
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefAlreadyExistsException, DocumentContentTypeNotFoundException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

DeleteFaxDocument

Description

This function removes a saved fax document from the system.

Sample Request

// TODO: Put your file path here$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$deleteFaxDocumentRequest = newMonopondDeleteFaxDocumentRequest();
$deleteFaxDocumentRequest->DocumentRef = "sample-document-ref";
// Call delete FaxDocument method$deleteRespone = $client->deleteFaxDocument($deleteFaxDocumentRequest);
print_r($deleteRespone);

Request

DeleteFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefStringUnique identifier for the document to be deleted.
MessageRefStringUser-defined message reference.
SendRefStringUser-defined send reference.
BroadcastRefStringUser-defined broadcast reference.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

More Information

Exceptions/SOAP Faults

If an error occurs during a request on the Monopond Fax API the service will throw a SOAP fault or exception. Each exception is listed in detail below.

InvalidArgumentsException

One or more of the arguments passed in the request were invalid. Each element that failed validation is included in the fault details along with the reason for failure.

DocumentContentTypeNotFoundException

There was an error while decoding the document provided; we were unable to determine its content type.

DocumentRefAlreadyExistsException

There is already a document on your account with this DocumentRef.

DocumentContentTypeNotFoundException

Content type could not be found for the document.

NoMessagesFoundException

Based on the references sent in the request no messages could be found that match the criteria.

InternalServerException

An unusual error occurred on the platform. If this error occurs please contact support for further instruction.

General Properties and File Formatting

File Encoding

All files are encoded in the Base64 encoding specified in RFC 2045 - MIME (Multipurpose Internet Mail Extensions). The Base64 encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used, enabling 6 bits to be represented per printable character. For more information see http://tools.ietf.org/html/rfc2045 and http://en.wikipedia.org/wiki/Base64

Dates

Dates are always passed in ISO-8601 format with time zone. For example: “2012-07-17T19:27:23+08:00”

MonopondSendFaxRequest Properties

NameRequiredTypeDescriptionDefault
BroadcastRefStringAllows the user to tag all faxes in this request with a user-defined broadcastreference. These faxes can then be retrieved at a later point based on this reference.
SendRefStringSimilar to the BroadcastRef, this allows the user to tag all faxes in this request with a send reference. The SendRef is used to represent all faxes in this request only, so naturally it must be unique.
FaxMessagesXArray of FaxMessageFaxMessages describe each individual fax message and its destination. See below for details.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersFax
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Current time (immediate sending)
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details.WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Each account has a maximum number of busy retries that can be changed by consultation with your account manager.Account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20

MonopondFaxMessage Properties

This represents a single fax message being sent to a destination.

NameRequiredTypeDescriptionDefault
MessageRefXStringA unique user-provided identifier that is used to identify the fax message. This can be used at a later point to retrieve the results of the fax message.
SendToXStringThe phone number the fax message will be sent to.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersEmpty
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Start now
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details. WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Please consult with your account manager in regards to maximum value.account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20
CLIStringAllows a customer called ID. Note: Must be enabled on the account before it can be used.

MonopondDocument Properties

Represents a fax document to be sent through the system. Supported file types are: PDF, TIFF, PNG, JPG, GIF, TXT, PS, RTF, DOC, DOCX, XLS, XLSX, PPT, PPTX.

NameRequiredTypeDescriptionDefault
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.
OrderXIntegerIf multiple documents are defined on a message this value will determine the order in which they will be transmitted.0
DocMergeDataAn Array of MergeFields
StampMergeDataAn Array of MergeFields

Resolution Levels

ValueDescription
normalNormal standard resolution (98 scan lines per inch)
fineFine resolution (196 scan lines per inch)

FaxDitheringTechnique

ValueFax Dithering Technique
noneNo dithering.
normalNormal dithering.
turboTurbo dithering.
darkenDarken dithering.
darken_moreDarken more dithering.
darken_extraDarken extra dithering.
lightenLighten dithering.
lighten_moreLighten more dithering.
crosshatchCrosshatch dithering.
DETAILEDDetailed dithering.

Header Format

Determines the format of the header line that is printed on the top of the transmitted fax message. This is set to **rom %from%, To %to%|%a %b %d %H:%M %Y”**y default which produces the following:

From TSID, To 61022221234 Mon Aug 28 15:32 2012 1 of 1

ValueDescription
%from%The value of the SendFrom field in the message.
%to%The value of the SendTo field in the message.
%aWeekday name (abbreviated)
%AWeekday name
%bMonth name (abbreviated)
%BMonth name
%dDay of the month as a decimal (01 – 31)
%mMonth as a decimal (01 – 12)
%yYear as a decimal (abbreviated)
%YYear as a decimal
%HHour as a decimal using a 24-hour clock (00 – 23)
%IHour as a decimal using a 12-hour clock (01 – 12)
%MMinute as a decimal (00 – 59)
%SSecond as a decimal (00 – 59)
%pAM or PM
%jDay of the year as a decimal (001 – 366)
%UWeek of the year as a decimal (Monday as first day of the week) (00 – 53)
%WDay of the year as a decimal (001 – 366)
%wDay of the week as a decimal (0 – 6) (Sunday being 0)
%%A literal % character

TODO: The default value is set to: “From %from%, To %to%|%a %b %d %H:%M %Y”

Blocklists Parameters

NameRequiredTypeDescription
smartblockfalsebooleanBlocks sending to a number if it has consistently failed in the past.
fpsfalsebooleanWash numbers against the fps blocklist.
dncrfalsebooleanWash numbers against the dncr blocklist.

About

Monopond Fax API PHP Client

Resources

Stars

3 stars

Watchers

17 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

api-client-php

Monopond Fax API PHP Client

#Building a Request To use Monopond SOAP PHP Client, start by including the MonopondSOAPClient.php then creating an instance of the client by supplying your credentials. Your username and password should be enclosed in quotation marks.

<?phpinclude_once'./MonopondSOAPClient.php';
// TODO: Enter your own credentials here$client = newMonopondSOAPClientV2_1("myusername", "mypassword", MPENV::PRODUCTION);
// TODO: Set up your request here?>

SendFax

Description

This is the core function in the API allowing you to send faxes on the platform.

Your specific faxing requirements will dictate which send request type below should be used. The two common use cases would be the sending of a single fax document to one destination and the sending of a single fax document to multiple destinations.

Sending a single fax:

To send a fax to a single destination a request similar to the following example can be used:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents = array($document);
// TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
// Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know the definitions:

Assigning DocumentRef in MonopondDocument

DocumentRef must be unique and a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DocumentRef = "Sample DocumentRef";
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document2->DocumentRef = "Sample DocumentRef2";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here to check the definition of DocumentRef:

Assigning SendRef and BroadcastRef in MonopondSendFaxRequest

To assign SendRef and BroadcastRef in MonopondSendFaxRequest, a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "Testing";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BroadcastRef = "BroadcastRef";
$sendFaxRequest->SendRef = "SendRef";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Visit here to know the definitions of SendRef and BroadcastRef:

Sending a Fax with Retries inside a MonopondFaxMessage

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Retries = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Retries inside a MonopondSendFaxRequest

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Retries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondFaxMessage

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->BusyRetries = 1;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondSendFaxRequest

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BusyRetries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Resolution in MonopondFaxMessage

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Resolution = "normal";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with Resolution in MonopondSendFaxRequest

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Resolution = "fine";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with FaxDitheringTechnique in MonopondDocument:

To set the fax FaxDitheringTechnique, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DitheringTechnique = "turbo";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the different values of FaxDitheringTechnique here:

Assigning a Timezone in MonopondFaxMessage

The Timezone is used to format the datetime display in the fax header.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->TimeZone = "Australia/Adelaide";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning a Timezone in MonopondSendFaxRequest

The Timezone is used to format the datetime display in the fax header. Applying it to the MonopondSendFaxRequest will apply this to all MonopondFaxMessages in the request.

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->TimeZone = "Australia/Adelaide";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning SendFrom in MonopondFaxMessage

To send fax with SendFrom in MonopondFaxMessage a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Sample SendFrom";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning SendFrom in MonopondSendFaxRequest

To send fax with SendFrom in MonopondSendFaxRequest a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->SendFrom = "Test Example";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning a HeaderFormat in MonopondFaxMessage

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning a HeaderFormat in MonopondSendFaxRequest

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning CLI in MonopondFaxMessage

Assigning a CLI in the MonopondFaxMessage, a request similar to the following example below.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->CLI = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of CLI here:

Sending a Fax with DNCR enabled in MonopondFaxMessage

To check if a number is on the Do Not Call Register (Australian) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with FPS enabled in MonopondFaxMessage

To check if a number is on the FPS blacklist (UK) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->fps = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with Smartblock enabled in MonopondFaxMessage

To check if a number is on the Smartblock list before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->smartblock = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Add a Blocklists in MonopondSendFaxRequest

If you want to validate all numbers in DNCR or FPS or Smarblock, a request must be similiar to this example:

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Blocklists = $monopondBlocklists;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with ScheduledStartTime in MonopondFaxMessage

To set a ScheduledStartTime for the MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->ScheduledStartTime = "2017-06-25T12:00:00Z";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with ScheduledStartTime in MonopondSendFaxRequest

To set a ScheduledStartTime for the MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with MustBeSentBeforeDate in MonopondFaxMessage

To set a MustBeSentBeforeDate for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MustBeSentBeforeDate in MonopondSendFaxRequest

To set a MustBeSentBeforeDate for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MaxFaxPages in MonopondFaxMessage

To set a MaxFaxPages for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MaxFaxPages = 1;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MaxFaxPages = 2;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending a Fax with MaxFaxPages in MonopondSendFaxRequest

To set a MaxFaxPages for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MaxFaxPages = 2;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending multiple faxes:

To send faxes to multiple destinations a request similar to the following example can be used. Please note the addition of another FaxMessage:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName2.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document3 = newMonopondDocument();
$document3->FileName = "AnyFileName3.txt";
$document3->FileData = $filedata;
$document3->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents[] = $document;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->Documents[] = $document2;
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
$faxMessage3->Documents[] = $document3;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending faxes to multiple destinations with the same document (broadcasting):

To send the same fax content to multiple destinations (broadcasting) a request similar to the example below can be used.

This method is recommended for broadcasting as it takes advantage of the multiple tiers in the send request. This eliminates the repeated parameters out of the individual fax message elements which are instead inherited from the parent send fax request. An example below shows SendFrom being used for both FaxMessages. While not shown in the example below further control can be achieved over individual fax elements to override the parameters set in the parent.

When sending multiple faxes in batch it is recommended to group them into requests of around 600 fax messages for optimal performance. If you are sending the same document to multiple destinations it is strongly advised to only attach the document once in the root of the send request rather than attaching a document for each destination.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Microsoft Documents With DocMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request is used to send a Microsoft document with replaceable variables or merge fields. The merge field follows the pattern <mf:key>. If your key is field1, it should be typed as <mf:field1> in the document. Note that the key must be unique within the whole document. The screenshots below are examples of what the request does.

Original .doc file:

before

This is what the file looks like after the fields field1,field2 and field3 have been replaced with values lazy dog, fat pig and fat pig:

stamp

Sample Request

The example below shows field1 will be replaced by the value of Test.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "name";
$mergeField->Value = "Raspberry Pi";
$document1 = newMonopondDocument();
$document1->DocumentRef = "send-1-document";
$document1->DocMergeData[] = $mergeField;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "message-1";
$faxMessage->SendTo = "61290120211";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Resolution = "normal";
$faxMessage->Retries = 0;
$faxMessage->BusyRetries = 2;
$faxMessage->CLI = 61290120211;
$faxMessage->Documents = array($document1);
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "name";
$mergeField2->Value = "Raspberry Pi 2";
$document2 = newMonopondDocument();
$document2->DocumentRef = "send-1-document";
$document2->DocMergeData[] = $mergeField2;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "message-2";
$faxMessage2->SendTo = "61290120211";
$faxMessage2->SendFrom = "Test Fax 2";
$faxMessage2->Resolution = "normal";
$faxMessage2->Retries = 0;
$faxMessage2->BusyRetries = 2;
$faxMessage2->CLI = 61011114111;
$faxMessage2->Documents = array($document2);
$baseDocument = newMonopondDocument();
$baseDocument->DocumentRef = "send-1-document2";
$baseDocument->FileName = "file.doc";
$baseDocument->FileData = $filedata;
$baseDocument->Order = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "broadcast-1";
$sendFaxRequest->SendRef = "send-1";
$sendFaxRequest->HeaderFormat = "Testing";
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->FaxMessages[] = $faxMessage2;
$sendFaxRequest->Documents = array($baseDocument);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Tiff and PDF files with StampMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request allows a TIFF file to be stamped with an image or text, based on X-Y coordinates. The x and y coordinates (0,0) starts at the top left part of the document. The screenshots below are examples of what the request does.

Original tiff file:

before

Sample stamp image:

stamp

This is what the tiff file looks like after stamping it with the image above:

after

The same tiff file, but this time, with a text stamp:

after

Sample Request

The example below shows a TIFF that will be stamped with the text “Hello” at xCoord=“1287” and yCoord=“421”, and an image at xCoord=“283” and yCoord=“120”

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "1287";
$stampMergeFieldKey->yCoord = "421";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->TextValue = $stampMergeFieldTextValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

Request with Image Stamping

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "283";
$stampMergeFieldKey->yCoord = "120";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

DocMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Properties:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Properties:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Properties:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

Response

The response received from a SendFaxRequest matches the response you receive when calling the FaxStatus method call with a send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, DocumentContentTypeNotFoundException, or InternalServerException. You can find more details on these faults here.

FaxStatus

Description

This function provides you with a method of retrieving the status, details and results of fax messages sent. While this is a legitimate method of retrieving results we strongly advise that you take advantage of our callback service, which will push these fax results to you as they are completed.

When making a status request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow the request query.

  • Limiting by a BroadcastRef allows you to retrieve faxes contained in a group of send requests.
  • Limiting by SendRef allows you to retrieve faxes contained in a single send request.
  • Limiting by MessageRef allows you to retrieve a single fax message.

There are multiple levels of verbosity available in the request; these are explained in detail below.

FaxStatusRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.
VerbosityStringVerbosity String The level of detail in the status response. Please see below for a list of possible values.

Verbosity Levels:

ValueDescription
briefGives you an overall view of the messages. This simply shows very high-level statistics, consisting of counts of how many faxes are at each status (i.e. processing, queued,sending) and totals of the results of these faxes (success, failed, blocked).
sendsend Includes the results from “brief” while also including an itemised list of each fax message in the request.
detailsdetails Includes the results from “send” along with details of the properties used to send the fax messages.
resultsIncludes the results from “send” along with the sending results of the fax messages.
allall Includes the results from both “details” and “results” along with some extra uncommon fields.

Sending a faxStatus Request with “brief” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "brief";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “send” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "send";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “details” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "details";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “results” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "results";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Response

The response received depends entirely on the verbosity level specified.

FaxStatusResponse:

NameTypeVerbosityDescription
FaxStatusTotalsFaxStatusTotalsbriefCounts of how many faxes are at each status. See below for more details.
FaxResultsTotalsFaxResultsTotalsbriefFaxResultsTotals FaxResultsTotals brief Totals of the end results of the faxes. See below for more details.
FaxMessagesArray of FaxMessagesendsend List of each fax in the query. See below for more details.

FaxStatusTotals:

Contains the total count of how many faxes are at each status. To see more information on each fax status, view the FaxStatus table below.

NameTypeVerbosityDescription
pendingLongbriefFax is pending on the system and waiting to be processed.
processingLongbriefFax is in the initial processing stages.
queuedLongbriefFax has finished processing and is queued, ready to send out at the send time.
startingLongbriefFax is ready to be sent out.
sendingLongbriefFax has been spooled to our servers and is in the process of being sent out.
finalizingLongbriefFax has finished sending and the results are being processed.
doneLongbriefFax has completed and no further actions will take place. The detailed results are available at this status.

FaxResultsTotals:

Contains the total count of how many faxes ended in each result, as well as some additional totals. To view more information on each fax result, view the FaxResults table below.

NameTypeVerbosityDescription
successLongbriefFax has successfully been delivered to its destination.
blockedLongbriefDestination number was found in one of the block lists.
failedLongbriefFax failed getting to its destination.
totalAttemptsLongbriefTotal attempts made in the reference context.
totalFaxDurationLongbrieftotalFaxDuration Long brief Total time spent on the line in the reference context.
totalPagesLongbriefTotal pages sent in the reference context.

apiFaxMessageStatus:

NameTypeVerbosityDescription
messageRefStringsend
sendRefStringsend
broadcastRefStringsend
sendToStringsend
statussendThe current status of the fax message. See the FaxStatus table above for possible status values.
FaxDetailsFaxDetailsdetailsContains the details and settings the fax was sent with. See below for more details.
FaxResultsArray of FaxResultresultsContains the results of each attempt at sending the fax message and their connection details. See below for more details.

FaxDetails:

NameTypeVerbosity
sendFromAlphanumeric Stringdetails
resolutionStringdetails
retriesIntegerdetails
busyRetriesIntegerdetails
headerFormatStringdetails

FaxResults:

NameTypeVerbosityDescription
attemptIntegerresultsThe attempt number of the FaxResult.
resultStringresultsThe result of the fax message. See the FaxResults table above for all possible results values.
ErrorFaxErrorresultsThe fax error code if the fax was not successful. See below for all possible values.
costBigDecimalresultsThe final cost of the fax message.
pagesIntegerresultsTotal pages sent to the end fax machine.
scheduledStartTimeDateTimeresultsThe date and time the fax is scheduled to start.
dateCallStartedDateTimeresultsDate and time the fax started transmitting.
dateCallEndedDateTimeresultsDate and time the fax finished transmitting.

FaxError:

ValueError Name
DOCUMENT_EXCEEDS_PAGE_LIMITDocument exceeds page limit
DOCUMENT_UNSUPPORTEDUnsupported document type
DOCUMENT_FAILED_CONVERSIONDocument failed conversion
FUNDS_INSUFFICIENTInsufficient funds
FUNDS_FAILEDFailed to transfer funds
BLOCK_ACCOUNTNumber cannot be sent from this account
BLOCK_GLOBALNumber found in the Global blocklist
BLOCK_SMARTNumber found in the Smart blocklist
BLOCK_DNCRNumber found in the DNCR blocklist
BLOCK_CUSTOMNumber found in a user specified blocklist
FAX_NEGOTIATION_FAILEDNegotiation failed
FAX_EARLY_HANGUPEarly hang-up on call
FAX_INCOMPATIBLE_MACHINEIncompatible fax machine
FAX_BUSYPhone number busy
FAX_NUMBER_UNOBTAINABLENumber unobtainable
FAX_SENDING_FAILEDSending fax failed
FAX_CANCELLEDCancelled
FAX_NO_ANSWERNo answer
FAX_UNKNOWNUnknown fax error

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

StopFax

Description

Stops a fax message from sending. This fax message must either be paused, queued, starting or sending. Please note the fax cannot be stopped if the fax is currently in the process of being transmitted to the destination device.

When making a stop request you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

StopFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

StopFax Request limiting by BroadcastRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->BroadcastRef = "Broadcast-test-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by SendRef:

$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->SendRef = "Send-Ref-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by MessageRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->MessageRef = "Testing-message-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

Response

The response received from a StopFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PauseFax

Description

Pauses a fax message before it starts transmitting. This fax message must either be queued, starting or sending. Please note the fax cannot be paused if the message is currently being transmitted to the destination device.

When making a pause request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

PauseFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

PauseFax Request limiting by BroadcastRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->BroadcastRef = "Broadcast-test-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by SendRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->SendRef = "Send-Ref-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by MessageRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->MessageRef = "Testing-message-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

Response

The response received from a PauseFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults in here.

ResumeFax

When making a resume request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

ResumeFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

ResumeFax Request limiting by BroadcastRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->BroadcastRef = "Broadcast-test-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by SendRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->SendRef = "Send-Ref-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by MessageRef:

$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->MessageRef = "Testing-message-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

Response

The response received from a ResumeFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PreviewFaxDocument

Description

This function provides you with a method to generate a preview of a saved document at different resolutions with various dithering settings. It returns a tiff data in base64 along with a page count.

Normal PreviewFaxDocument Request

// TODO: Put your file path here$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello World!";
$monopondStampMergeField = newMonopondStampMergeField();
$monopondStampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$monopondStampMergeField->TextValue = $stampMergeFieldTextValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-document-ref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($monopondStampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($stampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with DocMergeData

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "field1";
$mergeField->Value = "Raspberry Pi";
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "field2";
$mergeField2->Value = "Human";
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-documentref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->DocMergeData = array($mergeField, $mergeField2);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

Request

FaxDocumentPreviewRequest Parameters:

NameRequiredTypeDescriptionDefault
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
DitheringTechniqueFaxDitheringTechniqueApplies a custom dithering method to the fax document before transmission.
DocMergeDataArray of DocMergeData MergeFieldsEach mergefield has a key and a value. The system will look for the keys in a document and replace them with their corresponding value.
StampMergeDataArray of StampMergeData MergeFieldsEach mergefield has a key a corressponding TextValue/ImageValue. The system will look for the keys in a document and replace them with their corresponding value.

DocMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Parameters:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Parameters:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Parameters:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

FaxDocumentPreviewResponse

NameTypeDescription
TiffPreviewStringA preview version of the document encoded in Base64 format.
NumberOfPagesIntTotal number of pages in the document preview.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException, UnsupportedDocumentContentType, MergeFieldDoesNotMatchDocumentTypeException, UnknownHostException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

SaveFaxDocument

Description

This function allows you to upload a document and save it under a document reference (DocumentRef) for later use. (Note: These saved documents only last 30 days on the system.)

Sample Request

$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$saveFaxDocumentRequest = newMonopondSaveFaxDocumentRequest();
$saveFaxDocumentRequest->DocumentRef = "sample-document-ref";
$saveFaxDocumentRequest->FileName = "test.pdf";
$saveFaxDocumentRequest->FileData = $filedata;
$saveFaxDocumentResponse = $client->saveFaxDocument($saveFaxDocumentRequest);
print_r($saveFaxDocumentResponse);

Request

SaveFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefXStringUnique identifier for the document to be uploaded.
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefAlreadyExistsException, DocumentContentTypeNotFoundException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

DeleteFaxDocument

Description

This function removes a saved fax document from the system.

Sample Request

// TODO: Put your file path here$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$deleteFaxDocumentRequest = newMonopondDeleteFaxDocumentRequest();
$deleteFaxDocumentRequest->DocumentRef = "sample-document-ref";
// Call delete FaxDocument method$deleteRespone = $client->deleteFaxDocument($deleteFaxDocumentRequest);
print_r($deleteRespone);

Request

DeleteFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefStringUnique identifier for the document to be deleted.
MessageRefStringUser-defined message reference.
SendRefStringUser-defined send reference.
BroadcastRefStringUser-defined broadcast reference.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

More Information

Exceptions/SOAP Faults

If an error occurs during a request on the Monopond Fax API the service will throw a SOAP fault or exception. Each exception is listed in detail below.

InvalidArgumentsException

One or more of the arguments passed in the request were invalid. Each element that failed validation is included in the fault details along with the reason for failure.

DocumentContentTypeNotFoundException

There was an error while decoding the document provided; we were unable to determine its content type.

DocumentRefAlreadyExistsException

There is already a document on your account with this DocumentRef.

DocumentContentTypeNotFoundException

Content type could not be found for the document.

NoMessagesFoundException

Based on the references sent in the request no messages could be found that match the criteria.

InternalServerException

An unusual error occurred on the platform. If this error occurs please contact support for further instruction.

General Properties and File Formatting

File Encoding

All files are encoded in the Base64 encoding specified in RFC 2045 - MIME (Multipurpose Internet Mail Extensions). The Base64 encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used, enabling 6 bits to be represented per printable character. For more information see http://tools.ietf.org/html/rfc2045 and http://en.wikipedia.org/wiki/Base64

Dates

Dates are always passed in ISO-8601 format with time zone. For example: “2012-07-17T19:27:23+08:00”

MonopondSendFaxRequest Properties

NameRequiredTypeDescriptionDefault
BroadcastRefStringAllows the user to tag all faxes in this request with a user-defined broadcastreference. These faxes can then be retrieved at a later point based on this reference.
SendRefStringSimilar to the BroadcastRef, this allows the user to tag all faxes in this request with a send reference. The SendRef is used to represent all faxes in this request only, so naturally it must be unique.
FaxMessagesXArray of FaxMessageFaxMessages describe each individual fax message and its destination. See below for details.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersFax
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Current time (immediate sending)
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details.WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Each account has a maximum number of busy retries that can be changed by consultation with your account manager.Account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20

MonopondFaxMessage Properties

This represents a single fax message being sent to a destination.

NameRequiredTypeDescriptionDefault
MessageRefXStringA unique user-provided identifier that is used to identify the fax message. This can be used at a later point to retrieve the results of the fax message.
SendToXStringThe phone number the fax message will be sent to.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersEmpty
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Start now
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details. WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Please consult with your account manager in regards to maximum value.account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20
CLIStringAllows a customer called ID. Note: Must be enabled on the account before it can be used.

MonopondDocument Properties

Represents a fax document to be sent through the system. Supported file types are: PDF, TIFF, PNG, JPG, GIF, TXT, PS, RTF, DOC, DOCX, XLS, XLSX, PPT, PPTX.

NameRequiredTypeDescriptionDefault
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.
OrderXIntegerIf multiple documents are defined on a message this value will determine the order in which they will be transmitted.0
DocMergeDataAn Array of MergeFields
StampMergeDataAn Array of MergeFields

Resolution Levels

ValueDescription
normalNormal standard resolution (98 scan lines per inch)
fineFine resolution (196 scan lines per inch)

FaxDitheringTechnique

ValueFax Dithering Technique
noneNo dithering.
normalNormal dithering.
turboTurbo dithering.
darkenDarken dithering.
darken_moreDarken more dithering.
darken_extraDarken extra dithering.
lightenLighten dithering.
lighten_moreLighten more dithering.
crosshatchCrosshatch dithering.
DETAILEDDetailed dithering.

Header Format

Determines the format of the header line that is printed on the top of the transmitted fax message. This is set to **rom %from%, To %to%|%a %b %d %H:%M %Y”**y default which produces the following:

From TSID, To 61022221234 Mon Aug 28 15:32 2012 1 of 1

ValueDescription
%from%The value of the SendFrom field in the message.
%to%The value of the SendTo field in the message.
%aWeekday name (abbreviated)
%AWeekday name
%bMonth name (abbreviated)
%BMonth name
%dDay of the month as a decimal (01 – 31)
%mMonth as a decimal (01 – 12)
%yYear as a decimal (abbreviated)
%YYear as a decimal
%HHour as a decimal using a 24-hour clock (00 – 23)
%IHour as a decimal using a 12-hour clock (01 – 12)
%MMinute as a decimal (00 – 59)
%SSecond as a decimal (00 – 59)
%pAM or PM
%jDay of the year as a decimal (001 – 366)
%UWeek of the year as a decimal (Monday as first day of the week) (00 – 53)
%WDay of the year as a decimal (001 – 366)
%wDay of the week as a decimal (0 – 6) (Sunday being 0)
%%A literal % character

TODO: The default value is set to: “From %from%, To %to%|%a %b %d %H:%M %Y”

Blocklists Parameters

NameRequiredTypeDescription
smartblockfalsebooleanBlocks sending to a number if it has consistently failed in the past.
fpsfalsebooleanWash numbers against the fps blocklist.
dncrfalsebooleanWash numbers against the dncr blocklist.

About

Monopond Fax API PHP Client

Resources

Stars

3 stars

Watchers

17 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

api-client-php

Monopond Fax API PHP Client

#Building a Request To use Monopond SOAP PHP Client, start by including the MonopondSOAPClient.php then creating an instance of the client by supplying your credentials. Your username and password should be enclosed in quotation marks.

<?phpinclude_once'./MonopondSOAPClient.php';
// TODO: Enter your own credentials here$client = newMonopondSOAPClientV2_1("myusername", "mypassword", MPENV::PRODUCTION);
// TODO: Set up your request here?>

SendFax

Description

This is the core function in the API allowing you to send faxes on the platform.

Your specific faxing requirements will dictate which send request type below should be used. The two common use cases would be the sending of a single fax document to one destination and the sending of a single fax document to multiple destinations.

Sending a single fax:

To send a fax to a single destination a request similar to the following example can be used:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents = array($document);
// TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
// Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know the definitions:

Assigning DocumentRef in MonopondDocument

DocumentRef must be unique and a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DocumentRef = "Sample DocumentRef";
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document2->DocumentRef = "Sample DocumentRef2";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here to check the definition of DocumentRef:

Assigning SendRef and BroadcastRef in MonopondSendFaxRequest

To assign SendRef and BroadcastRef in MonopondSendFaxRequest, a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "Testing";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BroadcastRef = "BroadcastRef";
$sendFaxRequest->SendRef = "SendRef";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Visit here to know the definitions of SendRef and BroadcastRef:

Sending a Fax with Retries inside a MonopondFaxMessage

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Retries = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Retries inside a MonopondSendFaxRequest

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Retries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondFaxMessage

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->BusyRetries = 1;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondSendFaxRequest

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BusyRetries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Resolution in MonopondFaxMessage

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Resolution = "normal";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with Resolution in MonopondSendFaxRequest

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Resolution = "fine";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with FaxDitheringTechnique in MonopondDocument:

To set the fax FaxDitheringTechnique, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DitheringTechnique = "turbo";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the different values of FaxDitheringTechnique here:

Assigning a Timezone in MonopondFaxMessage

The Timezone is used to format the datetime display in the fax header.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->TimeZone = "Australia/Adelaide";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning a Timezone in MonopondSendFaxRequest

The Timezone is used to format the datetime display in the fax header. Applying it to the MonopondSendFaxRequest will apply this to all MonopondFaxMessages in the request.

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->TimeZone = "Australia/Adelaide";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning SendFrom in MonopondFaxMessage

To send fax with SendFrom in MonopondFaxMessage a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Sample SendFrom";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning SendFrom in MonopondSendFaxRequest

To send fax with SendFrom in MonopondSendFaxRequest a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->SendFrom = "Test Example";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning a HeaderFormat in MonopondFaxMessage

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning a HeaderFormat in MonopondSendFaxRequest

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning CLI in MonopondFaxMessage

Assigning a CLI in the MonopondFaxMessage, a request similar to the following example below.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->CLI = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of CLI here:

Sending a Fax with DNCR enabled in MonopondFaxMessage

To check if a number is on the Do Not Call Register (Australian) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with FPS enabled in MonopondFaxMessage

To check if a number is on the FPS blacklist (UK) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->fps = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with Smartblock enabled in MonopondFaxMessage

To check if a number is on the Smartblock list before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->smartblock = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Add a Blocklists in MonopondSendFaxRequest

If you want to validate all numbers in DNCR or FPS or Smarblock, a request must be similiar to this example:

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Blocklists = $monopondBlocklists;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with ScheduledStartTime in MonopondFaxMessage

To set a ScheduledStartTime for the MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->ScheduledStartTime = "2017-06-25T12:00:00Z";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with ScheduledStartTime in MonopondSendFaxRequest

To set a ScheduledStartTime for the MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with MustBeSentBeforeDate in MonopondFaxMessage

To set a MustBeSentBeforeDate for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MustBeSentBeforeDate in MonopondSendFaxRequest

To set a MustBeSentBeforeDate for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MaxFaxPages in MonopondFaxMessage

To set a MaxFaxPages for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MaxFaxPages = 1;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MaxFaxPages = 2;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending a Fax with MaxFaxPages in MonopondSendFaxRequest

To set a MaxFaxPages for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MaxFaxPages = 2;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending multiple faxes:

To send faxes to multiple destinations a request similar to the following example can be used. Please note the addition of another FaxMessage:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName2.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document3 = newMonopondDocument();
$document3->FileName = "AnyFileName3.txt";
$document3->FileData = $filedata;
$document3->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents[] = $document;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->Documents[] = $document2;
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
$faxMessage3->Documents[] = $document3;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending faxes to multiple destinations with the same document (broadcasting):

To send the same fax content to multiple destinations (broadcasting) a request similar to the example below can be used.

This method is recommended for broadcasting as it takes advantage of the multiple tiers in the send request. This eliminates the repeated parameters out of the individual fax message elements which are instead inherited from the parent send fax request. An example below shows SendFrom being used for both FaxMessages. While not shown in the example below further control can be achieved over individual fax elements to override the parameters set in the parent.

When sending multiple faxes in batch it is recommended to group them into requests of around 600 fax messages for optimal performance. If you are sending the same document to multiple destinations it is strongly advised to only attach the document once in the root of the send request rather than attaching a document for each destination.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Microsoft Documents With DocMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request is used to send a Microsoft document with replaceable variables or merge fields. The merge field follows the pattern <mf:key>. If your key is field1, it should be typed as <mf:field1> in the document. Note that the key must be unique within the whole document. The screenshots below are examples of what the request does.

Original .doc file:

before

This is what the file looks like after the fields field1,field2 and field3 have been replaced with values lazy dog, fat pig and fat pig:

stamp

Sample Request

The example below shows field1 will be replaced by the value of Test.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "name";
$mergeField->Value = "Raspberry Pi";
$document1 = newMonopondDocument();
$document1->DocumentRef = "send-1-document";
$document1->DocMergeData[] = $mergeField;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "message-1";
$faxMessage->SendTo = "61290120211";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Resolution = "normal";
$faxMessage->Retries = 0;
$faxMessage->BusyRetries = 2;
$faxMessage->CLI = 61290120211;
$faxMessage->Documents = array($document1);
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "name";
$mergeField2->Value = "Raspberry Pi 2";
$document2 = newMonopondDocument();
$document2->DocumentRef = "send-1-document";
$document2->DocMergeData[] = $mergeField2;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "message-2";
$faxMessage2->SendTo = "61290120211";
$faxMessage2->SendFrom = "Test Fax 2";
$faxMessage2->Resolution = "normal";
$faxMessage2->Retries = 0;
$faxMessage2->BusyRetries = 2;
$faxMessage2->CLI = 61011114111;
$faxMessage2->Documents = array($document2);
$baseDocument = newMonopondDocument();
$baseDocument->DocumentRef = "send-1-document2";
$baseDocument->FileName = "file.doc";
$baseDocument->FileData = $filedata;
$baseDocument->Order = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "broadcast-1";
$sendFaxRequest->SendRef = "send-1";
$sendFaxRequest->HeaderFormat = "Testing";
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->FaxMessages[] = $faxMessage2;
$sendFaxRequest->Documents = array($baseDocument);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Tiff and PDF files with StampMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request allows a TIFF file to be stamped with an image or text, based on X-Y coordinates. The x and y coordinates (0,0) starts at the top left part of the document. The screenshots below are examples of what the request does.

Original tiff file:

before

Sample stamp image:

stamp

This is what the tiff file looks like after stamping it with the image above:

after

The same tiff file, but this time, with a text stamp:

after

Sample Request

The example below shows a TIFF that will be stamped with the text “Hello” at xCoord=“1287” and yCoord=“421”, and an image at xCoord=“283” and yCoord=“120”

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "1287";
$stampMergeFieldKey->yCoord = "421";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->TextValue = $stampMergeFieldTextValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

Request with Image Stamping

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "283";
$stampMergeFieldKey->yCoord = "120";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

DocMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Properties:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Properties:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Properties:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

Response

The response received from a SendFaxRequest matches the response you receive when calling the FaxStatus method call with a send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, DocumentContentTypeNotFoundException, or InternalServerException. You can find more details on these faults here.

FaxStatus

Description

This function provides you with a method of retrieving the status, details and results of fax messages sent. While this is a legitimate method of retrieving results we strongly advise that you take advantage of our callback service, which will push these fax results to you as they are completed.

When making a status request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow the request query.

  • Limiting by a BroadcastRef allows you to retrieve faxes contained in a group of send requests.
  • Limiting by SendRef allows you to retrieve faxes contained in a single send request.
  • Limiting by MessageRef allows you to retrieve a single fax message.

There are multiple levels of verbosity available in the request; these are explained in detail below.

FaxStatusRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.
VerbosityStringVerbosity String The level of detail in the status response. Please see below for a list of possible values.

Verbosity Levels:

ValueDescription
briefGives you an overall view of the messages. This simply shows very high-level statistics, consisting of counts of how many faxes are at each status (i.e. processing, queued,sending) and totals of the results of these faxes (success, failed, blocked).
sendsend Includes the results from “brief” while also including an itemised list of each fax message in the request.
detailsdetails Includes the results from “send” along with details of the properties used to send the fax messages.
resultsIncludes the results from “send” along with the sending results of the fax messages.
allall Includes the results from both “details” and “results” along with some extra uncommon fields.

Sending a faxStatus Request with “brief” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "brief";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “send” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "send";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “details” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "details";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “results” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "results";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Response

The response received depends entirely on the verbosity level specified.

FaxStatusResponse:

NameTypeVerbosityDescription
FaxStatusTotalsFaxStatusTotalsbriefCounts of how many faxes are at each status. See below for more details.
FaxResultsTotalsFaxResultsTotalsbriefFaxResultsTotals FaxResultsTotals brief Totals of the end results of the faxes. See below for more details.
FaxMessagesArray of FaxMessagesendsend List of each fax in the query. See below for more details.

FaxStatusTotals:

Contains the total count of how many faxes are at each status. To see more information on each fax status, view the FaxStatus table below.

NameTypeVerbosityDescription
pendingLongbriefFax is pending on the system and waiting to be processed.
processingLongbriefFax is in the initial processing stages.
queuedLongbriefFax has finished processing and is queued, ready to send out at the send time.
startingLongbriefFax is ready to be sent out.
sendingLongbriefFax has been spooled to our servers and is in the process of being sent out.
finalizingLongbriefFax has finished sending and the results are being processed.
doneLongbriefFax has completed and no further actions will take place. The detailed results are available at this status.

FaxResultsTotals:

Contains the total count of how many faxes ended in each result, as well as some additional totals. To view more information on each fax result, view the FaxResults table below.

NameTypeVerbosityDescription
successLongbriefFax has successfully been delivered to its destination.
blockedLongbriefDestination number was found in one of the block lists.
failedLongbriefFax failed getting to its destination.
totalAttemptsLongbriefTotal attempts made in the reference context.
totalFaxDurationLongbrieftotalFaxDuration Long brief Total time spent on the line in the reference context.
totalPagesLongbriefTotal pages sent in the reference context.

apiFaxMessageStatus:

NameTypeVerbosityDescription
messageRefStringsend
sendRefStringsend
broadcastRefStringsend
sendToStringsend
statussendThe current status of the fax message. See the FaxStatus table above for possible status values.
FaxDetailsFaxDetailsdetailsContains the details and settings the fax was sent with. See below for more details.
FaxResultsArray of FaxResultresultsContains the results of each attempt at sending the fax message and their connection details. See below for more details.

FaxDetails:

NameTypeVerbosity
sendFromAlphanumeric Stringdetails
resolutionStringdetails
retriesIntegerdetails
busyRetriesIntegerdetails
headerFormatStringdetails

FaxResults:

NameTypeVerbosityDescription
attemptIntegerresultsThe attempt number of the FaxResult.
resultStringresultsThe result of the fax message. See the FaxResults table above for all possible results values.
ErrorFaxErrorresultsThe fax error code if the fax was not successful. See below for all possible values.
costBigDecimalresultsThe final cost of the fax message.
pagesIntegerresultsTotal pages sent to the end fax machine.
scheduledStartTimeDateTimeresultsThe date and time the fax is scheduled to start.
dateCallStartedDateTimeresultsDate and time the fax started transmitting.
dateCallEndedDateTimeresultsDate and time the fax finished transmitting.

FaxError:

ValueError Name
DOCUMENT_EXCEEDS_PAGE_LIMITDocument exceeds page limit
DOCUMENT_UNSUPPORTEDUnsupported document type
DOCUMENT_FAILED_CONVERSIONDocument failed conversion
FUNDS_INSUFFICIENTInsufficient funds
FUNDS_FAILEDFailed to transfer funds
BLOCK_ACCOUNTNumber cannot be sent from this account
BLOCK_GLOBALNumber found in the Global blocklist
BLOCK_SMARTNumber found in the Smart blocklist
BLOCK_DNCRNumber found in the DNCR blocklist
BLOCK_CUSTOMNumber found in a user specified blocklist
FAX_NEGOTIATION_FAILEDNegotiation failed
FAX_EARLY_HANGUPEarly hang-up on call
FAX_INCOMPATIBLE_MACHINEIncompatible fax machine
FAX_BUSYPhone number busy
FAX_NUMBER_UNOBTAINABLENumber unobtainable
FAX_SENDING_FAILEDSending fax failed
FAX_CANCELLEDCancelled
FAX_NO_ANSWERNo answer
FAX_UNKNOWNUnknown fax error

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

StopFax

Description

Stops a fax message from sending. This fax message must either be paused, queued, starting or sending. Please note the fax cannot be stopped if the fax is currently in the process of being transmitted to the destination device.

When making a stop request you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

StopFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

StopFax Request limiting by BroadcastRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->BroadcastRef = "Broadcast-test-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by SendRef:

$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->SendRef = "Send-Ref-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by MessageRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->MessageRef = "Testing-message-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

Response

The response received from a StopFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PauseFax

Description

Pauses a fax message before it starts transmitting. This fax message must either be queued, starting or sending. Please note the fax cannot be paused if the message is currently being transmitted to the destination device.

When making a pause request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

PauseFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

PauseFax Request limiting by BroadcastRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->BroadcastRef = "Broadcast-test-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by SendRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->SendRef = "Send-Ref-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by MessageRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->MessageRef = "Testing-message-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

Response

The response received from a PauseFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults in here.

ResumeFax

When making a resume request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

ResumeFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

ResumeFax Request limiting by BroadcastRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->BroadcastRef = "Broadcast-test-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by SendRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->SendRef = "Send-Ref-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by MessageRef:

$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->MessageRef = "Testing-message-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

Response

The response received from a ResumeFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PreviewFaxDocument

Description

This function provides you with a method to generate a preview of a saved document at different resolutions with various dithering settings. It returns a tiff data in base64 along with a page count.

Normal PreviewFaxDocument Request

// TODO: Put your file path here$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello World!";
$monopondStampMergeField = newMonopondStampMergeField();
$monopondStampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$monopondStampMergeField->TextValue = $stampMergeFieldTextValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-document-ref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($monopondStampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($stampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with DocMergeData

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "field1";
$mergeField->Value = "Raspberry Pi";
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "field2";
$mergeField2->Value = "Human";
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-documentref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->DocMergeData = array($mergeField, $mergeField2);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

Request

FaxDocumentPreviewRequest Parameters:

NameRequiredTypeDescriptionDefault
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
DitheringTechniqueFaxDitheringTechniqueApplies a custom dithering method to the fax document before transmission.
DocMergeDataArray of DocMergeData MergeFieldsEach mergefield has a key and a value. The system will look for the keys in a document and replace them with their corresponding value.
StampMergeDataArray of StampMergeData MergeFieldsEach mergefield has a key a corressponding TextValue/ImageValue. The system will look for the keys in a document and replace them with their corresponding value.

DocMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Parameters:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Parameters:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Parameters:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

FaxDocumentPreviewResponse

NameTypeDescription
TiffPreviewStringA preview version of the document encoded in Base64 format.
NumberOfPagesIntTotal number of pages in the document preview.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException, UnsupportedDocumentContentType, MergeFieldDoesNotMatchDocumentTypeException, UnknownHostException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

SaveFaxDocument

Description

This function allows you to upload a document and save it under a document reference (DocumentRef) for later use. (Note: These saved documents only last 30 days on the system.)

Sample Request

$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$saveFaxDocumentRequest = newMonopondSaveFaxDocumentRequest();
$saveFaxDocumentRequest->DocumentRef = "sample-document-ref";
$saveFaxDocumentRequest->FileName = "test.pdf";
$saveFaxDocumentRequest->FileData = $filedata;
$saveFaxDocumentResponse = $client->saveFaxDocument($saveFaxDocumentRequest);
print_r($saveFaxDocumentResponse);

Request

SaveFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefXStringUnique identifier for the document to be uploaded.
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefAlreadyExistsException, DocumentContentTypeNotFoundException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

DeleteFaxDocument

Description

This function removes a saved fax document from the system.

Sample Request

// TODO: Put your file path here$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$deleteFaxDocumentRequest = newMonopondDeleteFaxDocumentRequest();
$deleteFaxDocumentRequest->DocumentRef = "sample-document-ref";
// Call delete FaxDocument method$deleteRespone = $client->deleteFaxDocument($deleteFaxDocumentRequest);
print_r($deleteRespone);

Request

DeleteFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefStringUnique identifier for the document to be deleted.
MessageRefStringUser-defined message reference.
SendRefStringUser-defined send reference.
BroadcastRefStringUser-defined broadcast reference.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

More Information

Exceptions/SOAP Faults

If an error occurs during a request on the Monopond Fax API the service will throw a SOAP fault or exception. Each exception is listed in detail below.

InvalidArgumentsException

One or more of the arguments passed in the request were invalid. Each element that failed validation is included in the fault details along with the reason for failure.

DocumentContentTypeNotFoundException

There was an error while decoding the document provided; we were unable to determine its content type.

DocumentRefAlreadyExistsException

There is already a document on your account with this DocumentRef.

DocumentContentTypeNotFoundException

Content type could not be found for the document.

NoMessagesFoundException

Based on the references sent in the request no messages could be found that match the criteria.

InternalServerException

An unusual error occurred on the platform. If this error occurs please contact support for further instruction.

General Properties and File Formatting

File Encoding

All files are encoded in the Base64 encoding specified in RFC 2045 - MIME (Multipurpose Internet Mail Extensions). The Base64 encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used, enabling 6 bits to be represented per printable character. For more information see http://tools.ietf.org/html/rfc2045 and http://en.wikipedia.org/wiki/Base64

Dates

Dates are always passed in ISO-8601 format with time zone. For example: “2012-07-17T19:27:23+08:00”

MonopondSendFaxRequest Properties

NameRequiredTypeDescriptionDefault
BroadcastRefStringAllows the user to tag all faxes in this request with a user-defined broadcastreference. These faxes can then be retrieved at a later point based on this reference.
SendRefStringSimilar to the BroadcastRef, this allows the user to tag all faxes in this request with a send reference. The SendRef is used to represent all faxes in this request only, so naturally it must be unique.
FaxMessagesXArray of FaxMessageFaxMessages describe each individual fax message and its destination. See below for details.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersFax
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Current time (immediate sending)
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details.WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Each account has a maximum number of busy retries that can be changed by consultation with your account manager.Account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20

MonopondFaxMessage Properties

This represents a single fax message being sent to a destination.

NameRequiredTypeDescriptionDefault
MessageRefXStringA unique user-provided identifier that is used to identify the fax message. This can be used at a later point to retrieve the results of the fax message.
SendToXStringThe phone number the fax message will be sent to.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersEmpty
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Start now
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details. WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Please consult with your account manager in regards to maximum value.account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20
CLIStringAllows a customer called ID. Note: Must be enabled on the account before it can be used.

MonopondDocument Properties

Represents a fax document to be sent through the system. Supported file types are: PDF, TIFF, PNG, JPG, GIF, TXT, PS, RTF, DOC, DOCX, XLS, XLSX, PPT, PPTX.

NameRequiredTypeDescriptionDefault
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.
OrderXIntegerIf multiple documents are defined on a message this value will determine the order in which they will be transmitted.0
DocMergeDataAn Array of MergeFields
StampMergeDataAn Array of MergeFields

Resolution Levels

ValueDescription
normalNormal standard resolution (98 scan lines per inch)
fineFine resolution (196 scan lines per inch)

FaxDitheringTechnique

ValueFax Dithering Technique
noneNo dithering.
normalNormal dithering.
turboTurbo dithering.
darkenDarken dithering.
darken_moreDarken more dithering.
darken_extraDarken extra dithering.
lightenLighten dithering.
lighten_moreLighten more dithering.
crosshatchCrosshatch dithering.
DETAILEDDetailed dithering.

Header Format

Determines the format of the header line that is printed on the top of the transmitted fax message. This is set to **rom %from%, To %to%|%a %b %d %H:%M %Y”**y default which produces the following:

From TSID, To 61022221234 Mon Aug 28 15:32 2012 1 of 1

ValueDescription
%from%The value of the SendFrom field in the message.
%to%The value of the SendTo field in the message.
%aWeekday name (abbreviated)
%AWeekday name
%bMonth name (abbreviated)
%BMonth name
%dDay of the month as a decimal (01 – 31)
%mMonth as a decimal (01 – 12)
%yYear as a decimal (abbreviated)
%YYear as a decimal
%HHour as a decimal using a 24-hour clock (00 – 23)
%IHour as a decimal using a 12-hour clock (01 – 12)
%MMinute as a decimal (00 – 59)
%SSecond as a decimal (00 – 59)
%pAM or PM
%jDay of the year as a decimal (001 – 366)
%UWeek of the year as a decimal (Monday as first day of the week) (00 – 53)
%WDay of the year as a decimal (001 – 366)
%wDay of the week as a decimal (0 – 6) (Sunday being 0)
%%A literal % character

TODO: The default value is set to: “From %from%, To %to%|%a %b %d %H:%M %Y”

Blocklists Parameters

NameRequiredTypeDescription
smartblockfalsebooleanBlocks sending to a number if it has consistently failed in the past.
fpsfalsebooleanWash numbers against the fps blocklist.
dncrfalsebooleanWash numbers against the dncr blocklist.

About

Monopond Fax API PHP Client

Resources

Stars

3 stars

Watchers

17 watching

Forks

Releases

Packages

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

api-client-php

Monopond Fax API PHP Client

#Building a Request To use Monopond SOAP PHP Client, start by including the MonopondSOAPClient.php then creating an instance of the client by supplying your credentials. Your username and password should be enclosed in quotation marks.

<?phpinclude_once'./MonopondSOAPClient.php';
// TODO: Enter your own credentials here$client = newMonopondSOAPClientV2_1("myusername", "mypassword", MPENV::PRODUCTION);
// TODO: Set up your request here?>

SendFax

Description

This is the core function in the API allowing you to send faxes on the platform.

Your specific faxing requirements will dictate which send request type below should be used. The two common use cases would be the sending of a single fax document to one destination and the sending of a single fax document to multiple destinations.

Sending a single fax:

To send a fax to a single destination a request similar to the following example can be used:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents = array($document);
// TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
// Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know the definitions:

Assigning DocumentRef in MonopondDocument

DocumentRef must be unique and a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DocumentRef = "Sample DocumentRef";
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document2->DocumentRef = "Sample DocumentRef2";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here to check the definition of DocumentRef:

Assigning SendRef and BroadcastRef in MonopondSendFaxRequest

To assign SendRef and BroadcastRef in MonopondSendFaxRequest, a request must be similar to this example:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "Testing";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BroadcastRef = "BroadcastRef";
$sendFaxRequest->SendRef = "SendRef";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Visit here to know the definitions of SendRef and BroadcastRef:

Sending a Fax with Retries inside a MonopondFaxMessage

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Retries = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Retries inside a MonopondSendFaxRequest

To set-up a fax to have retries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Retries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondFaxMessage

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->BusyRetries = 1;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with BusyRetries inside a MonopondSendFaxRequest

To set-up a fax to have busyRetries a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->BusyRetries = 1;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the following properties of MonopondDocument, MonopondFaxMessage, and MonopondSendFaxRequest to know their definitions:

Sending a Fax with Resolution in MonopondFaxMessage

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Resolution = "normal";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with Resolution in MonopondSendFaxRequest

To assign the fax resolution, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Resolution = "fine";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of Resolution and its values here:

Sending a Fax with FaxDitheringTechnique in MonopondDocument:

To set the fax FaxDitheringTechnique, a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document->DitheringTechnique = "turbo";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the different values of FaxDitheringTechnique here:

Assigning a Timezone in MonopondFaxMessage

The Timezone is used to format the datetime display in the fax header.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->TimeZone = "Australia/Adelaide";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning a Timezone in MonopondSendFaxRequest

The Timezone is used to format the datetime display in the fax header. Applying it to the MonopondSendFaxRequest will apply this to all MonopondFaxMessages in the request.

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->TimeZone = "Australia/Adelaide";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Assigning SendFrom in MonopondFaxMessage

To send fax with SendFrom in MonopondFaxMessage a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Sample SendFrom";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning SendFrom in MonopondSendFaxRequest

To send fax with SendFrom in MonopondSendFaxRequest a request similar to the following example can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->SendFrom = "Test Example";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of SendFrom here:

Assigning a HeaderFormat in MonopondFaxMessage

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning a HeaderFormat in MonopondSendFaxRequest

Allows the header format that appears at the top of the transmitted fax to be changed.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->HeaderFormat = "From %from%, To %to%|%a %b %d %H:%M %Y";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

For more information, visit the following on how to setup the HeaderFormat value:

Assigning CLI in MonopondFaxMessage

Assigning a CLI in the MonopondFaxMessage, a request similar to the following example below.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->CLI = "61011111111";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit the definition of CLI here:

Sending a Fax with DNCR enabled in MonopondFaxMessage

To check if a number is on the Do Not Call Register (Australian) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with FPS enabled in MonopondFaxMessage

To check if a number is on the FPS blacklist (UK) before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->fps = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with Smartblock enabled in MonopondFaxMessage

To check if a number is on the Smartblock list before the fax is sent:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->smartblock = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Blocklists = $monopondBlocklists;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Add a Blocklists in MonopondSendFaxRequest

If you want to validate all numbers in DNCR or FPS or Smarblock, a request must be similiar to this example:

/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup Blocklists */$monopondBlocklists = newMonopondBlocklist();
$monopondBlocklists->dncr = "true";
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->Blocklists = $monopondBlocklists;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of Blocklists and its paremeters:

Sending a Fax with ScheduledStartTime in MonopondFaxMessage

To set a ScheduledStartTime for the MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->ScheduledStartTime = "2017-06-25T12:00:00Z";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with ScheduledStartTime in MonopondSendFaxRequest

To set a ScheduledStartTime for the MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->ScheduledStartTime = "2017-06-25T12:00:00Z";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

You can visit here the definition of ScheduledStartTime here:

Sending a Fax with MustBeSentBeforeDate in MonopondFaxMessage

To set a MustBeSentBeforeDate for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MustBeSentBeforeDate in MonopondSendFaxRequest

To set a MustBeSentBeforeDate for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MustBeSentBeforeDate = "2017-09-05T21:30:17+10:00";
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MustBeSentBeforeDate you can check it here:

Sending a Fax with MaxFaxPages in MonopondFaxMessage

To set a MaxFaxPages for MonopondFaxMessage, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->MaxFaxPages = 1;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->MaxFaxPages = 2;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending a Fax with MaxFaxPages in MonopondSendFaxRequest

To set a MaxFaxPages for MonopondSendFaxRequest, a request similar to the following can be used.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2);
$sendFaxRequest->Documents = array($document);
$sendFaxRequest->MaxFaxPages = 2;
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

To know more about MaxFaxPages you can check it here:

Sending multiple faxes:

To send faxes to multiple destinations a request similar to the following example can be used. Please note the addition of another FaxMessage:

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName2.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
$document3 = newMonopondDocument();
$document3->FileName = "AnyFileName3.txt";
$document3->FileData = $filedata;
$document3->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->Documents[] = $document;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage2->Documents[] = $document2;
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
$faxMessage3->Documents[] = $document3;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending faxes to multiple destinations with the same document (broadcasting):

To send the same fax content to multiple destinations (broadcasting) a request similar to the example below can be used.

This method is recommended for broadcasting as it takes advantage of the multiple tiers in the send request. This eliminates the repeated parameters out of the individual fax message elements which are instead inherited from the parent send fax request. An example below shows SendFrom being used for both FaxMessages. While not shown in the example below further control can be achieved over individual fax elements to override the parameters set in the parent.

When sending multiple faxes in batch it is recommended to group them into requests of around 600 fax messages for optimal performance. If you are sending the same document to multiple destinations it is strongly advised to only attach the document once in the root of the send request rather than attaching a document for each destination.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.txt", "r"), filesize("tests/sample.txt"));
$filedata = base64_encode($filedata);
/* Setup Documents */$document = newMonopondDocument();
$document->FileName = "AnyFileName1.txt";
$document->FileData = $filedata;
$document->Order = 0;
$document2 = newMonopondDocument();
$document2->FileName = "AnyFileName1.txt";
$document2->FileData = $filedata;
$document2->Order = 0;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "Testing-message-2";
$faxMessage2->SendTo = "61011111112";
$faxMessage3 = newMonopondFaxMessage();
$faxMessage3->MessageRef = "Testing-message-3";
$faxMessage3->SendTo = "61011111112";
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->FaxMessages = array($faxMessage, $faxMessage2, $faxMessage3);
$sendFaxRequest->Documents = array($document, $document2);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Microsoft Documents With DocMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request is used to send a Microsoft document with replaceable variables or merge fields. The merge field follows the pattern <mf:key>. If your key is field1, it should be typed as <mf:field1> in the document. Note that the key must be unique within the whole document. The screenshots below are examples of what the request does.

Original .doc file:

before

This is what the file looks like after the fields field1,field2 and field3 have been replaced with values lazy dog, fat pig and fat pig:

stamp

Sample Request

The example below shows field1 will be replaced by the value of Test.

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "name";
$mergeField->Value = "Raspberry Pi";
$document1 = newMonopondDocument();
$document1->DocumentRef = "send-1-document";
$document1->DocMergeData[] = $mergeField;
/* Setup FaxMessages (Each contains an array of document objects) */$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "message-1";
$faxMessage->SendTo = "61290120211";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Resolution = "normal";
$faxMessage->Retries = 0;
$faxMessage->BusyRetries = 2;
$faxMessage->CLI = 61290120211;
$faxMessage->Documents = array($document1);
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "name";
$mergeField2->Value = "Raspberry Pi 2";
$document2 = newMonopondDocument();
$document2->DocumentRef = "send-1-document";
$document2->DocMergeData[] = $mergeField2;
$faxMessage2 = newMonopondFaxMessage();
$faxMessage2->MessageRef = "message-2";
$faxMessage2->SendTo = "61290120211";
$faxMessage2->SendFrom = "Test Fax 2";
$faxMessage2->Resolution = "normal";
$faxMessage2->Retries = 0;
$faxMessage2->BusyRetries = 2;
$faxMessage2->CLI = 61011114111;
$faxMessage2->Documents = array($document2);
$baseDocument = newMonopondDocument();
$baseDocument->DocumentRef = "send-1-document2";
$baseDocument->FileName = "file.doc";
$baseDocument->FileData = $filedata;
$baseDocument->Order = 0;
/* Setup FaxSendRequest (Each contains an array of fax messages) */$sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "broadcast-1";
$sendFaxRequest->SendRef = "send-1";
$sendFaxRequest->HeaderFormat = "Testing";
$sendFaxRequest->FaxMessages[] = $faxMessage;
$sendFaxRequest->FaxMessages[] = $faxMessage2;
$sendFaxRequest->Documents = array($baseDocument);
/* Send request to Monopond */$sendRespone = $client->sendFax($sendFaxRequest);
/* Display response */print_r($sendRespone);

Sending Tiff and PDF files with StampMergeData:

(This request only works in version 2.1(or higher) of the fax-api.)

This request allows a TIFF file to be stamped with an image or text, based on X-Y coordinates. The x and y coordinates (0,0) starts at the top left part of the document. The screenshots below are examples of what the request does.

Original tiff file:

before

Sample stamp image:

stamp

This is what the tiff file looks like after stamping it with the image above:

after

The same tiff file, but this time, with a text stamp:

after

Sample Request

The example below shows a TIFF that will be stamped with the text “Hello” at xCoord=“1287” and yCoord=“421”, and an image at xCoord=“283” and yCoord=“120”

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "1287";
$stampMergeFieldKey->yCoord = "421";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->TextValue = $stampMergeFieldTextValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

Request with Image Stamping

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "283";
$stampMergeFieldKey->yCoord = "120";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
// TODO: Setup Document$document = newMonopondDocument();
$document->FileName = "AnyFileName1.tiff";
$document->FileData = $filedata;
$document->Order = 0;
$document->StampMergeData[] = $stampMergeField;
// TODO: Setup FaxMessage$faxMessage = newMonopondFaxMessage();
$faxMessage->MessageRef = "Testing-message-1";
$faxMessage->SendTo = "61011111111";
$faxMessage->SendFrom = "Test Fax";
$faxMessage->Documents = array($document);
$faxMessage->Resolution = "normal";
// // TODO: Setup FaxSendRequest $sendFaxRequest = newMonopondSendFaxRequest();
$sendFaxRequest->BroadcastRef = "Broadcast-test-1";
$sendFaxRequest->SendRef = "Send-Ref-1";
$sendFaxRequest->FaxMessages[] = $faxMessage;
// // Call send fax method$sendRespone = $client->sendFax($sendFaxRequest);
print_r($sendRespone);

DocMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Properties:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Properties:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Properties:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Properties:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

Response

The response received from a SendFaxRequest matches the response you receive when calling the FaxStatus method call with a send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, DocumentContentTypeNotFoundException, or InternalServerException. You can find more details on these faults here.

FaxStatus

Description

This function provides you with a method of retrieving the status, details and results of fax messages sent. While this is a legitimate method of retrieving results we strongly advise that you take advantage of our callback service, which will push these fax results to you as they are completed.

When making a status request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow the request query.

  • Limiting by a BroadcastRef allows you to retrieve faxes contained in a group of send requests.
  • Limiting by SendRef allows you to retrieve faxes contained in a single send request.
  • Limiting by MessageRef allows you to retrieve a single fax message.

There are multiple levels of verbosity available in the request; these are explained in detail below.

FaxStatusRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.
VerbosityStringVerbosity String The level of detail in the status response. Please see below for a list of possible values.

Verbosity Levels:

ValueDescription
briefGives you an overall view of the messages. This simply shows very high-level statistics, consisting of counts of how many faxes are at each status (i.e. processing, queued,sending) and totals of the results of these faxes (success, failed, blocked).
sendsend Includes the results from “brief” while also including an itemised list of each fax message in the request.
detailsdetails Includes the results from “send” along with details of the properties used to send the fax messages.
resultsIncludes the results from “send” along with the sending results of the fax messages.
allall Includes the results from both “details” and “results” along with some extra uncommon fields.

Sending a faxStatus Request with “brief” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "brief";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “send” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "send";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “details” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "details";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Sending a faxStatus Request with “results” verbosity:

// TODO: Setup FaxStatusRequest $faxStatusRequest = newMonopondFaxStatusRequest();
$faxStatusRequest->MessageRef = "Testing-message-1";
$faxStatusRequest->Verbosity = "results";
// Call fax status method$faxStatus = $client->faxStatus($faxStatusRequest);
print_r($faxStatus);

Response

The response received depends entirely on the verbosity level specified.

FaxStatusResponse:

NameTypeVerbosityDescription
FaxStatusTotalsFaxStatusTotalsbriefCounts of how many faxes are at each status. See below for more details.
FaxResultsTotalsFaxResultsTotalsbriefFaxResultsTotals FaxResultsTotals brief Totals of the end results of the faxes. See below for more details.
FaxMessagesArray of FaxMessagesendsend List of each fax in the query. See below for more details.

FaxStatusTotals:

Contains the total count of how many faxes are at each status. To see more information on each fax status, view the FaxStatus table below.

NameTypeVerbosityDescription
pendingLongbriefFax is pending on the system and waiting to be processed.
processingLongbriefFax is in the initial processing stages.
queuedLongbriefFax has finished processing and is queued, ready to send out at the send time.
startingLongbriefFax is ready to be sent out.
sendingLongbriefFax has been spooled to our servers and is in the process of being sent out.
finalizingLongbriefFax has finished sending and the results are being processed.
doneLongbriefFax has completed and no further actions will take place. The detailed results are available at this status.

FaxResultsTotals:

Contains the total count of how many faxes ended in each result, as well as some additional totals. To view more information on each fax result, view the FaxResults table below.

NameTypeVerbosityDescription
successLongbriefFax has successfully been delivered to its destination.
blockedLongbriefDestination number was found in one of the block lists.
failedLongbriefFax failed getting to its destination.
totalAttemptsLongbriefTotal attempts made in the reference context.
totalFaxDurationLongbrieftotalFaxDuration Long brief Total time spent on the line in the reference context.
totalPagesLongbriefTotal pages sent in the reference context.

apiFaxMessageStatus:

NameTypeVerbosityDescription
messageRefStringsend
sendRefStringsend
broadcastRefStringsend
sendToStringsend
statussendThe current status of the fax message. See the FaxStatus table above for possible status values.
FaxDetailsFaxDetailsdetailsContains the details and settings the fax was sent with. See below for more details.
FaxResultsArray of FaxResultresultsContains the results of each attempt at sending the fax message and their connection details. See below for more details.

FaxDetails:

NameTypeVerbosity
sendFromAlphanumeric Stringdetails
resolutionStringdetails
retriesIntegerdetails
busyRetriesIntegerdetails
headerFormatStringdetails

FaxResults:

NameTypeVerbosityDescription
attemptIntegerresultsThe attempt number of the FaxResult.
resultStringresultsThe result of the fax message. See the FaxResults table above for all possible results values.
ErrorFaxErrorresultsThe fax error code if the fax was not successful. See below for all possible values.
costBigDecimalresultsThe final cost of the fax message.
pagesIntegerresultsTotal pages sent to the end fax machine.
scheduledStartTimeDateTimeresultsThe date and time the fax is scheduled to start.
dateCallStartedDateTimeresultsDate and time the fax started transmitting.
dateCallEndedDateTimeresultsDate and time the fax finished transmitting.

FaxError:

ValueError Name
DOCUMENT_EXCEEDS_PAGE_LIMITDocument exceeds page limit
DOCUMENT_UNSUPPORTEDUnsupported document type
DOCUMENT_FAILED_CONVERSIONDocument failed conversion
FUNDS_INSUFFICIENTInsufficient funds
FUNDS_FAILEDFailed to transfer funds
BLOCK_ACCOUNTNumber cannot be sent from this account
BLOCK_GLOBALNumber found in the Global blocklist
BLOCK_SMARTNumber found in the Smart blocklist
BLOCK_DNCRNumber found in the DNCR blocklist
BLOCK_CUSTOMNumber found in a user specified blocklist
FAX_NEGOTIATION_FAILEDNegotiation failed
FAX_EARLY_HANGUPEarly hang-up on call
FAX_INCOMPATIBLE_MACHINEIncompatible fax machine
FAX_BUSYPhone number busy
FAX_NUMBER_UNOBTAINABLENumber unobtainable
FAX_SENDING_FAILEDSending fax failed
FAX_CANCELLEDCancelled
FAX_NO_ANSWERNo answer
FAX_UNKNOWNUnknown fax error

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

StopFax

Description

Stops a fax message from sending. This fax message must either be paused, queued, starting or sending. Please note the fax cannot be stopped if the fax is currently in the process of being transmitted to the destination device.

When making a stop request you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

StopFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

StopFax Request limiting by BroadcastRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->BroadcastRef = "Broadcast-test-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by SendRef:

$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->SendRef = "Send-Ref-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

StopFax Request limiting by MessageRef:

// TODO: Setup StopFaxRequest$stopFaxRequest = newMonopondStopFaxRequest();
$stopFaxRequest->MessageRef = "Testing-message-1";
$stopFax = $client->stopFax($stopFaxRequest);
print_r($stopFax);

Response

The response received from a StopFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong:

InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PauseFax

Description

Pauses a fax message before it starts transmitting. This fax message must either be queued, starting or sending. Please note the fax cannot be paused if the message is currently being transmitted to the destination device.

When making a pause request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

PauseFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

PauseFax Request limiting by BroadcastRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->BroadcastRef = "Broadcast-test-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by SendRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->SendRef = "Send-Ref-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

PauseFax Request limiting by MessageRef:

// TODO: Setup PauseFaxRequest$pauseFaxRequest = newMonopondPauseFaxRequest();
$pauseFaxRequest->MessageRef = "Testing-message-1";
$pauseFax = $client->pauseFax($pauseFaxRequest);
print_r($pauseFax);

Response

The response received from a PauseFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults in here.

ResumeFax

When making a resume request, you must provide at least a BroadcastRef, SendRef or MessageRef. The function will also accept a combination of these to further narrow down the request.

Request

ResumeFaxRequest Properties:

NameRequiredTypeDescription
BroadcastRefStringUser-defined broadcast reference.
SendRefStringUser-defined send reference.
MessageRefStringUser-defined message reference.

ResumeFax Request limiting by BroadcastRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->BroadcastRef = "Broadcast-test-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by SendRef:

// TODO: Setup ResumeFaxRequest$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->SendRef = "Send-Ref-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

ResumeFax Request limiting by MessageRef:

$resumeFaxRequest = newMonopondResumeFaxRequest();
$resumeFaxRequest->MessageRef = "Testing-message-1";
$resumeFax = $client->resumeFax($resumeFaxRequest);
print_r($resumeFax);

Response

The response received from a ResumeFaxRequest is the same response you would receive when calling the FaxStatus method call with the send verbosity level.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: InvalidArgumentsException, NoMessagesFoundException, or InternalServerException. You can find more details on these faults here.

PreviewFaxDocument

Description

This function provides you with a method to generate a preview of a saved document at different resolutions with various dithering settings. It returns a tiff data in base64 along with a page count.

Normal PreviewFaxDocument Request

// TODO: Put your file path here$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

// TODO: Put your file path here$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldTextValue = newMonopondStampMergeFieldTextValue();
$stampMergeFieldTextValue->fontName = "Bookman-DemiItalic";
$stampMergeFieldTextValue->Value = "Hello World!";
$monopondStampMergeField = newMonopondStampMergeField();
$monopondStampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$monopondStampMergeField->TextValue = $stampMergeFieldTextValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-document-ref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($monopondStampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with StampMergeFieldText

$filedata = fread(fopen("tests/document.tiff", "r"), filesize("tests/document.tiff"));
$filedata = base64_encode($filedata);
$stampFiledata = fread(fopen("tests/stamp.png", "r"), filesize("tests/stamp.png"));
$stampFiledata = base64_encode($stampFiledata);
$stampMergeFieldKey = newMonopondStampMergeFieldKey();
$stampMergeFieldKey->xCoord = "390";
$stampMergeFieldKey->yCoord = "757";
$stampMergeFieldImageValue = newMonopondStampMergeFieldImageValue();
$stampMergeFieldImageValue->FileName = "hello.png";
$stampMergeFieldImageValue->FileData = $stampFiledata;
$stampMergeFieldImageValue->width = "25";
$stampMergeFieldImageValue->height = "25";
$stampMergeField = newMonopondStampMergeField();
$stampMergeField->StampMergeFieldKey = $stampMergeFieldKey;
$stampMergeField->ImageValue = $stampMergeFieldImageValue;
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "hello-space2021";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->StampMergeData = array($stampMergeField);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

PreviewFaxDocument Request with DocMergeData

// TODO: Put your file path here$filedata = fread(fopen("tests/sample.doc", "r"), filesize("tests/sample.doc"));
$filedata = base64_encode($filedata);
$mergeField = newMonopondMergeField();
$mergeField->Key = "field1";
$mergeField->Value = "Raspberry Pi";
$mergeField2 = newMonopondMergeField();
$mergeField2->Key = "field2";
$mergeField2->Value = "Human";
$faxDocumentPreviewRequest = newMonopondFaxDocumentPreviewRequest();
$faxDocumentPreviewRequest->DocumentRef = "sample-documentref";
$faxDocumentPreviewRequest->Resolution = "fine";
$faxDocumentPreviewRequest->DitheringTechnique = "normal";
$faxDocumentPreviewRequest->DocMergeData = array($mergeField, $mergeField2);
$faxDocumentPreviewResponse = $client->faxDocumentPreview($faxDocumentPreviewRequest);
print_r($faxDocumentPreviewResponse);

Request

FaxDocumentPreviewRequest Parameters:

NameRequiredTypeDescriptionDefault
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
DitheringTechniqueFaxDitheringTechniqueApplies a custom dithering method to the fax document before transmission.
DocMergeDataArray of DocMergeData MergeFieldsEach mergefield has a key and a value. The system will look for the keys in a document and replace them with their corresponding value.
StampMergeDataArray of StampMergeData MergeFieldsEach mergefield has a key a corressponding TextValue/ImageValue. The system will look for the keys in a document and replace them with their corresponding value.

DocMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStringA unique identifier used to determine which fields need replacing.
ValueStringThe value that replaces the key.

StampMergeData Mergefield Parameters:

NameRequiredTypeDescription
KeyStampMergeFieldKeyContains x and y coordinates where the ImageValue or TextValue should be placed.
TextValueStampMergeFieldTextValueThe text value that replaces the key.
ImageValueStampMergeFieldImageValueThe image value that replaces the key.

StampMergeFieldKey Parameters:

NameRequiredTypeDescription
xCoordIntX coordinate.
yCoordIntY coordinate.

StampMergeFieldTextValue Parameters:

NameRequiredTypeDescription
fontNameStringFont name to be used.
fontSizeDecimalFont size to be used.

StampMergeFieldImageValue Parameters:

NameRequiredTypeDescription
fileNameStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
fileDataBase64The document encoded in Base64 format.

FaxDocumentPreviewResponse

NameTypeDescription
TiffPreviewStringA preview version of the document encoded in Base64 format.
NumberOfPagesIntTotal number of pages in the document preview.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException, UnsupportedDocumentContentType, MergeFieldDoesNotMatchDocumentTypeException, UnknownHostException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

SaveFaxDocument

Description

This function allows you to upload a document and save it under a document reference (DocumentRef) for later use. (Note: These saved documents only last 30 days on the system.)

Sample Request

$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$saveFaxDocumentRequest = newMonopondSaveFaxDocumentRequest();
$saveFaxDocumentRequest->DocumentRef = "sample-document-ref";
$saveFaxDocumentRequest->FileName = "test.pdf";
$saveFaxDocumentRequest->FileData = $filedata;
$saveFaxDocumentResponse = $client->saveFaxDocument($saveFaxDocumentRequest);
print_r($saveFaxDocumentResponse);

Request

SaveFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefXStringUnique identifier for the document to be uploaded.
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefAlreadyExistsException, DocumentContentTypeNotFoundException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

DeleteFaxDocument

Description

This function removes a saved fax document from the system.

Sample Request

// TODO: Put your file path here$filedata = fread(fopen("tests/test.pdf", "r"), filesize("tests/test.pdf"));
$filedata = base64_encode($filedata);
$deleteFaxDocumentRequest = newMonopondDeleteFaxDocumentRequest();
$deleteFaxDocumentRequest->DocumentRef = "sample-document-ref";
// Call delete FaxDocument method$deleteRespone = $client->deleteFaxDocument($deleteFaxDocumentRequest);
print_r($deleteRespone);

Request

DeleteFaxDocumentRequest Parameters:

NameRequiredTypeDescription
DocumentRefStringUnique identifier for the document to be deleted.
MessageRefStringUser-defined message reference.
SendRefStringUser-defined send reference.
BroadcastRefStringUser-defined broadcast reference.

SOAP Faults

This function will throw one of the following SOAP faults/exceptions if something went wrong: DocumentRefDoesNotExistException, InternalServerException. You can find more details on these faults in Section 5 of this document.You can find more details on these faults in the next section of this document.

More Information

Exceptions/SOAP Faults

If an error occurs during a request on the Monopond Fax API the service will throw a SOAP fault or exception. Each exception is listed in detail below.

InvalidArgumentsException

One or more of the arguments passed in the request were invalid. Each element that failed validation is included in the fault details along with the reason for failure.

DocumentContentTypeNotFoundException

There was an error while decoding the document provided; we were unable to determine its content type.

DocumentRefAlreadyExistsException

There is already a document on your account with this DocumentRef.

DocumentContentTypeNotFoundException

Content type could not be found for the document.

NoMessagesFoundException

Based on the references sent in the request no messages could be found that match the criteria.

InternalServerException

An unusual error occurred on the platform. If this error occurs please contact support for further instruction.

General Properties and File Formatting

File Encoding

All files are encoded in the Base64 encoding specified in RFC 2045 - MIME (Multipurpose Internet Mail Extensions). The Base64 encoding is designed to represent arbitrary sequences of octets in a form that need not be humanly readable. A 65-character subset ([A-Za-z0-9+/=]) of US-ASCII is used, enabling 6 bits to be represented per printable character. For more information see http://tools.ietf.org/html/rfc2045 and http://en.wikipedia.org/wiki/Base64

Dates

Dates are always passed in ISO-8601 format with time zone. For example: “2012-07-17T19:27:23+08:00”

MonopondSendFaxRequest Properties

NameRequiredTypeDescriptionDefault
BroadcastRefStringAllows the user to tag all faxes in this request with a user-defined broadcastreference. These faxes can then be retrieved at a later point based on this reference.
SendRefStringSimilar to the BroadcastRef, this allows the user to tag all faxes in this request with a send reference. The SendRef is used to represent all faxes in this request only, so naturally it must be unique.
FaxMessagesXArray of FaxMessageFaxMessages describe each individual fax message and its destination. See below for details.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersFax
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Current time (immediate sending)
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details.WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Each account has a maximum number of busy retries that can be changed by consultation with your account manager.Account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20

MonopondFaxMessage Properties

This represents a single fax message being sent to a destination.

NameRequiredTypeDescriptionDefault
MessageRefXStringA unique user-provided identifier that is used to identify the fax message. This can be used at a later point to retrieve the results of the fax message.
SendToXStringThe phone number the fax message will be sent to.
SendFromAlphanumeric StringA customisable string used to identify the sender of the fax. Also known as the Transmitting Subscriber Identification (TSID). The maximum string length is 32 charactersEmpty
DocumentsXArray of apiFaxDocumentEach FaxDocument object describes a fax document to be sent. Multiple documents can be defined here which will be concatenated and sent in the same message. See below for details.
ResolutionResolutionResolution setting of the fax document. Refer to the resolution table below for possible resolution values.normal
ScheduledStartTimeDateTimeThe date and time the transmission of the fax will start.Start now
BlocklistsBlocklistsThe blocklists that will be checked and filtered against before sending the message. See below for details. WARNING: This feature is inactive and non-functional in this (2.1) version of the Fax API.
RetriesUnsigned IntegerThe number of times to retry sending the fax if it fails. Each account has a maximum number of retries that can be changed by consultation with your account manager.Account Default
BusyRetriesUnsigned IntegerCertain fax errors such as “NO_ANSWER” or “BUSY” are not included in the above retries limit and can be set separately. Please consult with your account manager in regards to maximum value.account default
HeaderFormatStringAllows the header format that appears at the top of the transmitted fax to be changed. See below for an explanation of how to format this field.From: X, To: X
MustBeSentBeforeDateDateTimeSpecifies a time the fax must be delivered by. Once the specified time is reached the fax will be cancelled across the system.
MaxFaxPagesUnsigned IntegerSets a limit on the amount of pages allowed in a single fax transmission. Especially useful if the user is blindly submitting their customer's documents to the platform.20
CLIStringAllows a customer called ID. Note: Must be enabled on the account before it can be used.

MonopondDocument Properties

Represents a fax document to be sent through the system. Supported file types are: PDF, TIFF, PNG, JPG, GIF, TXT, PS, RTF, DOC, DOCX, XLS, XLSX, PPT, PPTX.

NameRequiredTypeDescriptionDefault
FileNameXStringThe document filename including extension. This is important as it is used to help identify the document MIME type.
FileDataXBase64The document encoded in Base64 format.
OrderXIntegerIf multiple documents are defined on a message this value will determine the order in which they will be transmitted.0
DocMergeDataAn Array of MergeFields
StampMergeDataAn Array of MergeFields

Resolution Levels

ValueDescription
normalNormal standard resolution (98 scan lines per inch)
fineFine resolution (196 scan lines per inch)

FaxDitheringTechnique

ValueFax Dithering Technique
noneNo dithering.
normalNormal dithering.
turboTurbo dithering.
darkenDarken dithering.
darken_moreDarken more dithering.
darken_extraDarken extra dithering.
lightenLighten dithering.
lighten_moreLighten more dithering.
crosshatchCrosshatch dithering.
DETAILEDDetailed dithering.

Header Format

Determines the format of the header line that is printed on the top of the transmitted fax message. This is set to **rom %from%, To %to%|%a %b %d %H:%M %Y”**y default which produces the following:

From TSID, To 61022221234 Mon Aug 28 15:32 2012 1 of 1

ValueDescription
%from%The value of the SendFrom field in the message.
%to%The value of the SendTo field in the message.
%aWeekday name (abbreviated)
%AWeekday name
%bMonth name (abbreviated)
%BMonth name
%dDay of the month as a decimal (01 – 31)
%mMonth as a decimal (01 – 12)
%yYear as a decimal (abbreviated)
%YYear as a decimal
%HHour as a decimal using a 24-hour clock (00 – 23)
%IHour as a decimal using a 12-hour clock (01 – 12)
%MMinute as a decimal (00 – 59)
%SSecond as a decimal (00 – 59)
%pAM or PM
%jDay of the year as a decimal (001 – 366)
%UWeek of the year as a decimal (Monday as first day of the week) (00 – 53)
%WDay of the year as a decimal (001 – 366)
%wDay of the week as a decimal (0 – 6) (Sunday being 0)
%%A literal % character

TODO: The default value is set to: “From %from%, To %to%|%a %b %d %H:%M %Y”

Blocklists Parameters

NameRequiredTypeDescription
smartblockfalsebooleanBlocks sending to a number if it has consistently failed in the past.
fpsfalsebooleanWash numbers against the fps blocklist.
dncrfalsebooleanWash numbers against the dncr blocklist.

About

Monopond Fax API PHP Client

Resources

Stars

3 stars

Watchers

17 watching

Forks

Releases

Packages

Contributors

Languages