Send a message to the target phone_number.

        See https://developer.telesign.com/docs/messaging-api for detailed API documentation.
975836
def message(self, phone_number, message, message_type, **params):
        
        return self.post(MESSAGING_RESOURCE,
                         phone_number=phone_number,
                         message=message,
                         message_type=message_type,
                         **params)
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
22673
def call(self, phone_number, message, message_type, **params):
        
        return self.post(VOICE_RESOURCE,
                         phone_number=phone_number,
                         message=message,
                         message_type=message_type,
                         **params)
253458
def send_message(self, app_mxit_id, target_user_ids, message='', contains_markup=True,
                     spool=None, spool_timeout=None, links=None, scope='message/send'):
        

        data = {
            'From': app_mxit_id,
            'To': ",".join(target_user_ids),
            'Body': message,
            'ContainsMarkup': contains_markup
        }

        if spool:
            data['Spool'] = spool
        if spool_timeout:
            data['SpoolTimeOut'] = spool_timeout
        if links:
            data['Links'] = links

        return _post(
            token=self.oauth.get_app_token(scope),
            uri='/message/send',
            data=data
        )
1048043
def send(self, message):
        
        body = {
            'notificationType': self._notification_type,
            'priority': self._priority,
            'isOrganization': self._is_organization,
            'message': message,
        }

        if self._recipients:
            body['recipients'] = self._recipients

        self._tcex.log.debug('notification body: {}'.format(json.dumps(body)))

        # create our tcex resource
        resource = resource = self._tcex.resource('Notification')
        resource.http_method = 'POST'
        resource.body = json.dumps(body)

        results = resource.request()  # do the request
        if results.get('response').status_code == 200:
            # everything worked
            response = results.get('response').json()
        elif results.get('response').status_code == 400:
            # failed..but known... user doesn't exist
            # just return and let calling app handle it
            err = 'Failed to send notification ({})'.format(results.get('response').text)
            self._tcex.log.error(err)
            response = results.get('response').json()
        else:
            # somekind of unknown error...raise
            err = 'Failed to send notification ({})'.format(results.get('response').text)
            self._tcex.log.error(err)
            raise RuntimeError(err)
        return response
308946
def send_message(self, message, sign=True):
		
		self.check_connected()
		self.protocol.send_message(message, sign)
949576
def send_message(self, threadid, msgFormat, message):
        '''  '''
        # using deprecated v3 message create because of bug in codegen of v4 ( multipart/form-data )
        response, status_code = self.__agent__.Messages.post_v3_stream_sid_message_create(
            sessionToken=self.__session__,
            keyManagerToken=self.__keymngr__,
            sid=threadid,
            message={"format": msgFormat,
                     "message": message}
        ).result()
        self.logger.debug('%s: %s' % (status_code, response))
        return status_code, response
78919
def _send_api_message(self, message):
        

        self.slack.chat.post_message(**message)
        self.log.debug("sent api message %r", message)
1369059
def send_one(self, source_address: str, destination_address: str, message: str,
                 validity_minutes: int = 0) -> SendSmsResult:
        
        session_id = self._get_session_id()
        params = {
            'sessionId': session_id,
            'sourceAddress': source_address,
            'destinationAddress': destination_address,
            'data': message,
            'validity': validity_minutes,
        }
        sms_ids = self._request(SEND_ONE_URL, params, method=METHOD_POST)
        return SendSmsResult(destination_address, sms_ids)
1188347
def send_msg(self, chat_id, msg_type, **kwargs):
        
        return self.send(chat_id, msg_type, **kwargs)
300447
async def send_message(self, *args, **kwargs):
        
        message = await self._client.send_message(
            self._input_chat, *args, **kwargs)

        self._outgoing.add(message.id)
        self._last_outgoing = message.id
        return message
131778
function sendTextMessage(recipientId, messageText) {
    var messageData = {
        recipient: {
            id: recipientId
        },
        message: {
            text: messageText
        }
    };
    callSendAPI(messageData);
}
256704
async def sendContact(self, chat_id, phone_number, first_name,
                          last_name=None,
                          vcard=None,
                          disable_notification=None,
                          reply_to_message_id=None,
                          reply_markup=None):
        
        p = _strip(locals())
        return await self._api_request('sendContact', _rectify(p))
1102243
def send_sticker(self, chat_id=None, sticker=None, reply_to_message_id=None, reply_markup=None):
        
        payload = dict(chat_id=chat_id,
                       reply_to_message_id=reply_to_message_id,
                       reply_markup=reply_markup)
        files = dict(sticker=open(sticker, 'rb'))
        return Message.from_api(api, **self._post('sendSticker', payload, files))
114099
def send_message(self, target, content, uid=None):
        
        # Compute maximum length of payload
        prefix = "PRIVMSG {0} :".format(target)
        single_prefix = self._make_line("MSG:")
        single_prefix_len = len(single_prefix)
        max_len = 510 - len(prefix)

        content_len = len(content)
        if (content_len + single_prefix_len) < max_len:
            # One pass message
            self._connection.send_raw("{0}{1}{2}" \
                                       .format(prefix, single_prefix, content))

        else:
            # Multiple-passes message
            uid = uid or str(uuid.uuid4()).replace('-', '').upper()
            prefix = "{0}{1}:".format(prefix, self._make_line(uid))
            max_len = 510 - len(prefix)

            self._connection.privmsg(target, self._make_line(uid, "BEGIN"))

            for chunk in chunks(content, max_len):
                self._connection.send_raw(''.join((prefix, chunk)))

            self._connection.privmsg(target, self._make_line(uid, "END"))
655307
def sendMessage(self, to, message, extra={}):
        
        to = to if isinstance(to, list) else [to]
        to = [str(num) for num in to]
        data = {'to': to, 'text': message}
        data = self.merge(data, {'callback': 7, 'mo': 1}, extra)

        content = self.parseRest(self.request('rest/message', data, {}, 'POST'));
        result = []

        # Messages in the REST response will contain errors on the message entry itself.
        for entry in content['message']:
            entry = self.merge({'apiMessageId': False, 'to': data['to'][0], 'error': False, 'errorCode': False}, entry)
            result.append({
                'id': entry['apiMessageId'].encode('utf-8'),
                'destination': entry['to'].encode('utf-8'),
                'error': entry['error']['description'].encode('utf-8') if entry['error'] != False else False,
                'errorCode': entry['error']['code'].encode('utf-8') if entry['error'] != False else False
            });

        return result
1055972
def send_notification(self, method, params):
        
        msg = self._encoder.create_notification(method, params)
        self._send_message(msg)