To get started with the API, you need to create a byFax application and get the api-key and api-secret to authorize your application to the API.
As you implement your solution, you have a fully functional test environment at https://sandbox.byfax.biz
When your solution is complete, the base url for services changes to the production environment to https://api.byfax.biz
Besides requests to send a fax or obtain a list of received faxes, web-hooks for realtime events notification are available in API
uploaded document status
fax recipient status
fax container status
fax-number status
receiving a new fax
The complete SDK is already available for PHP developers. C # and Java developers can easily integrate SOAP services into their IDE with a couple of mouse clicks. Links to WSDL files can be found above, in the detailed description of each service.
Technical support service or real-time consultation via JivoSite is available for developers.
The application is authorized to the API using a special SOAP header that contains api-key and api-secret. The header is represented by a UsernameToken object.
The authorization header is passed in every request, the connection to the API has no sessions and no additional tokens.
$apiKey = "YOUR-API-KEY";
$apiSecret = "YOUR-API-SECRET";
$apiUrl = "https://sandbox.byfax.biz"; // Replace with https://api.byfax.biz for production
// Create "document " API service and pass API key-secret and url data
$serviceDoc = new \byfax\ApiServiceDocumentSoapClient($apiKey, $apiSecret, $apiUrl . "/document/");
string apiKey = "YOUR-API-KEY";
string apiSecret = "YOUR-API-SECRET";
string apiUrl = "https://sandbox.byfax.biz"; // Replace with https://api.byfax.biz for production
// Create "document" service object and fill base params
ApiServiceDocumentSoapClient serviceDoc = new ApiServiceDocumentSoapClient();
serviceDoc.Timeout = 2 * 60 * 1000;
serviceDoc.Url = apiUrl + "/document/";
// Create and fill auth token object
UsercustomerToken tokenAuth = new UsercustomerToken();
tokenAuth.Username = apiKey;
tokenAuth.Password = apiSecret;
// Apply auth token to service object
serviceDoc.UsernameTokenValue = tokenAuth;
Cover pages. List
Cover Pages are available for more personalized faxing in byFax. The system has already been loaded with a basic set of cover pages, which are available via API as well as in the byFax customer portal.
Both portal users and API developers in their applications have the ability to add own custom cover pages. The cover page is a DocX file with predefined placeholders that are replaced with the sender and recipient data during the sending process.
$apiKey = "YOUR-API-KEY";
$apiSecret = "YOUR-API-SECRET";
$apiUrl = "https://sandbox.byfax.biz"; // Replace with https://api.byfax.biz for production
// Create "cover" API service and pass API key-secret and url data
$serviceCover = new \byfax\ApiServiceCoverSoapClient($apiKey, $apiSecret, $apiUrl . "/cover/");
// call "listCovers" function and obtain response
$response = $serviceCover->listCovers();
// Check response state code for success and return false if failed
if ($response->stateCode != StateCodes::SUCCESS)
return false;
string apiKey = "YOUR-API-KEY";
string apiSecret = "YOUR-API-SECRET";
string apiUrl = "https://sandbox.byfax.biz"; // Replace with https://api.byfax.biz for production
// Create "cover" service object and fill base params
ApiServiceCover serviceCover = new ApiServiceCoverSoapClient();
serviceCover.Timeout = 2 * 60 * 1000;
serviceCover.Url = apiUrl + "/cover/";
// Create and fill auth token object
UsercustomerToken tokenAuth = new UsercustomerToken();
tokenAuth.Username = apiKey;
tokenAuth.Password = apiSecret;
// Apply auth token to service object
serviceCover.UsernameTokenValue = tokenAuth;
// call "listCovers" function and obtain response
ApiResponseListCovers response = serviceCover.listCovers();
// Check response state code for success and return false if failed
if (response.stateCode != StateCodes.SUCCESS)
return false;
Cover pages. Adding
To add a cover page, you should upload a DocX file to the system and setup its name.
$apiKey = "YOUR-API-KEY";
$apiSecret = "YOUR-API-SECRET";
$apiUrl = "https://sandbox.byfax.biz"; // Replace with https://api.byfax.biz for production
// Create "cover" API service and pass API key-secret and url data
$serviceCover = new \byfax\ApiServiceCoverSoapClient($apiKey, $apiSecret, $apiUrl . "/cover/");
$filename = "/path/to/user/cover.docx";
// Create and fill FaxFile object
$coverDoc = new \byfax\model\entity\common\FaxFile();
$coverDoc->fileSize = filesize($filename);
$coverDoc->fileCheck = md5_file($filename);
$coverDoc->fileName = basename($filename);
$coverDoc->fileMime = mime_content_type($filename);
$coverDoc->fileData = file_get_contents($filename); // Read file data without encoding to Base64
// Call Api function "addCover" to upload a new cover page
$response = $serviceCover->addCover("Test cover name", $coverDoc);
// Check response state code for success and return false if failed
if ($response->stateCode != StateCodes::SUCCESS)
return false;
// Store newly created cover page refID
$coverReference = response->objectRef;
string apiKey = "YOUR-API-KEY";
string apiSecret = "YOUR-API-SECRET";
string apiUrl = "https://sandbox.byfax.biz"; // Replace with https://api.byfax.biz for production
// Create "cover" service object and fill base params
ApiServiceCover serviceCover = new ApiServiceCoverSoapClient();
serviceCover.Timeout = 2 * 60 * 1000;
serviceCover.Url = apiUrl + "/cover/";
// Create and fill auth token object
UsercustomerToken tokenAuth = new UsercustomerToken();
tokenAuth.Username = apiKey;
tokenAuth.Password = apiSecret;
// Apply auth token to service object
serviceCover.UsernameTokenValue = tokenAuth;
string filename = "c:\\path\\to\\user\\cover.docx";
// Create and fill FaxFile object
FaxFile coverDoc = new FaxFile();
// Add your own helper to calculate file md5 checksum
coverDoc.fileCheck = HelperClass.CalcMD5File(filename).ToLower();
coverDoc.fileName = Path.GetFileName(filename);
coverDoc.fileSize = new System.IO.FileInfo(filename).Length;
// Important to set that "fileSize" property is specified
coverDoc.fileSizeSpecified = true;
// Read file data without encoding to Base64
coverDoc.fileData = File.ReadAllBytes(filename);
// Call Api function "addCover" to upload a new cover page
ApiResponseObject response = serviceCover.addCover("Test cover name", coverDoc);
if (response.stateCode != StateCodes.SUCCESS)
return false;
// Store newly created cover page refID
string coverReference = response.objectRef;
Preloading a document
In case the same file must be sent several times or to many recipients, the system provides the ability to upload a document and save it for further reuse.
$apiKey = "YOUR-API-KEY";
$apiSecret = "YOUR-API-SECRET";
$apiUrl = "https://sandbox.byfax.biz"; // Replace with https://api.byfax.biz for production
// Create "document " API service and pass API key-secret and url data
$serviceDoc = new \byfax\ApiServiceDocumentSoapClient($apiKey, $apiSecret, $apiUrl . "/document/");
$filename = "/path/to/user/file.pdf";
// Create and fill FaxDocument object
$uploadDoc = new \byfax\model\entity\common\FaxDocument();
$uploadDoc->documentFile = new \byfax\model\entity\common\FaxFile();
$uploadDoc->documentFile->fileSize = filesize($filename);
$uploadDoc->documentFile->fileCheck = md5_file($filename);
$uploadDoc->documentFile->fileName = basename($filename);
$uploadDoc->documentFile->fileMime = mime_content_type($filename);
$uploadDoc->documentFile->fileData = file_get_contents($filename); // Read file data without encoding to Base64
// Call Api function "uploadDocument" to upload a document to cache
$response = $serviceDoc->uploadDocument($uploadDoc);
// Check response state code for success and return false if failed
if ($response->stateCode != StateCodes::SUCCESS)
return false;
// Store uploaded document refID for firther use
$uploadedRef = $response->fileRef;
string apiKey = "YOUR-API-KEY";
string apiSecret = "YOUR-API-SECRET";
string apiUrl = "https://sandbox.byfax.biz"; // Replace with https://api.byfax.biz for production
// Create "document" service object and fill base params
ApiServiceDocumentSoapClient serviceDoc = new ApiServiceDocumentSoapClient();
serviceDoc.Timeout = 2 * 60 * 1000;
serviceDoc.Url = apiUrl + "/document/";
// Create and fill auth token object
UsercustomerToken tokenAuth = new UsercustomerToken();
tokenAuth.Username = apiKey;
tokenAuth.Password = apiSecret;
// Apply auth token to service object
serviceDoc.UsernameTokenValue = tokenAuth;
string filename = "c:\\path\\to\\user\\file.pdf";
// Create and fill FaxDocument object
FaxDocument uploadDoc = new FaxDocument();
uploadDoc.documentFile = new FaxFile();
// Add your own helper to calculate file md5 checksum
uploadDoc.documentFile.fileCheck = HelperClass.CalcMD5File(filename).ToLower();
uploadDoc.documentFile.fileName = Path.GetFileName(filename);
uploadDoc.documentFile.fileSize = new System.IO.FileInfo(filename).Length;
// Important to set that "fileSize" property is specified
uploadDoc.documentFile.fileSizeSpecified = true;
// Read file data without encoding to Base64
uploadDoc.documentFile.fileData = File.ReadAllBytes(filename);
// Call Api function "uploadDocument" to upload a document to cache
ApiResponseFileUpload response = serviceDoc.uploadDocument(uploadDoc);
if (response.stateCode != StateCodes.SUCCESS)
return false;
// Check response state code for success and return false if failed
if ($response->stateCode != StateCodes::SUCCESS)
return false;
// Store uploaded document refID for firther use
$uploadedRef = $response->fileRef;
Sending a fax (common submission way)
The system provides many options to pass to send fax request - loading documents directly within the request, using previously uploaded documents, using a cover page, submit fax in high or standard quality, submit fax in text or photo mode, submit fax for one or more documents in the request, submit fax for one or more recipients, setting your own fax header format, setting the number of retries in case the number is busy, etc. Below there is an example of using the most common options.
$apiKey = "YOUR-API-KEY";
$apiSecret = "YOUR-API-SECRET";
$apiUrl = "https://sandbox.byfax.biz"; // Replace with https://api.byfax.biz for production
// Create "faxout" API service and pass API key-secret and url data
$serviceFax = new \byfax\ApiServiceFaxoutSoapClient($apiKey, $apiSecret, $apiUrl . "/faxout/");
// Crate and fill fax submission request data
$submitRequest = new \byfax\model\request\faxout\ApiRequestFaxjobSubmit();
// Submission broadcast refID.
// Unique within your API account
// Should be unique for each submission
$submitRequest->broadcastRef = "myBroadcast-ref-1";
// Fax header format template
$submitRequest->Header = "<DateTime> <Timezone>|From: <From> To: <To>|Page <CurPage>of <CurPages>";
// Sender timezone
$submitRequest->Timezone = "Europe/Minsk";
// Number of reties in case of Busy or NoAnswer
$submitRequest->busyRetry = 3;
// Send quality. Available options are STANDARD or FINE. See the enumeration
$submitRequest->sendQuality = \byfax\enum\FaxQuality::FINE;
// Send mode. Available options are TEXT or PHOTO. See the enumeration
$submitRequest->sendMode = \byfax\enum\FaxMode::TEXT;
// Cover page if needed to add to fax, skip otherwise. Use listCovers to obtain a cover RefID.
$submitRequest->Cover = new \byfax\model\entity\cover\FaxCover();
$submitRequest->Cover->coverRef = "COVER_PAGE_REF_ID";
// Sender identification. At least one of properties is required
$submitRequest->Sender = new \byfax\model\entity\common\FaxContact();
$submitRequest->Sender->Name = "My sender name";
$submitRequest->Sender->Company = "My sender company";
$submitRequest->Sender->Number = "+375 99 111111111";
// Recipient object. Number and Name/Company are required.
$submitRecipient = new \byfax\model\entity\common\FaxRecipient();
$submitRecipient->messageRef = "myFaxMessage-ref-1";
$submitRecipient->Name = "Recipient name";
$submitRecipient->Company = "Recipient company";
$submitRecipient->Number = "+375 99 111111122";
// Push recipient object to array and create another if it is a batch job
$submitRequest->Recipients[] = $submitRecipient;
// Document object with previously uploaded file.
$submitDoc = new \byfax\model\entity\common\FaxDocument();
$submitDoc->documentRef = $uploadedRef;
// Push document object into the array. Add another one if needed.
$submitRequest->Documents[] = $submitDoc;
$filename = "/path/to/user/file.pdf";
// Document object with a file to upload within exact fax submission.
$submitDoc = new \byfax\model\entity\common\FaxDocument();
$submitDoc->documentFile = new \app\components\byfax\model\entity\common\FaxFile();
$submitDoc->documentFile->fileSize = filesize($filePath);
$submitDoc->documentFile->fileCheck = md5_file($filePath);
$submitDoc->documentFile->fileName = basename($filePath);
$submitDoc->documentFile->fileMime = mime_content_type($filePath);
$submitDoc->documentFile->fileData = file_get_contents($filePath);
// Push document object into the array.
$submitRequest->Documents[] = $submitDoc;
// Call "Submit" API function to push fax into the queue
$response = $serviceFax->Submit($submitRequest);
// Check response state code for success and return false if failed
if ($response->stateCode != StateCodes::SUCCESS)
return false;
// Create and fill check-state request for a single recipient
$checkRequest = new \byfax\model\request\faxout\ApiRequestFaxjobListMessages();
$checkRequest->messageRefs[] = $response->reportRecipients[0]->messageRef;
// Add and fill pagination data
$checkRequest->pagination = new \byfax\model\entity\common\ListPagination();
$checkRequest->pagination->pageNumber = 0;
$checkRequest->pagination->pageSize = 10;
// Call "listRecipients" API function to obtain recipients status
$checkResponse = $serviceFaxout->listRecipients($checkRequest);
// Check response state code for success and return false if failed
if ($checkResponse->stateCode != StateCodes::SUCCESS)
return false;
// Obtain and store recipient status
$recipientStatus = $checkResponse->Messages[0]->jobState;
string apiKey = "YOUR-API-KEY";
string apiSecret = "YOUR-API-SECRET";
string apiUrl = "https://sandbox.byfax.biz"; // Replace with https://api.byfax.biz for production
// Create "faxout" service object and fill base params
ApiServiceFaxoutSoapClient serviceFax = new ApiServiceFaxoutSoapClient();
serviceFax.Timeout = 2 * 60 * 1000;
serviceFax.Url = apiUrl + "/faxout/";
// Create and fill auth token object
UsercustomerToken tokenAuth = new UsercustomerToken();
tokenAuth.Username = apiKey;
tokenAuth.Password = apiSecret;
// Apply auth token to service object
serviceFax.UsernameTokenValue = tokenAuth;
// Crate and fill fax submission request data
ApiRequestFaxjobSubmit submitRequest = new ApiRequestFaxjobSubmit();
// Submission broadcast refID.
// Unique within your API account
// Should be unique for each submission
submitRequest.broadcastRef = "myBroadcast-ref-1";
// Fax header format template
submitRequest.Header = "<DateTime> <Timezone>|From: <From> To: <To>|Page <CurPage>of <CurPages>";
// Sender timezone
submitRequest.Timezone = "Europe/Minsk";
// Number of reties in case of Busy or NoAnswer
submitRequest.busyRetry = 3;
// Send quality. Available options are STANDARD or FINE. See the enumeration
submitRequest.sendQuality = FaxQuality.FINE;
// Send mode. Available options are TEXT or PHOTO. See the enumeration
submitRequest.sendMode = FaxMode.TEXT;
// Cover page if needed to add to fax, skip otherwise. Use listCovers to obtain a cover RefID.
FaxCover submitRequest.Cover = new FaxCover();
submitRequest.Cover.coverRef = "COVER_PAGE_REF_ID";
// Sender identification. At least one of properties is required
submitRequest.Sender = new FaxContact();
submitRequest.Sender.Name = "My sender name";
submitRequest.Sender.Company = "My sender company";
submitRequest.Sender.Number = "+375 99 111111111";
List<FaxRecipient> listRecipients = new List<FaxRecipient>();
// Recipient object. Number and Name/Company are required.
FaxRecipient submitRecipient = new FaxRecipient();
submitRecipient.messageRef = "myFaxMessage-ref-1";
submitRecipient.Name = "Recipient name";
submitRecipient.Company = "Recipient company";
submitRecipient.Number = "+375 99 111111122";
// Push recipient object to array and create another if it is a batch job
listRecipients.Add(submitRecipient);
// Save recipients array into the request data
submitRequest.Recipients = listRecipients.ToArray();
List<FaxDocument> listDocuments = new List<FaxDocument>();
// Document object with previously uploaded file.
FaxDocument submitDoc = new FaxDocument();
submitDoc.documentRef = uploadedRef;
// Push document object into the array. Add another one if needed.
listDocuments.Add(submitDoc);
$filename = "/path/to/user/file.pdf";
// Document object with a file to upload within exact fax submission.
FaxDocument submitDoc = new FaxDocument();
submitDoc.documentFile = new FaxFile();
uploadDoc.documentFile.fileCheck = HelperClass.CalcMD5File(filename).ToLower();
uploadDoc.documentFile.fileName = Path.GetFileName(filename);
uploadDoc.documentFile.fileSize = new System.IO.FileInfo(filename).Length;
uploadDoc.documentFile.fileSizeSpecified = true;
uploadDoc.documentFile.fileData = File.ReadAllBytes(filename);
// Push document object into the array.
listDocuments.Add(submitDoc);
// Save documents array into the request data
submitRequest.Documents = listDocuments.ToArray();
// Call "Submit" API function to push fax into the queue
$response = serviceFax.Submit(submitRequest);
// Check response state code for success and return false if failed
if (response.stateCode != StateCodes.SUCCESS)
return false;
// Fill list of recipients to check status for
List<string> listCheck = new List<string>();
listCheck.Add(response.reportRecipients[0].messageRef);
// Create and fill check status request object
ApiRequestFaxjobListMessages checkRequest = new ApiRequestFaxjobListMessages();
// Add and fill pagination data
checkRequest.pagination = new ListPagination();
checkRequest.pagination.pageNumber = 0;
checkRequest.pagination.pageSize = 10;
checkRequest.messageRefs = t_list.ToArray();
// Call "listRecipients" API function to obtain recipients status
ApiResponseFaxjobMessages checkResponse = serviceFax.listRecipients(checkRequest);
// Check response state code for success and return false if failed
if (checkResponse.stateCode != StateCodes::SUCCESS)
return false;
// Obtain and store recipient status
recipientStatus = checkResponse.Messages[0].jobState;
Sending a fax (prepared TIFF submission)
This method was specifically designed to send a prepared TIFF file to a single recipient. The method is used only if the TIFF file is prepared on the application`s side and it must be sent without going through the byFax document preparation system. Using this method application should pass only the following data, sender details (Sender object), recipient details (Recipient object), the unique identifier of the container (broadcastRef parameter) and the prepared TIFF file (document object). The full text of the fax header could also be passed to be placed at the top of the page. If the header is already placed to all pages of the document, then the header parameter is passed as empty string. Here is an example of using this function.
$apiKey = "YOUR-API-KEY";
$apiSecret = "YOUR-API-SECRET";
$apiUrl = "https://sandbox.byfax.biz"; // Replace with https://api.byfax.biz for production
// Create "faxout" API service and pass API key-secret and url data
$serviceFax = new \byfax\ApiServiceFaxoutSoapClient($apiKey, $apiSecret, $apiUrl . "/faxout/");
// Crate and fill fax submission request data
$submitRequest = new \byfax\model\request\faxout\ApiRequestFaxjobMessage();
// Submission broadcast refID.
// Unique within your API account
// Should be unique for each submission
$submitRequest->broadcastRef = "myBroadcast-ref-1";
// Submission message refID.
// Unique within your API account
// Should be unique for each recipient withn the entire account
// If it is passed as empty string, system will generate it
$submitRequest->messageRef = "myFaxMessage-ref-1";
// Fax header format template
$submitRequest->Header = "<DateTime> <Timezone>|From: <From> To: <To>|Page <CurPage>of <CurPages>";
// Sender timezone
$submitRequest->Timezone = "Europe/Minsk";
// Number of reties in case of Busy or NoAnswer
$submitRequest->busyRetry = 3;
// Sender identification. At least one of properties is required
$submitRequest->Sender = new \byfax\model\entity\common\FaxContact();
$submitRequest->Sender->Name = "My sender name";
$submitRequest->Sender->Company = "My sender company";
$submitRequest->Sender->Number = "+375 99 111111111";
// Recipient object. Number and Name/Company are required.
$submitRequest->Recipient = new \byfax\model\entity\common\FaxContact();
$submitRequest->Recipient->Name = "Recipient name";
$submitRequest->Recipient->Company = "Recipient company";
$submitRequest->Recipient->Number = "+375 99 111111122";
$filename = "/path/to/user/file.pdf";
// Document object with a file to upload within exact fax submission.
$submitRequest->Document = new \byfax\model\entity\common\FaxDocument();
$submitRequest->Document->documentFile = new \app\components\byfax\model\entity\common\FaxFile();
$submitRequest->Document->documentFile->fileSize = filesize($filePath);
$submitRequest->Document->documentFile->fileCheck = md5_file($filePath);
$submitRequest->Document->documentFile->fileName = basename($filePath);
$submitRequest->Document->documentFile->fileMime = mime_content_type($filePath);
$submitRequest->Document->documentFile->fileData = file_get_contents($filePath);
// Call "SubmitMessage" API function to push fax into the queue
$response = $serviceFax->SubmitMessage($submitRequest);
// Check response state code for success and return false if failed
if ($response->stateCode != StateCodes::SUCCESS)
return false;
// Create and fill check-state request for a single recipient
$checkRequest = new \byfax\model\request\faxout\ApiRequestFaxjobListMessages();
$checkRequest->messageRefs[] = $response->reportRecipients[0]->messageRef;
// Add and fill pagination data
$checkRequest->pagination = new \byfax\model\entity\common\ListPagination();
$checkRequest->pagination->pageNumber = 0;
$checkRequest->pagination->pageSize = 10;
// Call "listRecipients" API function to obtain recipients status
$checkResponse = $serviceFaxout->listRecipients($checkRequest);
// Check response state code for success and return false if failed
if ($checkResponse->stateCode != StateCodes::SUCCESS)
return false;
// Obtain and store recipient status
$recipientStatus = $checkResponse->Messages[0]->jobState;
string apiKey = "YOUR-API-KEY";
string apiSecret = "YOUR-API-SECRET";
string apiUrl = "https://sandbox.byfax.biz"; // Replace with https://api.byfax.biz for production
// Create "faxout" service object and fill base params
ApiServiceFaxoutSoapClient serviceFax = new ApiServiceFaxoutSoapClient();
serviceFax.Timeout = 2 * 60 * 1000;
serviceFax.Url = apiUrl + "/faxout/";
// Create and fill auth token object
UsercustomerToken tokenAuth = new UsercustomerToken();
tokenAuth.Username = apiKey;
tokenAuth.Password = apiSecret;
// Apply auth token to service object
serviceFax.UsernameTokenValue = tokenAuth;
// Crate and fill fax submission request data
ApiRequestFaxjobSubmit submitRequest = new ApiRequestFaxjobMessage();
// Submission broadcast refID.
// Unique within your API account
// Should be unique for each submission
submitRequest.broadcastRef = "myBroadcast-ref-1";
// Submission message refID.
// Unique within your API account
// Should be unique for each recipient withn the entire account
// If it is passed as empty string, system will generate it
submitRequest.messageRef = "myFaxMessage-ref-1";
// Fax header format template
submitRequest.Header = "<DateTime> <Timezone>|From: <From> To: <To>|Page <CurPage>of <CurPages>";
// Sender timezone
submitRequest.Timezone = "Europe/Minsk";
// Number of reties in case of Busy or NoAnswer
submitRequest.busyRetry = 3;
// Sender identification. At least one of properties is required
submitRequest.Sender = new FaxContact();
submitRequest.Sender.Name = "My sender name";
submitRequest.Sender.Company = "My sender company";
submitRequest.Sender.Number = "+375 99 111111111";
// Recipient object. Number and Name/Company are required.
submitRequest.Recipient = new FaxContact();
submitRequest.Recipient.Name = "Recipient name";
submitRequest.Recipient.Company = "Recipient company";
submitRequest.Recipient.Number = "+375 99 111111122";
$filename = "/path/to/user/file.pdf";
// Document object with a file to upload within exact fax submission.
submitRequest.Document = new FaxDocument();
submitRequest.Document.documentFile = new FaxFile();
submitRequest.Document.documentFile.fileCheck = HelperClass.CalcMD5File(filename).ToLower();
submitRequest.Document.documentFile.fileName = Path.GetFileName(filename);
submitRequest.Document.documentFile.fileSize = new System.IO.FileInfo(filename).Length;
submitRequest.Document.documentFile.fileSizeSpecified = true;
submitRequest.Document.documentFile.fileData = File.ReadAllBytes(filename);
// Call "SubmitMessage" API function to push fax into the queue
$response = serviceFax.SubmitMessage(submitRequest);
// Check response state code for success and return false if failed
if (response.stateCode != StateCodes.SUCCESS)
return false;
// Fill list of recipients to check status for
List<string> listCheck = new List<string>();
listCheck.Add(response.reportRecipients[0].messageRef);
// Create and fill check status request object
ApiRequestFaxjobListMessages checkRequest = new ApiRequestFaxjobListMessages();
// Add and fill pagination data
checkRequest.pagination = new ListPagination();
checkRequest.pagination.pageNumber = 0;
checkRequest.pagination.pageSize = 10;
checkRequest.messageRefs = t_list.ToArray();
// Call "listRecipients" API function to obtain recipients status
ApiResponseFaxjobMessages checkResponse = serviceFax.listRecipients(checkRequest);
// Check response state code for success and return false if failed
if (checkResponse.stateCode != StateCodes::SUCCESS)
return false;
// Obtain and store recipient status
recipientStatus = checkResponse.Messages[0].jobState;
Still have questions?
If you still have any questions, or the samples above are not informative enough, you are able get more detailed information about API functions, objects and enumerations in the detailed description of each service (links can be found above), you can also contact us via helpdesk or JivoSite. We are always glad to hear suggestions and ideas for expanding or improving both the byFax API and our entire product.
At the moment, only the basic functionality of the byFax portal is available in our open API, if you need to expand the capabilities or add fundamentally new functions, we are always happy to discuss.
If you are a Python, Java, Ruby, Go or other programming language developer and would like to help improving the byFax API SDK, we will be glad to have your help developing SDKs in other languages.