1const axios = require('axios'); 2const OutboxApiFp = require('@alohi/faxplus-api').OutboxApiFp; 3const Configuration = require('@alohi/faxplus-api').Configuration; 4 5const config = new Configuration({ 6 accessToken: accessToken, 7 basePath: 'https://restapi.fax.plus/v3', 8 // Header required only when using the OAuth2 token scheme 9 baseOptions: { 10 headers: { 11 "x-fax-clientid": clientId, 12 } 13 } 14}); 15 16async function sendFax() { 17 const reqParams = { 18 "userId": '13d8z73c', 19 "payloadOutbox": { 20 "comment": { 21 "tags": [ 22 "tag1", 23 "tag2" 24 ], 25 "text": "text comment" 26 }, 27 "files": [ 28 "filetosend.pdf" 29 ], 30 "from": "+12345667", 31 "options": { 32 "enhancement": true, 33 "retry": { 34 "count": 2, 35 "delay": 15 36 } 37 }, 38 "send_time": "2000-01-01 01:02:03 +0000", 39 "to": [ 40 "+12345688", 41 "+12345699" 42 ], 43 "return_ids": true 44 } 45 } 46 const req = await OutboxApiFp(config).sendFax(reqParams); 47 const resp = await req(axios); 48} 49 50sendFax()