Skip to main content

Scheduled Messages

Schedule messages to be sent for later.


tip

The easiest way to use Omnichannel API is with our official libraries. They will take care of authentication, request validation and response handling automatically.

Schedule a message

Send a message with time_to_send parameter to schedule it for later. Learn how to compose a message in our quickstart guide.

omnimessage = Omnimessage(
to="RECIPIENT_PHONE_NUMBER",
time_to_send="date in ISO-8061 format",
messages=(sms, viber)
)

Time format

  • Time must be specified in the ISO 8601 format.
  • Default timezone is UTC.

For example, both of the cases below are allowed:

  • 2019-06-22T09:05 - UTC is set as timezone
  • 2019-06-22T09:05:07+04:00 - Default timezone is ignored and UTC+4 is used

Cancel a scheduled message

To cancel a scheduled message you need to know the omnimessage_id that you got when you sent out the message.

# pip install messente-api

from messente_api import ApiClient, Configuration, OmnimessageApi
from messente_api.rest import ApiException

configuration = Configuration()
configuration.username = "YOUR_MESSENTE_API_USERNAME"
configuration.password = "YOUR_MESSENTE_API_PASSWORD"

api_instance = OmnimessageApi(ApiClient(configuration))
omnimessage_id = "YOUR_OMNIMESSAGE_ID"

try:
api_instance.cancel_scheduled_message(omnimessage_id)
except ApiException as e:
print("Exception when calling cancel_scheduled_message: %s\n" % e)