Textit.biz Serving Sri Lanka since 2011.

Textit.biz SMS Gateway Integration

GOOGLE APPS SCRIPT

Send SMS with Google Apps Script and TextIt.biz


This page demonstrates how to integrate the TextIt.biz SMS gateway with Google Apps Script to send messages automatically.
By leveraging Google Apps Script, you can automate SMS notifications for reminders, alerts, and more.
This integration is useful for alerts, notifications, and automated messages.

function sendSms() {
  var id = "Textit.biz USER ID"; // Replace with your TextIt.biz User ID
  var password ="Textit.biz PASSWORD"  // Replace with your TextIt.biz Password
  var phoneNumber = "0772823050"; // Replace with the recipient's phone number 
  var message = "Hello, this is a test SMS from Google Apps Script!";
  
  var url = "https://textit.biz/sendmsg/index.php";
  
  var payload = {
    id: id,
    pw: password,
    to:phoneNumber,
    text: message
  };
  
  var options = {
    method: "post",
    payload: payload
  };
  
  try {
    var response = UrlFetchApp.fetch(url, options);
    Logger.log(response.getContentText());
  } catch (e) {
    Logger.log("Error sending SMS: " + e.toString());
  }
}