ChangeStatus
method changes the read status of a message. The status can be Read
, Unread
, Replied
, or Forwarded
. It is available only in synchronous mode.
The following is an example for using ChangeStatus
:
Synchronous
messaging_handle.call('ChangeStatus', {'MessageId': message_id, 'Status': u'Unread'})
The following table summarizes the specification of ChangeStatus
:
Interface | IMessaging |
Description | Sets a given value for the given flag. |
Response Model | Synchronous |
Pre-condition | Valid instance of IMessaging interface is instantiated. |
Post-condition | Message status changed to new status. |
Input Parameters
Input parameter specifies the message ID, and message status to be set.
|
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 set SMS status as Unread
:
import scriptext import appuifw messaging_handle = scriptext.load('Service.Messaging', 'IMessaging') sms_iter = messaging_handle.call('GetList', {'Type': u'Inbox'}) id_list = [] body_list = [] for sms_dict in sms_iter: if sms_dict['MessageType'] == 'SMS': id_list.append(sms_dict['MessageId']) body_list.append(sms_dict['BodyText']) message_index = appuifw.selection_list(body_list) try: messaging_handle.call('ChangeStatus', {'MessageId': id_list[message_index], 'Status': u'Unread'}) except scriptext.ScriptextError, err: print "Error setting message status to Unread" else: print "Message status changed to Unread"
See About this document... for information on suggesting changes.