Scheduled Messages

Schedule messages to be sent for later.


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

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.

var omnimessage = new Omnimessage(
  to: "RECIPIENT_PHONE_NUMBER",
  time_to_send="date in ISO-8061 format",
  messages: messages);
    
curl https://api.messente.com/v1/omnimessage \
    -u MESSENTE_API_USERNAME:MESSENTE_API_PASSWORD \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{ "to": "RECIPIENT_PHONE_NUMBER", "time_to_send": "date in ISO-8061 format", "messages": [{ "channel": "sms", "sender": "YOUR_PHONE_NUMBER", "text": "Happy messaging!" }] }'
    
omnimessage.setTimeToSend("date in ISO-8061 format");
    
const omnimessage = OmnichannelApi.Omnimessage.constructFromObject({
  messages: [viber, sms, whatsapp],
  to: "phone number in international format",
  timeToSend: "date in ISO-8061 format"
});
$omnimessage = new Omnimessage([
  "to" => "RECIPIENT_PHONE_NUMBER",
  "dlr_url" => "YOUR_WEBHOOK_URL",
  "time_to_send" => "date in ISO-8061 format"]);
    
omnimessage = Omnimessage(
  to="RECIPIENT_PHONE_NUMBER",
  time_to_send="date in ISO-8061 format",
  messages=(sms, viber, whatsapp))
    
omnimessage.time_to_send = 'date in ISO-8061 format'
    

Time Formatting

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

Both of these cases are allowed:

  1. 2019-06-22T09:05 - UTC is set as timezone
  2. 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.

try
{
    apiInstance.CancelScheduledMessage(OMNIMESSAGE_ID);
}
catch (Exception e)
{
    Debug.Print("Exception when calling CancelScheduledMessage: " + e.Message );
}
    
curl https://api.messente.com/v1/omnimessage/OMNIMESSAGE_ID \
    -u MESSENTE_API_USERNAME:MESSENTE_API_PASSWORD \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -X "DELETE"
    
try {
    apiInstance.cancelScheduledMessage(OMNIMESSAGE_ID);
} catch (ApiException e) {
    System.err.println("Exception when calling cancelScheduledMessage");
    e.printStackTrace();
}
    
api.cancelScheduledMessage(OMNIMESSAGE_ID, (error, data) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ', data);
  }
});
try {
    $apiInstance->cancelScheduledMessage(OMNIMESSAGE_ID);
} catch (Exception $e) {
    echo 'Exception when calling cancelScheduledMessage: ', $e->getMessage(), PHP_EOL;
}
    
try:
    api_instance.cancel_scheduled_message(OMNIMESSAGE_ID)
except ApiException as e:
    print("Exception when calling cancel_scheduled_message: %s\n" % e)
    
begin
  api_instance.cancel_scheduled_message(OMNIMESSAGE_ID)
rescue Omnichannel::ApiError => e
  puts "Exception when calling cancel_scheduled_message: #{e}"
end