Example:
  Twilio.connect('my_twilio_sid', 'my_auth_token')
  Twilio::Sms.message(CALLER_ID, user_number, 'This is my simple SMS message', 'http://example.com/sms_callback')
178970
def message(from, to, body, callback_url=nil)
      callback = callback_url ? {:StatusCallback => callback_url} : {}
      Twilio.post("/SMS/Messages", :body => {:From => from, :To => to, :Body => body}.merge(callback))
    end
712362
def signup_or_login_with_mobile_phone(cls, phone_number, sms_code):
        '''
        
        '''
        data = {
            'mobilePhoneNumber': phone_number,
            'smsCode': sms_code
        }
        response = client.post('/usersByMobilePhone', data)
        content = response.json()
        user = cls()
        user._update_data(content)
        user._handle_save_result(True)
        if 'smsCode' not in content:
            user._attributes.pop('smsCode', None)
        return user
1141969
def make(from, to, url, opts = {})
      Twilio.post("/Calls", :body => {:From => from, :To => to, :Url => url}.merge(opts))
    end
635748
def send(message, options = {})
      message_format = options[:message_format] ? options[:message_format] : 'text'
      notify         = options[:notify]         ? options[:notify]         : false

      response = self.class.post(@api.send_config[:url],
                                 :query => { :auth_token => @token },
                                 :body => {
                                     :message => message,
                                     :message_format => message_format,
                                     :notify => notify
                                 }.send(@api.send_config[:body_format]),
                                 :headers => @api.headers
      )
      ErrorHandler.response_code_to_exception_for :user, user_id, response
      true
    end
613731
function sendText(payload: {
  to: string,
  from: string,
  message: string,
  statusCallback: string,
}): Promise<null | TwilioResponse> {
  if (!(process.env.TWILIO_ACCOUNT_SID && process.env.TWILIO_AUTH_TOKEN)) {
    logErr(
      new Error(
        "Could not send text message, missing required Twilio env vars"
      ),
      { payload }
    );
    return Promise.resolve(null);
  } else if (!Twilio) {
    Twilio = require("twilio");
  }

  return new Twilio(
    process.env.TWILIO_ACCOUNT_SID,
    process.env.TWILIO_AUTH_TOKEN
  ).messages.create({
    to: `+1${payload.to}`,
    from: `+1${payload.from}`,
    body: payload.message,
    statusCallback: payload.statusCallback,
  });
}
1321393
function(callback) {
                var deviceId;

                var params = {
                    url: SERVICE_ADDRESSES.SSO_ADDRESS + SERVICES_PATH.SSO_DEVICES,
                    method: 'GET',
                    headers: {
                        'Authorization': 'Bearer ' + token
                    }
                };

                httpRequest(params, function(result) {
                    if (!result.hasError) {
                        var devices = JSON.parse(result.result.responseText).devices;
                        if (devices && devices.length > 0) {
                            for (var i = 0; i < devices.length; i++) {
                                if (devices[i].current) {
                                    deviceId = devices[i].uid;
                                    break;
                                }
                            }

                            if (!deviceId) {
                                fireEvent('error', {
                                    code: 6000,
                                    message: CHAT_ERRORS[6000],
                                    error: null
                                });
                            }
                            else {
                                callback(deviceId);
                            }
                        }
                        else {
                            fireEvent('error', {
                                code: 6001,
                                message: CHAT_ERRORS[6001],
                                error: null
                            });
                        }
                    }
                    else {
                        fireEvent('error', {
                            code: result.errorCode,
                            message: result.errorMessage,
                            error: result
                        });
                    }
                });
            }
775953
def telegram(self, client_key=None, tgid=None, key=None):
        
        return Telegram(self, client_key, tgid, key)
714252
def post_message(params)
      self.class.post('/chat.postMessage', body: params.merge({token: @token})).tap do |response|
        raise "error posting message: #{response.fetch('error', 'unknown error')}" unless response['ok']
      end
    end
53869
def send_sms(self, message, to, sender='elkme', options=[]):
        """"""
        sms = self.format_sms_payload(message=message,
            to=to,
            sender=sender,
            options=options)
        return self.query_api(sms)
230392
def say(connection, text="", options={})
      @connection = connection
      #formatter = options[:formatter] || BasicFormatter
      #text      = format_text(formatter, text)
      #TODO: fix law of demeter violations
      request      = Net::HTTP::Post.new(service_url)
      request.body = encode_message(text, options)
      response     = connection.http_request(request)
      if response.code != "200"
        raise Slackr::ServiceError, "Slack.com - #{response.code} - #{response.body}"
      end
    end
286666
def index(request):
    session = Session(request.body)
    print 'request.body begin'
    print request.body
    print 'request.body end'
    t = Tropo()
    smsContent = session.initialText
    #t.call(to=session.parameters['callToNumber'], network='SIP')
    #t.say(session.parameters['message'])
    
    #base_url = 'http://192.168.26.21:8080/gateway/sessions'
    base_url = 'https://api.tropo.com/1.0/sessions'
    #token = '4c586866434c4c59746f4361796b634477600d49434d434874584d4546496e70536c706749436841476b684371'		# Insert your token here  Application ID: 301
    token = '6c77565670494a6b474f646a5658436b514658724a0055674f4e735041764f665463626b535472616869746768'		# Insert your fire-app-with-token.py token here
    action = 'create'
    #number = 'sip:xiangjun_yu@10.140.254.55:5678'	# change to the Jabber ID to which you want to send the message
    #number = 'sip:frank@172.16.22.128:5678'	# change to the Jabber ID to which you want to send the message
    #number = '+861891020382'	# change to the Jabber ID to which you want to send the message
    number = '+86134766549249'	# change to the Jabber ID to which you want to send the message
    message = 'redirect by Python content is ' + str(smsContent)
    
    params = urlencode([('action', action), ('token', token), ('callToNumber', number), ('message252121', message)])
    data = urlopen('%s?%s' % (base_url, params)).read()
    
    print 'data is '
    print data
    #return t.RenderJson()
    return "receive SMS successfully"
256325
def send_sms_message(sms_message, backend=None, fail_silently=False):
	
	with get_sms_connection(backend=backend, fail_silently=fail_silently) as connection:
		result = connection.send_messages([sms_message])
	return result
307841
def get_message(self, level, alert, value, **kwargs):
        
        target, ntype = kwargs.get('target'), kwargs.get('ntype')

        msg_type = 'telegram' if ntype == 'graphite' else 'short'
        tmpl = TEMPLATES[ntype][msg_type]
        generated = tmpl.generate(
            level=level, reactor=self.reactor, alert=alert,
            value=value, target=target,)
        return generated.decode().strip()
1209990
def notify_user(self, msg, level="info", rate_limit=5, title=None, icon=None):
        
        module_name = self._module.module_full_name
        if isinstance(msg, Composite):
            msg = msg.text()
        if title is None:
            title = "py3status: {}".format(module_name)
        elif isinstance(title, Composite):
            title = title.text()
        # force unicode for python2 str
        if self._is_python_2:
            if isinstance(msg, str):
                msg = msg.decode("utf-8")
            if isinstance(title, str):
                title = title.decode("utf-8")
        if msg:
            self._py3_wrapper.notify_user(
                msg=msg,
                level=level,
                rate_limit=rate_limit,
                module_name=module_name,
                title=title,
                icon=icon,
            )
504396
def _python_psk_client_callback(ssl_id, hint):
    
    if ssl_id not in _callbacks:
        return ("", "")
    else:
        res = _callbacks[ssl_id](hint)
        return res if isinstance(res, tuple) else (res, "")
1001384
function TwilioConnector(settings) {

    assert(typeof settings === 'object', 'cannot initialize TwilioConnector without a settings object');
    var connector = this;

    var accountSid = this.accountSid = settings.accountSid;
    var authToken = this.authToken = settings.authToken;
    var sgAPIKey = this.sgAPIKey = settings.sgAPIKey;

    twilio = connector.twilio = require('twilio')(accountSid, authToken);
    sgMail = connector.sgMail = require('@sendgrid/mail');
    sgMail.setApiKey(sgAPIKey);
}
561600
async def message_from_token(self, token: Text, payload: Any) \
            -> Optional[BaseMessage]:
        

        methods = [
            self._message_from_sr,
            self._message_from_token,
        ]

        for method in methods:
            msg = method(token, payload)

            if msg:
                return msg