Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear all,
Does anyone implement sending sms from Qliksense? If yes can you share a sample demo?
Thanks
Vikas
Hello Vikas,
if you're familiar with Twilio you can use this small extension:
define(["qlik"], function (qlik) {
return {
definition: {
type: "items",
component: "accordion",
items: {
appearance: {
uses: "settings",
items: { }
}
}
},
isBusy: false,
paint: function ($element, layout) {
var self = this;
var twilioConfig = {
sid : 'YOUR TWILIO SID',
token: 'YOUR TWILIO TOKEN',
fromNumber: '"YOUR TWILIO PHONE NUMBER"' // e.g. "+43123567"
};
var messageBody = '"TEST SENSE SMS MESSAGE"'; // message body
var toNumber = '"TO NUMBER"'; // e.g. "+4398764541"
$.ajax({
url: 'https://api.twilio.com/2010-04-01/Accounts/' + twilioConfig.sid + '/Messages',
method: 'POST',
contentType: "application/x-www-form-urlencoded",
data: {
From: twilioConfig.fromNumber,
To: toNumber,
Body: messageBody
},
beforeSend: function (xhr) {
xhr.setRequestHeader ("Authorization", "Basic " + btoa(twilioConfig.sid + ":" + twilioConfig.token));
},
completed: function(r){
console.log(r);
}
});
$element.html('<h1>loaded</h1>')
}
}
});
Mathias
Can you please specify the steps and briefly explain it
How this script is generated.
This code is showing error, so can you please explain any other way.