class Telerivet::ScheduledMessage
Represents a scheduled message within Telerivet
.
Fields:
- id (string, max 34 characters) * ID of the scheduled message * Read-only - content * Text content of the scheduled message * Read-only - rrule * Recurrence rule for recurring scheduled messages, e.g. 'FREQ=MONTHLY' or 'FREQ=WEEKLY;INTERVAL=2'; see <https://tools.ietf.org/html/rfc2445#section-4.3.10> * Read-only - timezone_id * Timezone ID used to compute times for recurring messages; see <http://en.wikipedia.org/wiki/List_of_tz_database_time_zones> * Read-only - recipients (array of objects) * List of recipients. Each recipient is an object with a string `type` property, which may be `"phone_number"`, `"group"`, or `"filter"`. If the type is `"phone_number"`, the `phone_number` property will be set to the recipient's phone number. If the type is `"group"`, the `group_id` property will be set to the ID of the group, and the `group_name` property will be set to the name of the group. If the type is `"filter"`, the `filter_type` property (string) and `filter_params` property (object) describe the filter used to send the broadcast. (API clients should not rely on a particular value or format of the `filter_type` or `filter_params` properties, as they may change without notice.) * Read-only - recipients_str * A string with a human readable description of the first few recipients (possibly truncated) * Read-only - group_id * ID of the group to send the message to (null if the recipient is an individual contact, or if there are multiple recipients) * Read-only - contact_id * ID of the contact to send the message to (null if the recipient is a group, or if there are multiple recipients) * Read-only - to_number * Phone number to send the message to (null if the recipient is a group, or if there are multiple recipients) * Read-only - route_id * ID of the phone or route the message will be sent from * Read-only - service_id (string, max 34 characters) * The service associated with this message (for voice calls, the service defines the call flow) * Read-only - audio_url * For voice calls, the URL of an MP3 file to play when the contact answers the call * Read-only - tts_lang * For voice calls, the language of the text-to-speech voice * Allowed values: en-US, en-GB, en-GB-WLS, en-AU, en-IN, da-DK, nl-NL, fr-FR, fr-CA, de-DE, is-IS, it-IT, pl-PL, pt-BR, pt-PT, ru-RU, es-ES, es-US, sv-SE * Read-only - tts_voice * For voice calls, the text-to-speech voice * Allowed values: female, male * Read-only - message_type * Type of scheduled message * Allowed values: sms, mms, ussd, call, service * Read-only - time_created (UNIX timestamp) * Time the scheduled message was created in Telerivet * Read-only - start_time (UNIX timestamp) * The time that the message will be sent (or first sent for recurring messages) * Read-only - end_time (UNIX timestamp) * Time after which a recurring message will stop (not applicable to non-recurring scheduled messages) * Read-only - prev_time (UNIX timestamp) * The most recent time that Telerivet has sent this scheduled message (null if it has never been sent) * Read-only - next_time (UNIX timestamp) * The next upcoming time that Telerivet will sent this scheduled message (null if it will not be sent again) * Read-only - occurrences (int) * Number of times this scheduled message has already been sent * Read-only - is_template (bool) * Set to true if Telerivet will render variables like [[contact.name]] in the message content, false otherwise * Read-only - track_clicks (boolean) * If true, URLs in the message content will automatically be replaced with unique short URLs * Read-only - media (array) * For text messages containing media files, this is an array of objects with the properties `url`, `type` (MIME type), `filename`, and `size` (file size in bytes). Unknown properties are null. This property is undefined for messages that do not contain media files. Note: For files uploaded via the Telerivet web app, the URL is temporary and may not be valid for more than 1 day. * Read-only - vars (Hash) * Custom variables stored for this scheduled message (copied to Message when sent) * Updatable via API - label_ids (array) * IDs of labels to add to the Message * Read-only - project_id * ID of the project this scheduled message belongs to * Read-only
Public Instance Methods
audio_url()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 209 def audio_url get('audio_url') end
contact_id()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 193 def contact_id get('contact_id') end
content()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 169 def content get('content') end
delete()
click to toggle source
Cancels this scheduled message.
# File lib/telerivet/scheduledmessage.rb, line 161 def delete() @api.do_request("DELETE", get_base_api_path()) end
end_time()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 233 def end_time get('end_time') end
get_base_api_path()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 269 def get_base_api_path() "/projects/#{get('project_id')}/scheduled/#{get('id')}" end
group_id()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 189 def group_id get('group_id') end
id()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 165 def id get('id') end
is_template()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 249 def is_template get('is_template') end
label_ids()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 261 def label_ids get('label_ids') end
media()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 257 def media get('media') end
message_type()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 221 def message_type get('message_type') end
next_time()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 241 def next_time get('next_time') end
occurrences()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 245 def occurrences get('occurrences') end
prev_time()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 237 def prev_time get('prev_time') end
project_id()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 265 def project_id get('project_id') end
recipients()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 181 def recipients get('recipients') end
recipients_str()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 185 def recipients_str get('recipients_str') end
route_id()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 201 def route_id get('route_id') end
rrule()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 173 def rrule get('rrule') end
save()
click to toggle source
Saves any fields or custom variables that have changed for this scheduled message.
Calls superclass method
Telerivet::Entity#save
# File lib/telerivet/scheduledmessage.rb, line 154 def save() super end
service_id()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 205 def service_id get('service_id') end
start_time()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 229 def start_time get('start_time') end
time_created()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 225 def time_created get('time_created') end
timezone_id()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 177 def timezone_id get('timezone_id') end
to_number()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 197 def to_number get('to_number') end
track_clicks()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 253 def track_clicks get('track_clicks') end
tts_lang()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 213 def tts_lang get('tts_lang') end
tts_voice()
click to toggle source
# File lib/telerivet/scheduledmessage.rb, line 217 def tts_voice get('tts_voice') end