Closed sandeepreddy792 closed 3 years ago
Hello @sandeepreddy792
The following works with symphony-api-client-node version 1.1.2:
const Symphony = require('symphony-api-client-node');
const fs = require('fs');
Symphony.initBot('/path/to/config.json')
.then((symAuth) => {
Symphony.sendMessageWithAttachment('streamID',
'Hello',
null,
'spreadhseet.xlsx',
'application/octet-stream',
fs.createReadStream('/path/to/spreadsheet.xlsx'),
Symphony.MESSAGEML_FORMAT);
});
I have tried to convert JSON to Excel via "json2xls" module and send as excel file.
sample code:
var xls = json2xls(portfolios); Symphony.sendMessageWithAttachment( streamId, "Portfolio Excel", null, "portfolioTrades.xlsx", "application/vnd.ms-excel", xls, Symphony.MESSAGEML_FORMAT );
But when I download and open the file from Symphony, it is giving incorrect file format error.
What is the correct way to send data in Excel?