telerivet 1.8.2 → 1.9.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/telerivet/airtimetransaction.rb +4 -1
- data/lib/telerivet/broadcast.rb +30 -6
- data/lib/telerivet/campaign.rb +481 -0
- data/lib/telerivet/contact.rb +20 -1
- data/lib/telerivet/contactservicestate.rb +4 -2
- data/lib/telerivet/datatable.rb +183 -9
- data/lib/telerivet/dataview.rb +132 -0
- data/lib/telerivet/entity.rb +3 -3
- data/lib/telerivet/group.rb +32 -0
- data/lib/telerivet/label.rb +1 -1
- data/lib/telerivet/message.rb +28 -6
- data/lib/telerivet/messagetemplate.rb +197 -0
- data/lib/telerivet/organization.rb +310 -43
- data/lib/telerivet/phone.rb +213 -1
- data/lib/telerivet/project.rb +1376 -182
- data/lib/telerivet/relativescheduledmessage.rb +11 -10
- data/lib/telerivet/route.rb +22 -4
- data/lib/telerivet/scheduledmessage.rb +16 -6
- data/lib/telerivet/scheduledservice.rb +160 -0
- data/lib/telerivet/service.rb +91 -5
- data/lib/telerivet/storedfile.rb +167 -0
- data/lib/telerivet/task.rb +8 -0
- data/lib/telerivet/webhook.rb +98 -0
- data/lib/telerivet.rb +1 -1
- metadata +8 -2
data/lib/telerivet/phone.rb
CHANGED
|
@@ -57,6 +57,63 @@ module Telerivet
|
|
|
57
57
|
# * ID of the project this phone belongs to
|
|
58
58
|
# * Read-only
|
|
59
59
|
#
|
|
60
|
+
# - validate_recipient_numbers (bool)
|
|
61
|
+
# * Set to true to check that recipient phone numbers appear to be valid before sending
|
|
62
|
+
# messages. Messages to invalid phone numbers will fail without being sent. Only applies
|
|
63
|
+
# to phones capable of sending messages.
|
|
64
|
+
# * Updatable via API
|
|
65
|
+
#
|
|
66
|
+
# - allowed_recipient_countries (array of strings)
|
|
67
|
+
# * Array of 2-letter country codes (ISO 3166-1 alpha-2) to which this phone is allowed
|
|
68
|
+
# to send messages. When null, there is no restriction on recipient countries.
|
|
69
|
+
# * Updatable via API
|
|
70
|
+
#
|
|
71
|
+
# - sent_message_limit (int)
|
|
72
|
+
# * Maximum number of messages that can be sent from this phone in a given period. When
|
|
73
|
+
# the sent_message_count reaches this limit, sending is automatically paused. Set to
|
|
74
|
+
# null to disable the limit.
|
|
75
|
+
# * Updatable via API
|
|
76
|
+
#
|
|
77
|
+
# - sent_message_count (int)
|
|
78
|
+
# * Number of messages sent from this phone since the counter was last reset (see
|
|
79
|
+
# sent_message_epoch). This property is not updated if sent_message_limit is null.
|
|
80
|
+
# * Read-only
|
|
81
|
+
#
|
|
82
|
+
# - sent_message_epoch (UNIX timestamp)
|
|
83
|
+
# * The UNIX timestamp when the sent_message_count was last reset to 0.
|
|
84
|
+
# * Read-only
|
|
85
|
+
#
|
|
86
|
+
# - send_delay (number)
|
|
87
|
+
# * Number of seconds to wait after sending each message from this phone, to avoid
|
|
88
|
+
# exceeding carrier rate limits.
|
|
89
|
+
# * Updatable via API
|
|
90
|
+
#
|
|
91
|
+
# - timezone_id (string)
|
|
92
|
+
# * A string specifying the time zone that will be used when implementing quiet hours or
|
|
93
|
+
# estimating send times; see [List of tz database time zones Wikipedia
|
|
94
|
+
# article](http://en.wikipedia.org/wiki/List_of_tz_database_time_zones). When null, the
|
|
95
|
+
# project's default time zone is used.
|
|
96
|
+
# * Updatable via API
|
|
97
|
+
#
|
|
98
|
+
# - quiet_mode (string)
|
|
99
|
+
# * Controls behavior during quiet hours (see quiet_start/quiet_end). Possible values
|
|
100
|
+
# are 'off' (quiet hours disabled), 'delay' (messages are delayed until quiet hours
|
|
101
|
+
# end), or 'confirm' (requires manual confirmation to send during quiet hours).
|
|
102
|
+
# * Allowed values: off, delay, confirm
|
|
103
|
+
# * Updatable via API
|
|
104
|
+
#
|
|
105
|
+
# - quiet_start (string)
|
|
106
|
+
# * Time of day when quiet hours begin, in HH:MM format (24-hour time) in the phone's
|
|
107
|
+
# time zone. Messages sent during quiet hours are delayed or require confirmation
|
|
108
|
+
# depending on quiet_mode. Only applicable when quiet_mode is not 'off'.
|
|
109
|
+
# * Updatable via API
|
|
110
|
+
#
|
|
111
|
+
# - quiet_end (string)
|
|
112
|
+
# * Time of day when quiet hours end, in HH:MM format (24-hour time) in the phone's time
|
|
113
|
+
# zone. Messages sent during quiet hours are delayed or require confirmation depending
|
|
114
|
+
# on quiet_mode. Only applicable when quiet_mode is not 'off'.
|
|
115
|
+
# * Updatable via API
|
|
116
|
+
#
|
|
60
117
|
# - battery (int)
|
|
61
118
|
# * Current battery level, on a scale from 0 to 100, as of the last time the phone
|
|
62
119
|
# connected to Telerivet (only present for Android phones)
|
|
@@ -104,6 +161,40 @@ module Telerivet
|
|
|
104
161
|
# increase this limit, install additional SMS expansion packs in the Telerivet Gateway
|
|
105
162
|
# app. (only present for Android phones)
|
|
106
163
|
# * Read-only
|
|
164
|
+
#
|
|
165
|
+
# - external_account_id (string)
|
|
166
|
+
# * Account ID for the external API (e.g. Twilio Account SID, Vonage API Key). Only
|
|
167
|
+
# present for routes that support external API configuration. See
|
|
168
|
+
# [createPhone](#Project.createPhone) for the meaning of this field for each phone type.
|
|
169
|
+
# * Updatable via API
|
|
170
|
+
#
|
|
171
|
+
# - external_id (string)
|
|
172
|
+
# * External phone/resource ID within the external API account (if applicable). Only
|
|
173
|
+
# present for routes that support external API configuration.
|
|
174
|
+
# * Updatable via API
|
|
175
|
+
#
|
|
176
|
+
# - external_config (Hash)
|
|
177
|
+
# * Additional configuration settings specific to the phone_type. Only present for
|
|
178
|
+
# routes that support external API configuration. See
|
|
179
|
+
# [createPhone](#Project.createPhone) for available settings for each phone type.
|
|
180
|
+
# * Updatable via API
|
|
181
|
+
#
|
|
182
|
+
# - external_setup (Hash)
|
|
183
|
+
# * Configuration info for routes that require manual webhook setup. Only present for
|
|
184
|
+
# routes that require manual configuration of callback URLs with the external provider.
|
|
185
|
+
# Contains URL properties for each webhook type that needs to be configured (e.g.,
|
|
186
|
+
# `incoming_message_url`, `message_status_url`, `incoming_call_url`).
|
|
187
|
+
# * Read-only
|
|
188
|
+
#
|
|
189
|
+
# - external_secret (string)
|
|
190
|
+
# * Secret/API key for the external API (e.g. Twilio Auth Token, Vonage API Secret).
|
|
191
|
+
# Only applicable for routes that support external API configuration. Write-only; not
|
|
192
|
+
# returned by the API when retrieving a phone.
|
|
193
|
+
# * Updatable via API
|
|
194
|
+
#
|
|
195
|
+
# - url
|
|
196
|
+
# * URL to this phone in the Telerivet web app
|
|
197
|
+
# * Read-only
|
|
107
198
|
#
|
|
108
199
|
class Phone < Entity
|
|
109
200
|
#
|
|
@@ -123,7 +214,7 @@ class Phone < Entity
|
|
|
123
214
|
# - source
|
|
124
215
|
# * Filter messages by source
|
|
125
216
|
# * Allowed values: phone, provider, web, api, service, webhook, scheduled,
|
|
126
|
-
# integration
|
|
217
|
+
# integration, mcp
|
|
127
218
|
#
|
|
128
219
|
# - starred (bool)
|
|
129
220
|
# * Filter messages by starred/unstarred
|
|
@@ -195,6 +286,15 @@ class Phone < Entity
|
|
|
195
286
|
super
|
|
196
287
|
end
|
|
197
288
|
|
|
289
|
+
#
|
|
290
|
+
# Resets this route's sent_message_count to 0 and updates sent_message_epoch to the current
|
|
291
|
+
# time. If sending was automatically paused because the previous count reached the limit,
|
|
292
|
+
# sending will be resumed.
|
|
293
|
+
#
|
|
294
|
+
def reset_sent_message_count()
|
|
295
|
+
@api.do_request("POST", get_base_api_path() + "/reset_sent_message_count")
|
|
296
|
+
end
|
|
297
|
+
|
|
198
298
|
def id
|
|
199
299
|
get('id')
|
|
200
300
|
end
|
|
@@ -243,6 +343,78 @@ class Phone < Entity
|
|
|
243
343
|
get('project_id')
|
|
244
344
|
end
|
|
245
345
|
|
|
346
|
+
def validate_recipient_numbers
|
|
347
|
+
get('validate_recipient_numbers')
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
def validate_recipient_numbers=(value)
|
|
351
|
+
set('validate_recipient_numbers', value)
|
|
352
|
+
end
|
|
353
|
+
|
|
354
|
+
def allowed_recipient_countries
|
|
355
|
+
get('allowed_recipient_countries')
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
def allowed_recipient_countries=(value)
|
|
359
|
+
set('allowed_recipient_countries', value)
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
def sent_message_limit
|
|
363
|
+
get('sent_message_limit')
|
|
364
|
+
end
|
|
365
|
+
|
|
366
|
+
def sent_message_limit=(value)
|
|
367
|
+
set('sent_message_limit', value)
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
def sent_message_count
|
|
371
|
+
get('sent_message_count')
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
def sent_message_epoch
|
|
375
|
+
get('sent_message_epoch')
|
|
376
|
+
end
|
|
377
|
+
|
|
378
|
+
def send_delay
|
|
379
|
+
get('send_delay')
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
def send_delay=(value)
|
|
383
|
+
set('send_delay', value)
|
|
384
|
+
end
|
|
385
|
+
|
|
386
|
+
def timezone_id
|
|
387
|
+
get('timezone_id')
|
|
388
|
+
end
|
|
389
|
+
|
|
390
|
+
def timezone_id=(value)
|
|
391
|
+
set('timezone_id', value)
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
def quiet_mode
|
|
395
|
+
get('quiet_mode')
|
|
396
|
+
end
|
|
397
|
+
|
|
398
|
+
def quiet_mode=(value)
|
|
399
|
+
set('quiet_mode', value)
|
|
400
|
+
end
|
|
401
|
+
|
|
402
|
+
def quiet_start
|
|
403
|
+
get('quiet_start')
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
def quiet_start=(value)
|
|
407
|
+
set('quiet_start', value)
|
|
408
|
+
end
|
|
409
|
+
|
|
410
|
+
def quiet_end
|
|
411
|
+
get('quiet_end')
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
def quiet_end=(value)
|
|
415
|
+
set('quiet_end', value)
|
|
416
|
+
end
|
|
417
|
+
|
|
246
418
|
def battery
|
|
247
419
|
get('battery')
|
|
248
420
|
end
|
|
@@ -279,6 +451,46 @@ class Phone < Entity
|
|
|
279
451
|
get('send_limit')
|
|
280
452
|
end
|
|
281
453
|
|
|
454
|
+
def external_account_id
|
|
455
|
+
get('external_account_id')
|
|
456
|
+
end
|
|
457
|
+
|
|
458
|
+
def external_account_id=(value)
|
|
459
|
+
set('external_account_id', value)
|
|
460
|
+
end
|
|
461
|
+
|
|
462
|
+
def external_id
|
|
463
|
+
get('external_id')
|
|
464
|
+
end
|
|
465
|
+
|
|
466
|
+
def external_id=(value)
|
|
467
|
+
set('external_id', value)
|
|
468
|
+
end
|
|
469
|
+
|
|
470
|
+
def external_config
|
|
471
|
+
get('external_config')
|
|
472
|
+
end
|
|
473
|
+
|
|
474
|
+
def external_config=(value)
|
|
475
|
+
set('external_config', value)
|
|
476
|
+
end
|
|
477
|
+
|
|
478
|
+
def external_setup
|
|
479
|
+
get('external_setup')
|
|
480
|
+
end
|
|
481
|
+
|
|
482
|
+
def external_secret
|
|
483
|
+
get('external_secret')
|
|
484
|
+
end
|
|
485
|
+
|
|
486
|
+
def external_secret=(value)
|
|
487
|
+
set('external_secret', value)
|
|
488
|
+
end
|
|
489
|
+
|
|
490
|
+
def url
|
|
491
|
+
get('url')
|
|
492
|
+
end
|
|
493
|
+
|
|
282
494
|
def get_base_api_path()
|
|
283
495
|
"/projects/#{get('project_id')}/phones/#{get('id')}"
|
|
284
496
|
end
|