1 Reply Latest reply: Sep 5, 2017 5:31 AM by Mathias Schindler RSS

    How to send SMS  from Qliksense?

    vikas mahajan

      Dear all,

      Does anyone implement sending sms from Qliksense? If yes can you share a sample demo?

       

      Thanks

       

      Vikas

        • Re: How to send SMS  from Qliksense?
          Mathias Schindler

          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