1.0.2 • Published 9 years ago
sfax-provider v1.0.2
sfax-provider
sfax-provider is a integration of node.js and sfax service
Notes
Library provide following interface
interface SfaxProvider {
sendFax
sendFaxFromURL
receiveOutboundFax
receiveInboundFax
downloadOutboundFaxAsTif
downloadInboundFaxAsTif
downloadOutboundFaxAsPdf
downloadInboundFaxAsPdf
}
You can found method description and some encrypt details using links:
Getting Started
npm install sfax-provider --save
You can send and receive faxes using following examples:
const path = require('path');
const fs = require('fs');
const SfaxProvider = require('sfax-provider');
const provider = new SfaxProvider({
"username": "yourSfaxUsername",
"password": "yourSfaxPassword",
"apiKey": "yourSfaxAPIKey",
"encryptionKey": "yourSfaxEncryptKey",
"initVector": "yourIV"
});
const printFiles = [
path.join(__dirname, 'print/text2.txt'),
path.join(__dirname, 'print/text1.txt')
];
const sendOptions = {
recipientName: 'Artur',
recipientFax: '15545683111'
};
provider.sendFax(printFiles, sendOptions, (err, body) => {
if (err) {
console.error(err);
throw err;
}
console.log('\nSent: ', body);
});
const receiveOptions = {
startDate: new Date('2017-01-01'),
endDate: new Date()
};
provider.receiveInboundFax(receiveOptions, (err, body) => {
if (err) {
console.error(err);
throw err;
}
console.log('\nInboundFax: ', JSON.parse(body).InboundFaxItems.length);
});
Check folder with examples (test example and callback-server example)
License
Copyright (c) 2016 archik Licensed under the MIT license.
1.0.2
9 years ago