envio
// Instalação da biblioteca
// npm install comtele-sdk
const TextMessageService = require(‘comtele-sdk’).TextMessageService;
const apiKey = ‘XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX’;
var textMessageService = new TextMessageService(apiKey);
textMessageService.send(‘Sender’, ‘Content’, [‘Receivers’], data => console.log(data));
agendamento
// Instalação da biblioteca
// npm install comtele-sdk
const TextMessageService = require(‘comtele-sdk’).TextMessageService;
const apiKey = ‘XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX’;
var textMessageService = new TextMessageService(apiKey);
textMessageService.schedule(‘Sender’, ‘Content’, ‘ScheduleDate’,[‘Receivers’], data => console.log(data));
relatório detalhado
// Instalação da biblioteca
// npm install comtele-sdk
const TextMessageService = require(‘comtele-sdk’).TextMessageService;
const apiKey = ‘XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX’;
var textMessageService = new TextMessageService(apiKey);
textMessageService.getDetailedReport(‘StartDate’, ‘EndDate’, textMessageService.DeliveryStatus.ALL, data => console.log(data));
autenticação 2FA
// Instalação da biblioteca
// npm install comtele-sdk
const TextMessageService = require(‘comtele-sdk’).TextMessageService;
const apiKey = ‘XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX’;
var tokenService = new TokenService(apiKey);
tokenService.sendToken(‘PhoneNumber’, ‘Prefix’, data => console.log(data));
validação 2FA
// Instalação da biblioteca
// npm install comtele-sdk
const TextMessageService = require(‘comtele-sdk’).TextMessageService;
const apiKey = ‘XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX’;
var tokenService = new TokenService(apiKey);
tokenService.validateToken(‘TokenCode’, data => console.log(data));