telerivet 1.4.2 → 1.4.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/telerivet.rb +3 -3
- data/lib/telerivet/broadcast.rb +41 -1
- data/lib/telerivet/contact.rb +18 -7
- data/lib/telerivet/datatable.rb +2 -2
- data/lib/telerivet/group.rb +3 -3
- data/lib/telerivet/label.rb +5 -2
- data/lib/telerivet/message.rb +71 -1
- data/lib/telerivet/organization.rb +1 -1
- data/lib/telerivet/phone.rb +5 -2
- data/lib/telerivet/project.rb +156 -74
- data/lib/telerivet/scheduledmessage.rb +22 -1
- data/lib/telerivet/service.rb +4 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0633af0317a3ef409a86481a483f934d2832d2f6a11fd545221997c3ebb495ad
|
4
|
+
data.tar.gz: 344a694d8cc84a5231cefa14d26f89fceecf6d140f201e013705794684f94015
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74a877df3a572e3b1d96922343d0bc54ed58a2f2d28b36bf883691a3b440244e777cdb74cfed10f701a2f8a768dd157e5ada0f116b1c588774744080699fabc8
|
7
|
+
data.tar.gz: b75d13f319943c2f899200a1845932aad01205a902b280c2128d8bf19c7453b696386a539c278df2a1a19cba14c018189a817a622f2897d229b63eba3f94b7f3
|
data/lib/telerivet.rb
CHANGED
@@ -9,7 +9,7 @@ module Telerivet
|
|
9
9
|
class API
|
10
10
|
attr_reader :num_requests
|
11
11
|
|
12
|
-
@@client_version = '1.4.
|
12
|
+
@@client_version = '1.4.5'
|
13
13
|
|
14
14
|
#
|
15
15
|
# Initializes a client handle to the Telerivet REST API.
|
@@ -153,7 +153,7 @@ class API
|
|
153
153
|
# * Default: asc
|
154
154
|
#
|
155
155
|
# - page_size (int)
|
156
|
-
# * Number of results returned per page (max
|
156
|
+
# * Number of results returned per page (max 500)
|
157
157
|
# * Default: 50
|
158
158
|
#
|
159
159
|
# - offset (int)
|
@@ -222,7 +222,7 @@ class API
|
|
222
222
|
# * Default: asc
|
223
223
|
#
|
224
224
|
# - page_size (int)
|
225
|
-
# * Number of results returned per page (max
|
225
|
+
# * Number of results returned per page (max 500)
|
226
226
|
# * Default: 50
|
227
227
|
#
|
228
228
|
# - offset (int)
|
data/lib/telerivet/broadcast.rb
CHANGED
@@ -75,7 +75,7 @@ module Telerivet
|
|
75
75
|
#
|
76
76
|
# - message_type
|
77
77
|
# * Type of message sent from this broadcast
|
78
|
-
# * Allowed values: sms, mms, ussd, call
|
78
|
+
# * Allowed values: sms, mms, ussd, call, service
|
79
79
|
# * Read-only
|
80
80
|
#
|
81
81
|
# - content (string)
|
@@ -117,10 +117,29 @@ module Telerivet
|
|
117
117
|
# sent to or received by a real phone)
|
118
118
|
# * Read-only
|
119
119
|
#
|
120
|
+
# - track_clicks (boolean)
|
121
|
+
# * If true, URLs in the message content will automatically be replaced with unique
|
122
|
+
# short URLs.
|
123
|
+
# * Read-only
|
124
|
+
#
|
125
|
+
# - clicked_count (int)
|
126
|
+
# * The number of messages in this broadcast containing short links that were clicked.
|
127
|
+
# At most one click per message is counted. If track_clicks is false, this property will
|
128
|
+
# be null.
|
129
|
+
# * Read-only
|
130
|
+
#
|
120
131
|
# - label_ids (array)
|
121
132
|
# * List of IDs of labels applied to all messages in the broadcast
|
122
133
|
# * Read-only
|
123
134
|
#
|
135
|
+
# - media (array)
|
136
|
+
# * For text messages containing media files, this is an array of objects with the
|
137
|
+
# properties `url`, `type` (MIME type), `filename`, and `size` (file size in bytes).
|
138
|
+
# Unknown properties are null. This property is undefined for messages that do not
|
139
|
+
# contain media files. Note: For files uploaded via the Telerivet web app, the URL is
|
140
|
+
# temporary and may not be valid for more than 1 day.
|
141
|
+
# * Read-only
|
142
|
+
#
|
124
143
|
# - vars (Hash)
|
125
144
|
# * Custom variables stored for this broadcast
|
126
145
|
# * Read-only
|
@@ -147,6 +166,11 @@ module Telerivet
|
|
147
166
|
# * ID of the phone or route used to send the broadcast (if applicable)
|
148
167
|
# * Read-only
|
149
168
|
#
|
169
|
+
# - service_id (string, max 34 characters)
|
170
|
+
# * The service associated with this broadcast (for voice calls, the service defines the
|
171
|
+
# call flow)
|
172
|
+
# * Read-only
|
173
|
+
#
|
150
174
|
# - user_id (string, max 34 characters)
|
151
175
|
# * ID of the Telerivet user who sent the broadcast (if applicable)
|
152
176
|
# * Read-only
|
@@ -242,10 +266,22 @@ class Broadcast < Entity
|
|
242
266
|
get('simulated')
|
243
267
|
end
|
244
268
|
|
269
|
+
def track_clicks
|
270
|
+
get('track_clicks')
|
271
|
+
end
|
272
|
+
|
273
|
+
def clicked_count
|
274
|
+
get('clicked_count')
|
275
|
+
end
|
276
|
+
|
245
277
|
def label_ids
|
246
278
|
get('label_ids')
|
247
279
|
end
|
248
280
|
|
281
|
+
def media
|
282
|
+
get('media')
|
283
|
+
end
|
284
|
+
|
249
285
|
def price
|
250
286
|
get('price')
|
251
287
|
end
|
@@ -266,6 +302,10 @@ class Broadcast < Entity
|
|
266
302
|
get('route_id')
|
267
303
|
end
|
268
304
|
|
305
|
+
def service_id
|
306
|
+
get('service_id')
|
307
|
+
end
|
308
|
+
|
269
309
|
def user_id
|
270
310
|
get('user_id')
|
271
311
|
end
|
data/lib/telerivet/contact.rb
CHANGED
@@ -19,6 +19,10 @@ module Telerivet
|
|
19
19
|
# * Time the contact was added in Telerivet
|
20
20
|
# * Read-only
|
21
21
|
#
|
22
|
+
# - time_updated (UNIX timestamp)
|
23
|
+
# * Time the contact was last updated in Telerivet
|
24
|
+
# * Read-only
|
25
|
+
#
|
22
26
|
# - send_blocked (bool)
|
23
27
|
# * True if Telerivet is blocked from sending messages to this contact
|
24
28
|
# * Updatable via API
|
@@ -125,7 +129,7 @@ class Contact < Entity
|
|
125
129
|
#
|
126
130
|
# - message_type
|
127
131
|
# * Filter messages by message_type
|
128
|
-
# * Allowed values: sms, mms, ussd, call
|
132
|
+
# * Allowed values: sms, mms, ussd, call, service
|
129
133
|
#
|
130
134
|
# - source
|
131
135
|
# * Filter messages by source
|
@@ -157,6 +161,9 @@ class Contact < Entity
|
|
157
161
|
# - broadcast_id
|
158
162
|
# * ID of the broadcast containing the message
|
159
163
|
#
|
164
|
+
# - scheduled_id
|
165
|
+
# * ID of the scheduled message that created this message
|
166
|
+
#
|
160
167
|
# - sort
|
161
168
|
# * Sort the results based on a field
|
162
169
|
# * Allowed values: default
|
@@ -168,7 +175,7 @@ class Contact < Entity
|
|
168
175
|
# * Default: asc
|
169
176
|
#
|
170
177
|
# - page_size (int)
|
171
|
-
# * Number of results returned per page (max
|
178
|
+
# * Number of results returned per page (max 500)
|
172
179
|
# * Default: 50
|
173
180
|
#
|
174
181
|
# - offset (int)
|
@@ -208,7 +215,7 @@ class Contact < Entity
|
|
208
215
|
# * Default: asc
|
209
216
|
#
|
210
217
|
# - page_size (int)
|
211
|
-
# * Number of results returned per page (max
|
218
|
+
# * Number of results returned per page (max 500)
|
212
219
|
# * Default: 50
|
213
220
|
#
|
214
221
|
# - offset (int)
|
@@ -232,7 +239,7 @@ class Contact < Entity
|
|
232
239
|
#
|
233
240
|
# - message_type
|
234
241
|
# * Filter scheduled messages by message_type
|
235
|
-
# * Allowed values: sms, mms, ussd, call
|
242
|
+
# * Allowed values: sms, mms, ussd, call, service
|
236
243
|
#
|
237
244
|
# - time_created (UNIX timestamp)
|
238
245
|
# * Filter scheduled messages by time_created
|
@@ -254,7 +261,7 @@ class Contact < Entity
|
|
254
261
|
# * Default: asc
|
255
262
|
#
|
256
263
|
# - page_size (int)
|
257
|
-
# * Number of results returned per page (max
|
264
|
+
# * Number of results returned per page (max 500)
|
258
265
|
# * Default: 50
|
259
266
|
#
|
260
267
|
# - offset (int)
|
@@ -290,7 +297,7 @@ class Contact < Entity
|
|
290
297
|
# * Default: asc
|
291
298
|
#
|
292
299
|
# - page_size (int)
|
293
|
-
# * Number of results returned per page (max
|
300
|
+
# * Number of results returned per page (max 500)
|
294
301
|
# * Default: 50
|
295
302
|
#
|
296
303
|
# - offset (int)
|
@@ -333,7 +340,7 @@ class Contact < Entity
|
|
333
340
|
# * Default: asc
|
334
341
|
#
|
335
342
|
# - page_size (int)
|
336
|
-
# * Number of results returned per page (max
|
343
|
+
# * Number of results returned per page (max 500)
|
337
344
|
# * Default: 50
|
338
345
|
#
|
339
346
|
# - offset (int)
|
@@ -386,6 +393,10 @@ class Contact < Entity
|
|
386
393
|
get('time_created')
|
387
394
|
end
|
388
395
|
|
396
|
+
def time_updated
|
397
|
+
get('time_updated')
|
398
|
+
end
|
399
|
+
|
389
400
|
def send_blocked
|
390
401
|
get('send_blocked')
|
391
402
|
end
|
data/lib/telerivet/datatable.rb
CHANGED
@@ -76,7 +76,7 @@ class DataTable < Entity
|
|
76
76
|
# * Default: asc
|
77
77
|
#
|
78
78
|
# - page_size (int)
|
79
|
-
# * Number of results returned per page (max
|
79
|
+
# * Number of results returned per page (max 500)
|
80
80
|
# * Default: 50
|
81
81
|
#
|
82
82
|
# - offset (int)
|
@@ -175,7 +175,7 @@ class DataTable < Entity
|
|
175
175
|
# - type (string)
|
176
176
|
# * Field type
|
177
177
|
# * Allowed values: text, long_text, number, boolean, email, url, audio, phone_number,
|
178
|
-
# date, date_time, groups, route
|
178
|
+
# date, date_time, groups, route, select, buttons
|
179
179
|
#
|
180
180
|
# - order (int)
|
181
181
|
# * Order in which to display the field
|
data/lib/telerivet/group.rb
CHANGED
@@ -103,7 +103,7 @@ class Group < Entity
|
|
103
103
|
# * Default: asc
|
104
104
|
#
|
105
105
|
# - page_size (int)
|
106
|
-
# * Number of results returned per page (max
|
106
|
+
# * Number of results returned per page (max 500)
|
107
107
|
# * Default: 50
|
108
108
|
#
|
109
109
|
# - offset (int)
|
@@ -126,7 +126,7 @@ class Group < Entity
|
|
126
126
|
#
|
127
127
|
# - message_type
|
128
128
|
# * Filter scheduled messages by message_type
|
129
|
-
# * Allowed values: sms, mms, ussd, call
|
129
|
+
# * Allowed values: sms, mms, ussd, call, service
|
130
130
|
#
|
131
131
|
# - time_created (UNIX timestamp)
|
132
132
|
# * Filter scheduled messages by time_created
|
@@ -148,7 +148,7 @@ class Group < Entity
|
|
148
148
|
# * Default: asc
|
149
149
|
#
|
150
150
|
# - page_size (int)
|
151
|
-
# * Number of results returned per page (max
|
151
|
+
# * Number of results returned per page (max 500)
|
152
152
|
# * Default: 50
|
153
153
|
#
|
154
154
|
# - offset (int)
|
data/lib/telerivet/label.rb
CHANGED
@@ -39,7 +39,7 @@ class Label < Entity
|
|
39
39
|
#
|
40
40
|
# - message_type
|
41
41
|
# * Filter messages by message_type
|
42
|
-
# * Allowed values: sms, mms, ussd, call
|
42
|
+
# * Allowed values: sms, mms, ussd, call, service
|
43
43
|
#
|
44
44
|
# - source
|
45
45
|
# * Filter messages by source
|
@@ -71,6 +71,9 @@ class Label < Entity
|
|
71
71
|
# - broadcast_id
|
72
72
|
# * ID of the broadcast containing the message
|
73
73
|
#
|
74
|
+
# - scheduled_id
|
75
|
+
# * ID of the scheduled message that created this message
|
76
|
+
#
|
74
77
|
# - sort
|
75
78
|
# * Sort the results based on a field
|
76
79
|
# * Allowed values: default
|
@@ -82,7 +85,7 @@ class Label < Entity
|
|
82
85
|
# * Default: asc
|
83
86
|
#
|
84
87
|
# - page_size (int)
|
85
|
-
# * Number of results returned per page (max
|
88
|
+
# * Number of results returned per page (max 500)
|
86
89
|
# * Default: 50
|
87
90
|
#
|
88
91
|
# - offset (int)
|
data/lib/telerivet/message.rb
CHANGED
@@ -23,7 +23,7 @@ module Telerivet
|
|
23
23
|
#
|
24
24
|
# - message_type
|
25
25
|
# * Type of the message
|
26
|
-
# * Allowed values: sms, mms, ussd, call
|
26
|
+
# * Allowed values: sms, mms, ussd, call, service
|
27
27
|
# * Read-only
|
28
28
|
#
|
29
29
|
# - source
|
@@ -40,6 +40,10 @@ module Telerivet
|
|
40
40
|
# and messages that have not yet been sent)
|
41
41
|
# * Read-only
|
42
42
|
#
|
43
|
+
# - time_updated (UNIX timestamp)
|
44
|
+
# * The time that the message was last updated in Telerivet.
|
45
|
+
# * Read-only
|
46
|
+
#
|
43
47
|
# - from_number (string)
|
44
48
|
# * The phone number that the message originated from (your number for outgoing
|
45
49
|
# messages, the contact's number for incoming messages)
|
@@ -71,6 +75,11 @@ module Telerivet
|
|
71
75
|
# * Custom variables stored for this message
|
72
76
|
# * Updatable via API
|
73
77
|
#
|
78
|
+
# - priority (int)
|
79
|
+
# * Priority of this message. Telerivet will attempt to send messages with higher
|
80
|
+
# priority numbers first. Only defined for outgoing messages.
|
81
|
+
# * Read-only
|
82
|
+
#
|
74
83
|
# - error_message
|
75
84
|
# * A description of the error encountered while sending a message. (This field is
|
76
85
|
# omitted from the API response if there is no error message.)
|
@@ -122,6 +131,35 @@ module Telerivet
|
|
122
131
|
# [getMMSParts](#Message.getMMSParts).
|
123
132
|
# * Read-only
|
124
133
|
#
|
134
|
+
# - track_clicks (boolean)
|
135
|
+
# * If true, URLs in the message content are short URLs that redirect to a destination
|
136
|
+
# URL.
|
137
|
+
# * Read-only
|
138
|
+
#
|
139
|
+
# - short_urls (array)
|
140
|
+
# * For text messages containing short URLs, this is an array of objects with the
|
141
|
+
# properties `short_url`, `link_type`, and `time_clicked` (the first time that URL was
|
142
|
+
# clicked). If `link_type` is "redirect", the object also contains a `destination_url`
|
143
|
+
# property. If `link_type` is "media", the object also contains an `media_index`
|
144
|
+
# property (the index in the media array). If `link_type` is "service", the object also
|
145
|
+
# contains a `service_id` property. This property is undefined for messages that do not
|
146
|
+
# contain short URLs.
|
147
|
+
# * Read-only
|
148
|
+
#
|
149
|
+
# - media (array)
|
150
|
+
# * For text messages containing media files, this is an array of objects with the
|
151
|
+
# properties `url`, `type` (MIME type), `filename`, and `size` (file size in bytes).
|
152
|
+
# Unknown properties are null. This property is undefined for messages that do not
|
153
|
+
# contain media files. Note: For files uploaded via the Telerivet web app, the URL is
|
154
|
+
# temporary and may not be valid for more than 1 day.
|
155
|
+
# * Read-only
|
156
|
+
#
|
157
|
+
# - time_clicked (UNIX timestamp)
|
158
|
+
# * If the message contains any short URLs, this is the first time that a short URL in
|
159
|
+
# the message was clicked. This property is undefined for messages that do not contain
|
160
|
+
# short URLs.
|
161
|
+
# * Read-only
|
162
|
+
#
|
125
163
|
# - service_id (string, max 34 characters)
|
126
164
|
# * ID of the service that handled the message (for voice calls, the service defines the
|
127
165
|
# call flow)
|
@@ -143,6 +181,10 @@ module Telerivet
|
|
143
181
|
# * ID of the broadcast that this message is part of (if applicable)
|
144
182
|
# * Read-only
|
145
183
|
#
|
184
|
+
# - scheduled_id (string, max 34 characters)
|
185
|
+
# * ID of the scheduled message that created this message is part of (if applicable)
|
186
|
+
# * Read-only
|
187
|
+
#
|
146
188
|
# - user_id (string, max 34 characters)
|
147
189
|
# * ID of the Telerivet user who sent the message (if applicable)
|
148
190
|
# * Read-only
|
@@ -290,6 +332,10 @@ class Message < Entity
|
|
290
332
|
get('time_sent')
|
291
333
|
end
|
292
334
|
|
335
|
+
def time_updated
|
336
|
+
get('time_updated')
|
337
|
+
end
|
338
|
+
|
293
339
|
def from_number
|
294
340
|
get('from_number')
|
295
341
|
end
|
@@ -318,6 +364,10 @@ class Message < Entity
|
|
318
364
|
get('label_ids')
|
319
365
|
end
|
320
366
|
|
367
|
+
def priority
|
368
|
+
get('priority')
|
369
|
+
end
|
370
|
+
|
321
371
|
def error_message
|
322
372
|
get('error_message')
|
323
373
|
end
|
@@ -362,6 +412,22 @@ class Message < Entity
|
|
362
412
|
get('mms_parts')
|
363
413
|
end
|
364
414
|
|
415
|
+
def track_clicks
|
416
|
+
get('track_clicks')
|
417
|
+
end
|
418
|
+
|
419
|
+
def short_urls
|
420
|
+
get('short_urls')
|
421
|
+
end
|
422
|
+
|
423
|
+
def media
|
424
|
+
get('media')
|
425
|
+
end
|
426
|
+
|
427
|
+
def time_clicked
|
428
|
+
get('time_clicked')
|
429
|
+
end
|
430
|
+
|
365
431
|
def service_id
|
366
432
|
get('service_id')
|
367
433
|
end
|
@@ -382,6 +448,10 @@ class Message < Entity
|
|
382
448
|
get('broadcast_id')
|
383
449
|
end
|
384
450
|
|
451
|
+
def scheduled_id
|
452
|
+
get('scheduled_id')
|
453
|
+
end
|
454
|
+
|
385
455
|
def user_id
|
386
456
|
get('user_id')
|
387
457
|
end
|
data/lib/telerivet/phone.rb
CHANGED
@@ -111,7 +111,7 @@ class Phone < Entity
|
|
111
111
|
#
|
112
112
|
# - message_type
|
113
113
|
# * Filter messages by message_type
|
114
|
-
# * Allowed values: sms, mms, ussd, call
|
114
|
+
# * Allowed values: sms, mms, ussd, call, service
|
115
115
|
#
|
116
116
|
# - source
|
117
117
|
# * Filter messages by source
|
@@ -143,6 +143,9 @@ class Phone < Entity
|
|
143
143
|
# - broadcast_id
|
144
144
|
# * ID of the broadcast containing the message
|
145
145
|
#
|
146
|
+
# - scheduled_id
|
147
|
+
# * ID of the scheduled message that created this message
|
148
|
+
#
|
146
149
|
# - sort
|
147
150
|
# * Sort the results based on a field
|
148
151
|
# * Allowed values: default
|
@@ -154,7 +157,7 @@ class Phone < Entity
|
|
154
157
|
# * Default: asc
|
155
158
|
#
|
156
159
|
# - page_size (int)
|
157
|
-
# * Number of results returned per page (max
|
160
|
+
# * Number of results returned per page (max 500)
|
158
161
|
# * Default: 50
|
159
162
|
#
|
160
163
|
# - offset (int)
|
data/lib/telerivet/project.rb
CHANGED
@@ -37,16 +37,17 @@ module Telerivet
|
|
37
37
|
#
|
38
38
|
class Project < Entity
|
39
39
|
#
|
40
|
-
# Sends one message (SMS, voice call, or USSD request).
|
40
|
+
# Sends one message (SMS, MMS, voice call, or USSD request).
|
41
41
|
#
|
42
42
|
# Arguments:
|
43
43
|
# - options (Hash)
|
44
44
|
# * Required
|
45
45
|
#
|
46
46
|
# - message_type
|
47
|
-
# * Type of message to send
|
48
|
-
#
|
49
|
-
# *
|
47
|
+
# * Type of message to send. If `text`, will use the default text message type for the
|
48
|
+
# selected route.
|
49
|
+
# * Allowed values: sms, mms, ussd, call, text
|
50
|
+
# * Default: text
|
50
51
|
#
|
51
52
|
# - content
|
52
53
|
# * Content of the message to send (if `message_type` is `call`, the text will be
|
@@ -65,6 +66,45 @@ class Project < Entity
|
|
65
66
|
# * ID of the phone or route to send the message from
|
66
67
|
# * Default: default sender route ID for your project
|
67
68
|
#
|
69
|
+
# - status_url
|
70
|
+
# * Webhook callback URL to be notified when message status changes
|
71
|
+
#
|
72
|
+
# - status_secret
|
73
|
+
# * POST parameter 'secret' passed to status_url
|
74
|
+
#
|
75
|
+
# - is_template (bool)
|
76
|
+
# * Set to true to evaluate variables like [[contact.name]] in message content. [(See
|
77
|
+
# available variables)](#variables)
|
78
|
+
# * Default: false
|
79
|
+
#
|
80
|
+
# - track_clicks (boolean)
|
81
|
+
# * If true, URLs in the message content will automatically be replaced with unique
|
82
|
+
# short URLs.
|
83
|
+
# * Default: false
|
84
|
+
#
|
85
|
+
# - media_urls (array)
|
86
|
+
# * URLs of media files to attach to the text message. If `message_type` is `sms`,
|
87
|
+
# short links to each media URL will be appended to the end of the content (separated
|
88
|
+
# by a new line).
|
89
|
+
#
|
90
|
+
# - label_ids (array)
|
91
|
+
# * List of IDs of labels to add to this message
|
92
|
+
#
|
93
|
+
# - vars (Hash)
|
94
|
+
# * Custom variables to store with the message
|
95
|
+
#
|
96
|
+
# - priority (int)
|
97
|
+
# * Priority of the message. Telerivet will attempt to send messages with higher
|
98
|
+
# priority numbers first (for example, so you can prioritize an auto-reply ahead of a
|
99
|
+
# bulk message to a large group).
|
100
|
+
# * Allowed values: 1, 2
|
101
|
+
# * Default: 1
|
102
|
+
#
|
103
|
+
# - simulated (bool)
|
104
|
+
# * Set to true to test the Telerivet API without actually sending a message from the
|
105
|
+
# route
|
106
|
+
# * Default: false
|
107
|
+
#
|
68
108
|
# - service_id
|
69
109
|
# * Service that defines the call flow of the voice call (when `message_type` is
|
70
110
|
# `call`)
|
@@ -90,29 +130,6 @@ class Project < Entity
|
|
90
130
|
# * The name of the text-to-speech voice (when message_type=call)
|
91
131
|
# * Allowed values: female, male
|
92
132
|
# * Default: female
|
93
|
-
#
|
94
|
-
# - status_url
|
95
|
-
# * Webhook callback URL to be notified when message status changes
|
96
|
-
#
|
97
|
-
# - status_secret
|
98
|
-
# * POST parameter 'secret' passed to status_url
|
99
|
-
#
|
100
|
-
# - is_template (bool)
|
101
|
-
# * Set to true to evaluate variables like [[contact.name]] in message content. [(See
|
102
|
-
# available variables)](#variables)
|
103
|
-
# * Default: false
|
104
|
-
#
|
105
|
-
# - label_ids (array)
|
106
|
-
# * List of IDs of labels to add to this message
|
107
|
-
#
|
108
|
-
# - vars (Hash)
|
109
|
-
# * Custom variables to store with the message
|
110
|
-
#
|
111
|
-
# - priority (int)
|
112
|
-
# * Priority of the message (currently only observed for Android phones). Telerivet
|
113
|
-
# will attempt to send messages with higher priority numbers first (for example, so
|
114
|
-
# you can prioritize an auto-reply ahead of a bulk message to a large group).
|
115
|
-
# * Default: 1
|
116
133
|
#
|
117
134
|
# Returns:
|
118
135
|
# Telerivet::Message
|
@@ -124,16 +141,21 @@ class Project < Entity
|
|
124
141
|
|
125
142
|
#
|
126
143
|
# Sends a text message (optionally with mail-merge templates) or voice call to a group or a
|
127
|
-
# list of up to 500 phone numbers
|
144
|
+
# list of up to 500 phone numbers.
|
145
|
+
#
|
146
|
+
# With `message_type`=`service`, invokes an automated service (such as
|
147
|
+
# a poll) for a group or list of phone numbers. Any service that can be triggered for a
|
148
|
+
# contact can be invoked via this method, whether or not the service actually sends a message.
|
128
149
|
#
|
129
150
|
# Arguments:
|
130
151
|
# - options (Hash)
|
131
152
|
# * Required
|
132
153
|
#
|
133
154
|
# - message_type
|
134
|
-
# * Type of message to send
|
135
|
-
#
|
136
|
-
# *
|
155
|
+
# * Type of message to send. If `text`, will use the default text message type for the
|
156
|
+
# selected route.
|
157
|
+
# * Allowed values: sms, mms, call, service, text
|
158
|
+
# * Default: text
|
137
159
|
#
|
138
160
|
# - content
|
139
161
|
# * Content of the message to send
|
@@ -155,9 +177,42 @@ class Project < Entity
|
|
155
177
|
# * Title of the broadcast. If a title is not provided, a title will automatically be
|
156
178
|
# generated from the recipient group name or phone numbers.
|
157
179
|
#
|
180
|
+
# - status_url
|
181
|
+
# * Webhook callback URL to be notified when message status changes
|
182
|
+
#
|
183
|
+
# - status_secret
|
184
|
+
# * POST parameter 'secret' passed to status_url
|
185
|
+
#
|
186
|
+
# - label_ids (array)
|
187
|
+
# * Array of IDs of labels to add to all messages sent (maximum 5). Does not apply
|
188
|
+
# when `message_type`=`service`, since the labels are determined by the service
|
189
|
+
# itself.
|
190
|
+
#
|
191
|
+
# - exclude_contact_id
|
192
|
+
# * Optionally excludes one contact from receiving the message (only when group_id is
|
193
|
+
# set)
|
194
|
+
#
|
195
|
+
# - is_template (bool)
|
196
|
+
# * Set to true to evaluate variables like [[contact.name]] in message content [(See
|
197
|
+
# available variables)](#variables)
|
198
|
+
# * Default: false
|
199
|
+
#
|
200
|
+
# - track_clicks (boolean)
|
201
|
+
# * If true, URLs in the message content will automatically be replaced with unique
|
202
|
+
# short URLs.
|
203
|
+
# * Default: false
|
204
|
+
#
|
205
|
+
# - media_urls (array)
|
206
|
+
# * URLs of media files to attach to the text message. If `message_type` is `sms`,
|
207
|
+
# short links to each URL will be appended to the end of the content (separated by a
|
208
|
+
# new line).
|
209
|
+
#
|
210
|
+
# - vars (Hash)
|
211
|
+
# * Custom variables to set for each message
|
212
|
+
#
|
158
213
|
# - service_id
|
159
|
-
# * Service
|
160
|
-
#
|
214
|
+
# * Service to invoke for each recipient (when `message_type` is `call` or `service`)
|
215
|
+
# * Required if message_type is service
|
161
216
|
#
|
162
217
|
# - audio_url
|
163
218
|
# * The URL of an MP3 file to play when the contact answers the call (when
|
@@ -180,27 +235,6 @@ class Project < Entity
|
|
180
235
|
# * The name of the text-to-speech voice (when message_type=call)
|
181
236
|
# * Allowed values: female, male
|
182
237
|
# * Default: female
|
183
|
-
#
|
184
|
-
# - status_url
|
185
|
-
# * Webhook callback URL to be notified when message status changes
|
186
|
-
#
|
187
|
-
# - status_secret
|
188
|
-
# * POST parameter 'secret' passed to status_url
|
189
|
-
#
|
190
|
-
# - label_ids (array)
|
191
|
-
# * Array of IDs of labels to add to all messages sent (maximum 5)
|
192
|
-
#
|
193
|
-
# - exclude_contact_id
|
194
|
-
# * Optionally excludes one contact from receiving the message (only when group_id is
|
195
|
-
# set)
|
196
|
-
#
|
197
|
-
# - is_template (bool)
|
198
|
-
# * Set to true to evaluate variables like [[contact.name]] in message content [(See
|
199
|
-
# available variables)](#variables)
|
200
|
-
# * Default: false
|
201
|
-
#
|
202
|
-
# - vars (Hash)
|
203
|
-
# * Custom variables to set for each message
|
204
238
|
#
|
205
239
|
# Returns:
|
206
240
|
# Telerivet::Broadcast
|
@@ -219,13 +253,17 @@ class Project < Entity
|
|
219
253
|
# * Required
|
220
254
|
#
|
221
255
|
# - messages (array)
|
222
|
-
# * Array of up to 100 objects with `content` and `to_number` properties
|
256
|
+
# * Array of up to 100 objects with `content` and `to_number` properties. Each object
|
257
|
+
# may also contain the optional properties `status_url`, `status_secret`, `vars`,
|
258
|
+
# and/or `priority`, which override the parameters of the same name defined below, to
|
259
|
+
# allow passing different values for each message.
|
223
260
|
# * Required
|
224
261
|
#
|
225
262
|
# - message_type
|
226
|
-
# * Type of message to send
|
227
|
-
#
|
228
|
-
# *
|
263
|
+
# * Type of message to send. If `text`, will use the default text message type for the
|
264
|
+
# selected route.
|
265
|
+
# * Allowed values: sms, mms, chat, text
|
266
|
+
# * Default: text
|
229
267
|
#
|
230
268
|
# - route_id
|
231
269
|
# * ID of the phone or route to send the messages from
|
@@ -256,6 +294,26 @@ class Project < Entity
|
|
256
294
|
# * Set to true to evaluate variables like [[contact.name]] in message content [(See
|
257
295
|
# available variables)](#variables)
|
258
296
|
# * Default: false
|
297
|
+
#
|
298
|
+
# - media_urls (array)
|
299
|
+
# * URLs of media files to attach to the text message. If `message_type` is `sms`,
|
300
|
+
# short links to each media URL will be appended to the end of the content (separated
|
301
|
+
# by a new line).
|
302
|
+
#
|
303
|
+
# - vars (Hash)
|
304
|
+
# * Custom variables to store with the message
|
305
|
+
#
|
306
|
+
# - priority (int)
|
307
|
+
# * Priority of the message. Telerivet will attempt to send messages with higher
|
308
|
+
# priority numbers first (for example, so you can prioritize an auto-reply ahead of a
|
309
|
+
# bulk message to a large group).
|
310
|
+
# * Allowed values: 1, 2
|
311
|
+
# * Default: 1
|
312
|
+
#
|
313
|
+
# - simulated (bool)
|
314
|
+
# * Set to true to test the Telerivet API without actually sending a message from the
|
315
|
+
# route
|
316
|
+
# * Default: false
|
259
317
|
#
|
260
318
|
# Returns:
|
261
319
|
# (associative array)
|
@@ -314,13 +372,18 @@ class Project < Entity
|
|
314
372
|
# messages approximately once every 15 seconds, so it is not possible to control the exact
|
315
373
|
# second at which a scheduled message is sent.
|
316
374
|
#
|
375
|
+
# With `message_type`=`service`, schedules an automated service (such
|
376
|
+
# as a poll) to be invoked for a group or list of phone numbers. Any service that can be
|
377
|
+
# triggered for a contact can be scheduled via this method, whether or not the service
|
378
|
+
# actually sends a message.
|
379
|
+
#
|
317
380
|
# Arguments:
|
318
381
|
# - options (Hash)
|
319
382
|
# * Required
|
320
383
|
#
|
321
384
|
# - message_type
|
322
385
|
# * Type of message to send
|
323
|
-
# * Allowed values: sms, ussd, call
|
386
|
+
# * Allowed values: sms, ussd, call, service
|
324
387
|
# * Default: sms
|
325
388
|
#
|
326
389
|
# - content
|
@@ -354,8 +417,8 @@ class Project < Entity
|
|
354
417
|
# * Default: default sender route ID
|
355
418
|
#
|
356
419
|
# - service_id
|
357
|
-
# * Service
|
358
|
-
#
|
420
|
+
# * Service to invoke for each recipient (when `message_type` is `call` or `service`)
|
421
|
+
# * Required if message_type is service
|
359
422
|
#
|
360
423
|
# - audio_url
|
361
424
|
# * The URL of an MP3 file to play when the contact answers the call (when
|
@@ -379,12 +442,24 @@ class Project < Entity
|
|
379
442
|
# * Allowed values: female, male
|
380
443
|
# * Default: female
|
381
444
|
#
|
445
|
+
# - track_clicks (boolean)
|
446
|
+
# * If true, URLs in the message content will automatically be replaced with unique
|
447
|
+
# short URLs.
|
448
|
+
# * Default: false
|
449
|
+
#
|
382
450
|
# - is_template (bool)
|
383
451
|
# * Set to true to evaluate variables like [[contact.name]] in message content
|
384
452
|
# * Default: false
|
385
453
|
#
|
454
|
+
# - media_urls (array)
|
455
|
+
# * URLs of media files to attach to the text message. If `message_type` is `sms`,
|
456
|
+
# short links to each media URL will be appended to the end of the content (separated
|
457
|
+
# by a new line).
|
458
|
+
#
|
386
459
|
# - label_ids (array)
|
387
|
-
# * Array of IDs of labels to add to the sent messages (maximum 5)
|
460
|
+
# * Array of IDs of labels to add to the sent messages (maximum 5). Does not apply
|
461
|
+
# when `message_type`=`service`, since the labels are determined by the service
|
462
|
+
# itself.
|
388
463
|
#
|
389
464
|
# - timezone_id
|
390
465
|
# * TZ database timezone ID; see
|
@@ -397,6 +472,10 @@ class Project < Entity
|
|
397
472
|
#
|
398
473
|
# - end_time_offset (int)
|
399
474
|
# * Number of seconds from now until the recurring message will stop
|
475
|
+
#
|
476
|
+
# - vars (Hash)
|
477
|
+
# * Custom variables to set for this scheduled message, which will be copied to each
|
478
|
+
# message sent from this scheduled message
|
400
479
|
#
|
401
480
|
# Returns:
|
402
481
|
# Telerivet::ScheduledMessage
|
@@ -631,7 +710,7 @@ class Project < Entity
|
|
631
710
|
# * Default: asc
|
632
711
|
#
|
633
712
|
# - page_size (int)
|
634
|
-
# * Number of results returned per page (max
|
713
|
+
# * Number of results returned per page (max 500)
|
635
714
|
# * Default: 50
|
636
715
|
#
|
637
716
|
# - offset (int)
|
@@ -711,7 +790,7 @@ class Project < Entity
|
|
711
790
|
# * Default: asc
|
712
791
|
#
|
713
792
|
# - page_size (int)
|
714
|
-
# * Number of results returned per page (max
|
793
|
+
# * Number of results returned per page (max 500)
|
715
794
|
# * Default: 50
|
716
795
|
#
|
717
796
|
# - offset (int)
|
@@ -770,7 +849,7 @@ class Project < Entity
|
|
770
849
|
#
|
771
850
|
# - message_type
|
772
851
|
# * Filter messages by message_type
|
773
|
-
# * Allowed values: sms, mms, ussd, call
|
852
|
+
# * Allowed values: sms, mms, ussd, call, service
|
774
853
|
#
|
775
854
|
# - source
|
776
855
|
# * Filter messages by source
|
@@ -802,6 +881,9 @@ class Project < Entity
|
|
802
881
|
# - broadcast_id
|
803
882
|
# * ID of the broadcast containing the message
|
804
883
|
#
|
884
|
+
# - scheduled_id
|
885
|
+
# * ID of the scheduled message that created this message
|
886
|
+
#
|
805
887
|
# - sort
|
806
888
|
# * Sort the results based on a field
|
807
889
|
# * Allowed values: default
|
@@ -813,7 +895,7 @@ class Project < Entity
|
|
813
895
|
# * Default: asc
|
814
896
|
#
|
815
897
|
# - page_size (int)
|
816
|
-
# * Number of results returned per page (max
|
898
|
+
# * Number of results returned per page (max 500)
|
817
899
|
# * Default: 50
|
818
900
|
#
|
819
901
|
# - offset (int)
|
@@ -889,7 +971,7 @@ class Project < Entity
|
|
889
971
|
# * Default: asc
|
890
972
|
#
|
891
973
|
# - page_size (int)
|
892
|
-
# * Number of results returned per page (max
|
974
|
+
# * Number of results returned per page (max 500)
|
893
975
|
# * Default: 50
|
894
976
|
#
|
895
977
|
# - offset (int)
|
@@ -961,7 +1043,7 @@ class Project < Entity
|
|
961
1043
|
# * Default: asc
|
962
1044
|
#
|
963
1045
|
# - page_size (int)
|
964
|
-
# * Number of results returned per page (max
|
1046
|
+
# * Number of results returned per page (max 500)
|
965
1047
|
# * Default: 50
|
966
1048
|
#
|
967
1049
|
# - offset (int)
|
@@ -1046,7 +1128,7 @@ class Project < Entity
|
|
1046
1128
|
# * Default: asc
|
1047
1129
|
#
|
1048
1130
|
# - page_size (int)
|
1049
|
-
# * Number of results returned per page (max
|
1131
|
+
# * Number of results returned per page (max 500)
|
1050
1132
|
# * Default: 50
|
1051
1133
|
#
|
1052
1134
|
# - offset (int)
|
@@ -1131,7 +1213,7 @@ class Project < Entity
|
|
1131
1213
|
# * Default: asc
|
1132
1214
|
#
|
1133
1215
|
# - page_size (int)
|
1134
|
-
# * Number of results returned per page (max
|
1216
|
+
# * Number of results returned per page (max 500)
|
1135
1217
|
# * Default: 50
|
1136
1218
|
#
|
1137
1219
|
# - offset (int)
|
@@ -1202,7 +1284,7 @@ class Project < Entity
|
|
1202
1284
|
#
|
1203
1285
|
# - message_type
|
1204
1286
|
# * Filter scheduled messages by message_type
|
1205
|
-
# * Allowed values: sms, mms, ussd, call
|
1287
|
+
# * Allowed values: sms, mms, ussd, call, service
|
1206
1288
|
#
|
1207
1289
|
# - time_created (UNIX timestamp)
|
1208
1290
|
# * Filter scheduled messages by time_created
|
@@ -1224,7 +1306,7 @@ class Project < Entity
|
|
1224
1306
|
# * Default: asc
|
1225
1307
|
#
|
1226
1308
|
# - page_size (int)
|
1227
|
-
# * Number of results returned per page (max
|
1309
|
+
# * Number of results returned per page (max 500)
|
1228
1310
|
# * Default: 50
|
1229
1311
|
#
|
1230
1312
|
# - offset (int)
|
@@ -1300,7 +1382,7 @@ class Project < Entity
|
|
1300
1382
|
# * Default: asc
|
1301
1383
|
#
|
1302
1384
|
# - page_size (int)
|
1303
|
-
# * Number of results returned per page (max
|
1385
|
+
# * Number of results returned per page (max 500)
|
1304
1386
|
# * Default: 50
|
1305
1387
|
#
|
1306
1388
|
# - offset (int)
|
@@ -1369,7 +1451,7 @@ class Project < Entity
|
|
1369
1451
|
# * Default: asc
|
1370
1452
|
#
|
1371
1453
|
# - page_size (int)
|
1372
|
-
# * Number of results returned per page (max
|
1454
|
+
# * Number of results returned per page (max 500)
|
1373
1455
|
# * Default: 50
|
1374
1456
|
#
|
1375
1457
|
# - offset (int)
|
@@ -87,7 +87,7 @@ module Telerivet
|
|
87
87
|
#
|
88
88
|
# - message_type
|
89
89
|
# * Type of scheduled message
|
90
|
-
# * Allowed values: sms, ussd, call
|
90
|
+
# * Allowed values: sms, mms, ussd, call, service
|
91
91
|
# * Read-only
|
92
92
|
#
|
93
93
|
# - time_created (UNIX timestamp)
|
@@ -122,6 +122,19 @@ module Telerivet
|
|
122
122
|
# content, false otherwise
|
123
123
|
# * Read-only
|
124
124
|
#
|
125
|
+
# - track_clicks (boolean)
|
126
|
+
# * If true, URLs in the message content will automatically be replaced with unique
|
127
|
+
# short URLs
|
128
|
+
# * Read-only
|
129
|
+
#
|
130
|
+
# - media (array)
|
131
|
+
# * For text messages containing media files, this is an array of objects with the
|
132
|
+
# properties `url`, `type` (MIME type), `filename`, and `size` (file size in bytes).
|
133
|
+
# Unknown properties are null. This property is undefined for messages that do not
|
134
|
+
# contain media files. Note: For files uploaded via the Telerivet web app, the URL is
|
135
|
+
# temporary and may not be valid for more than 1 day.
|
136
|
+
# * Read-only
|
137
|
+
#
|
125
138
|
# - vars (Hash)
|
126
139
|
# * Custom variables stored for this scheduled message (copied to Message when sent)
|
127
140
|
# * Updatable via API
|
@@ -237,6 +250,14 @@ class ScheduledMessage < Entity
|
|
237
250
|
get('is_template')
|
238
251
|
end
|
239
252
|
|
253
|
+
def track_clicks
|
254
|
+
get('track_clicks')
|
255
|
+
end
|
256
|
+
|
257
|
+
def media
|
258
|
+
get('media')
|
259
|
+
end
|
260
|
+
|
240
261
|
def label_ids
|
241
262
|
get('label_ids')
|
242
263
|
end
|
data/lib/telerivet/service.rb
CHANGED
@@ -82,7 +82,9 @@ class Service < Entity
|
|
82
82
|
#
|
83
83
|
# For example, to send a poll to a particular contact (or resend the
|
84
84
|
# current question), you can invoke the poll service with context=contact, and `contact_id` as
|
85
|
-
# the ID of the contact to send the poll to.
|
85
|
+
# the ID of the contact to send the poll to. (To trigger a service to multiple contacts, use
|
86
|
+
# [project.sendBroadcast](#Project.sendBroadcast). To schedule a service in the future, use
|
87
|
+
# [project.scheduleMessage](#Project.scheduleMessage).)
|
86
88
|
#
|
87
89
|
# Or, to manually apply a service for an incoming message, you can
|
88
90
|
# invoke the service with `context`=`message`, `event`=`incoming_message`, and `message_id` as
|
@@ -223,7 +225,7 @@ class Service < Entity
|
|
223
225
|
# * Default: asc
|
224
226
|
#
|
225
227
|
# - page_size (int)
|
226
|
-
# * Number of results returned per page (max
|
228
|
+
# * Number of results returned per page (max 500)
|
227
229
|
# * Default: 50
|
228
230
|
#
|
229
231
|
# - offset (int)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: telerivet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jesse Young
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby client library for Telerivet REST API
|
14
14
|
email: support@telerivet.com
|
@@ -53,8 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
requirements: []
|
56
|
-
|
57
|
-
rubygems_version: 2.6.7
|
56
|
+
rubygems_version: 3.0.3
|
58
57
|
signing_key:
|
59
58
|
specification_version: 4
|
60
59
|
summary: Telerivet REST API Client
|