Skip to content

Instantly share code, notes, and snippets.

@zengfenfei
Created May 22, 2017 07:31
Show Gist options
  • Save zengfenfei/03d7e25e3516f7118687280c6b18753b to your computer and use it in GitHub Desktop.
Save zengfenfei/03d7e25e3516f7118687280c6b18753b to your computer and use it in GitHub Desktop.
import * as fs from "fs";
// Builds the url: '/account/~/extension/~/fax', and make a POST request to it
rc.account().extension().fax().post({
to: [{ phoneNumber: "{receiverPhoneNumber}" }],
faxResolution: 'High'
}, [ // Second argument is an array of attachments, attachment can be string, Blob, node readable stream.
"{Message text}",
fs.createReadStream("{filePath}") // In node only
]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment