From Jeff Sasse, 3 Years ago, written in Plain Text.
- view diff
Embed
  1. function testSms() {
  2. var SW_PHONE = '14231212121';            //
  3. var SW_TO = '14233434343';               //
  4. var SW_MSG = 'Test SMS on Signalwire';   //
  5. var SW_IMG = '';                         //
  6.                                          //
  7. var SW_SPACE = 'https://ezrds.signalwire.com/api/relay/rest/';                        //
  8. var SW_PROJ = '869728dc-0123-4567-8901-234567890123';
  9. var SW_TOKEN = 'abcdefghijklmnopqrstuvwxyz';                       //
  10.  
  11.   try {
  12.     var status = UrlFetchApp.fetch(SW_SPACE, {
  13.       method: 'post',
  14.       headers: { Authorization: 'Basic ' + Utilities.base64Encode(SW_PROJ + ":" + SW_TOKEN)},
  15.       payload: {
  16.         To: SW_TO.toString(),
  17.         From: SW_PHONE,
  18.         Body: SW_MSG,
  19.       },
  20.     });
  21.     return 'sent: ' + new Date();
  22.   }
  23.   catch (err) {
  24.     return 'error: ' + err;
  25.   }
  26.   Browser.msgBox(status);
  27. }

Replies to Untitled rss

Title Name Language When
Re: Untitled Jeff Sasse text 3 Years ago.