To solve this, I have put together a very simple Javascript object that allows you to send SMS messages and make phone calls using Twilio. If you are unfamiliar with Twilio, they are a company that provides developers with an easy way to work telephony into their applications. Their API is extremely easy to use and their documentation is excellent.
In order to use this script, there are a few things you need to do. First, Sign Up for a Twilio Account. Once you do so, you should have a phone number that you can use to play around with as well as an Account SID and an Auth Token. Twilio might not be available in your country yet but hopefully they will be there soon. Make sure you are using the full phone numbers (including counry codes) when making your requests. If you are just using the free version, there may be usage limits but I'm not sure.
The code is set up so that it can be copied into any script where you need to send notifications. Once you've copied the Twilio object into your script, whenever you want the notification to be sent, you should add the following code:
... var sid = 'YOUR ACCOUNT SID GOES HERE'; var auth = 'YOUR AUTH TOKEN GOES HERE'; //First, create a new Twilio client var client = new Twilio(sid,auth); //Here is how you send a text message // First number is the receiver (most likely, your cell phone) // Second number is where is it coming from, which is the free number you got when // you registered in Twilio // The third parameter is what you want the text or voice message to say client.sendMessage('+17245551234','+14155554321','WARNING: Your AdWords Account Is Not Serving Ads.'); client.makeCall('+17245551234','+14155554321', 'This is an automated call to warn you that your AdWords account is no longer serving ads.'); ...
Of course, the sid, auth, and client can be global variables which would allow you to have a single line in your code to make phone calls or send messages. You could also set up some sort of escalation chain in case people miss the call or text.
This is just a simple example of starting to use UrlFetchApp to integrate AdWords scripts with 3rd party apps. If you have 3rd party apps you'd like me to try out, leave a note in the comments.
Thanks,
Russ
/********************************* * Twilio Client Library * Based on the Twilio REST API: https://www.twilio.com/docs/api/rest * Version 1.0 * Created By: Russ Savage * FreeAdWordsScripts.com *********************************/ function Twilio(accountSid, authToken) { this.ACCOUNT_SID = accountSid; this.AUTH_TOKEN = authToken; this.MESSAGES_ENDPOINT = 'https://api.twilio.com/2010-04-01/Accounts/'+this.ACCOUNT_SID+'/Messages.json'; this.CALLS_ENDPOINT = 'https://api.twilio.com/2010-04-01/Accounts/'+this.ACCOUNT_SID+'/Calls.json'; this.sendMessage = function(to,from,body) { var httpOptions = { method : 'POST', payload : { To: to, From: from, Body: body }, headers : getBasicAuth(this) }; var resp = UrlFetchApp.fetch(this.MESSAGES_ENDPOINT, httpOptions).getContentText(); return JSON.parse(resp)['sid']; } this.makeCall = function(to,from,whatToSay) { var url = 'http://proj.rjsavage.com/savageautomation/twilio_script/dynamicSay.php?alert='+encodeURIComponent(whatToSay); var httpOptions = { method : 'POST', payload : { To: to, From: from, Url: url }, headers : getBasicAuth(this) }; var resp = UrlFetchApp.fetch(this.CALLS_ENDPOINT, httpOptions).getContentText(); return JSON.parse(resp)['sid']; } function getBasicAuth(context) { return { 'Authorization': 'Basic ' + Utilities.base64Encode(context.ACCOUNT_SID+':'+context.AUTH_TOKEN) }; } }
Ramadan Wishes download
ReplyDeleteRamadan Wishes dua
Ramadan day Wishes
Ramadan greetings download
Ramadan greeting dua
Ramadan greeting design
Ramadan greeting design template
Ramadan greeting drawing
Ramadan Wishes video download
Ramadan Wishes english
Ramadan Wishes email
Ramadan Wishes eid mubarak
Ramadan Wishes edit name
Ramadan Wishes editable
Ramadan Wishes ecards
Ramadan eid Wishes in english
Ramadan eid Wishes in hindi
Ramadan end Wishes
Ramadan eid Wishes images
Ramadan e greeting cards
The marketing of the business should be done using a thoughtful approach. If you have low budget then with the help of the business text messaging apps and services, you can quickly connect with the potential customers. Even I am having great results with this method so would be suggesting it to others too.
ReplyDeleteThe 2 spam comments above scare me......Anyways, This is an awesome integration. Do you need a paid twillio account?
ReplyDeleteCheck this article https://admission-writer.com/blog/effective-and-simple-guidelines-on-how-to-write-winning-common-app-essays to know more about the common app essay!
ReplyDeleteIt is a great website.. The Design looks very good.. Keep working like that!. www.phonenumber-track.com
ReplyDeleteA high-quality mobile phone case is able to offer a great level of protection to the phone, which ensures it has a long and secure life. Phone cases come in a wide array of designs and styles to suit almost any taste. A pouch or holster in real-grain leather might be perfect for your needs, while others might prefer their case in the every popular neoprene material.
ReplyDeletePhone Covers
Who can do my excel homework ? I really don't like these calculations. It's not for me at all. It'll be pleasant if you find some ideas for me
ReplyDeleteWell, I agreed generally to try to register with the japanese mail order bride on this platform. Honestly, I didn't think this website might be helpful to me, but I can confess it's about this website, I have been really poor, and that's why you can now check my review. I only registered on line and I got several friendship inquiries instantly from very different girls in search of my love. I didn't go to any Park or something! So I asked one out, I was just shocked.
ReplyDeleteGood afternoon. I also decided to write a review about this service. Frankly speaking, it really managed to surprise me, because in comparison with other similar sites of dating this - the best of its kind, I really could not see a better site than this, where I could find my second half. romanian brides This site will always help you in finding your love, as they helped me at one time. The site is made in a very beautiful design, so also the functionality of this site well is very rich and just, the site was really able to amaze me pleasantly. I advise many single men this site!
ReplyDeleteI love your creativity. Are you also searching for engineering assignment help UK? we are the best solution for you. We are best known for delivering quality essay writing services to students without having to break the bank
ReplyDelete