Send
is used to send an SMS or MMS message. It takes a set of input parameters that specifies the message type, and the message details associated with that particular message type.
The following are the examples for using Send
:
Synchronous
messaging_handle.call('Send', {'MessageType': u'SMS', 'To': u'12345678', 'BodyText': u'Hi'})
Asynchronous
messaging_handle.call('Send', {'MessageType': u'SMS', 'To': u'12345678', 'BodyText': u'Hi'}, callback=callback_function)
where, callback_function
is a user defined callback function.
The following table summarizes the specification of Send
:
Interface | IMessaging |
Description | Sends the message. |
Response Model | Synchronous and asynchronous |
Pre-condition | Valid instance of IMessaging interface is instantiated. |
Post-condition | Nil |
Input Parameters
Input parameter specifies the type of messaging object and its details.
|
Output Parameters
Output parameters contain ErrorCode
, and ErrorMessage
if the operation fails.
|
Errors
The following table lists the error codes and their values:
|
Error Messages
The following table lists the error messages and their description:
|
Example
The following sample code illustrates how to send SMS message to the specified phone number:
import scriptext messaging_handle = scriptext.load('Service.Messaging', 'IMessaging') try: messaging_handle.call('Send', {'MessageType': u'SMS', 'To': u'12345678', 'BodyText': u'Hi'}) except scriptext.ScriptextError, err: print "Error sending SMS : ", err else: print "SMS sent successfully"
See About this document... for information on suggesting changes.