Send SMS using apps script/ google script - fast2sms API - CodyLab

There are many SMS provider companies availabale like textlocal.in, twilio.com etc , But, I am here going to tell you how can you use fast2sms API in

Send SMS using apps script/ google script - fast2sms API 

Friends, we are going to tell you about SMS API impliment in apps script/ google script.

        There are many SMS provider companies availabale like textlocal.in, twilio.com etc,  But, I am here going to tell you how can you use fast2sms API in your apps script /google script web app and send sms by mannually or automation flows. 

  To get this done, we should need  Fast2Sms API

          If you already have got Fast2sms API, move to step 1 else see: How to get Fast2SMS API?
            Friends first of all go to Fast2sms.com and sign up or if you already signed up, got your api key from fast2sms dashboard.

 You got some Rupees as bonus that you can use for testing that it's really works or not.
Step-1
After getting your API from Fast2Sms.com,  make a copy of following code.

function sendSMS() {
       // sms : SMS Body, content information you want to send.
  var sms ="Your SMS goes here.";
      // cont : content the contact numbers without contry code or 0.
      // seprate each number by comma.
  var cont ="1234567890,9876543210";
     //apiv: content your fast2sms api key.
  var apiv ="paste your api here";//
     //Don't make any change in following code.
  var sen_Id = "TXTIND";
  var url = "https://www.fast2sms.com/dev/bulkV2?authorization="+apiv+"&sender_id="+sen_Id+"&message="+sms+"&route=v3&numbers="+cont+"";
 var options = {
  "async": true,
  "crossDomain": true,
  "method": "GET"
}
  var response = UrlFetchApp.fetch(url, options);
 Logger.log(response.getContentText());
}  
    

Step-2
Now, Move to script.google.com And Click + Icon Create new Project Button.


Step-3
Now Paste your code like following example.
And rename your Project .

//Don't forget to paste your fast2Sms API code.
// Replace the mobile number
Now tap on Run function  to see result.
CodyLab Blogger CodyLab Blogger
                                                                             Have a nice day!
-------------------------- -------------------------
-------------------------- -------------------------

12 comments

  1. if we want send data from our spreadsheet with template ??
  2. Yes, you can send data from your spreadsheet with template.
    To get this done, you can see this post
    https://appsscriptlab.blogspot.com/2021/09/bulk-sms-apps-script-send-bulk-sms-by.html
    1. is it not be send sms without html???
    2. If you want to send sms without html, you must have to set apps script trigger. It is better if you work with the automation flows.
  3. Thanks. It's really useful for me.
    1. thanks
  4. Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. ajp150
  5. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. sms activation
    1. Thanks for your positive feedback
  6. Most of the time I don’t make comments on websites, but I'd like to say that this article really forced me to do so. Really nice post! sms activation
  7. Thanks
  8. Very efficiently written information. It will be beneficial to anybody who utilizes it, including me. Keep up the good work. For sure i will check out more posts. This site seems to get a good amount of visitors. 4 letter brands for sale
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.