Google Appscript Sample Code Send SMS
Code:
//write this code in your .gs file
//Your authentication key
var authKey = "YourAuthKey";
//Multiple mobiles numbers separated by comma
var mobileNumber = "9999999";
//Sender ID,While using route4 sender id should be 6 characters long.
var senderId = "102234";
//Your message to send, Add URL encoding here.
var message = "Test message";
//Define route
var route = "default";
var payload = {
"authkey": authKey,
'mobiles' : mobileNumber,
'message' : message,
'sender' : senderId,
'route' : route
};
var options = {
"method": "post",
"payload": payload
};
var res = UrlFetchApp.fetch("https://control.msg91.com/api/sendhttp.php?", options);
var resAsTxt = '' + res + '';
Logger.log(resAsTxt)