telerivet 1.4.5 → 1.6.1
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 +139 -0
- data/lib/telerivet/broadcast.rb +12 -1
- data/lib/telerivet/contact.rb +31 -10
- data/lib/telerivet/datatable.rb +20 -8
- data/lib/telerivet/group.rb +14 -17
- data/lib/telerivet/label.rb +11 -2
- data/lib/telerivet/message.rb +52 -32
- data/lib/telerivet/organization.rb +80 -0
- data/lib/telerivet/phone.rb +11 -2
- data/lib/telerivet/project.rb +683 -22
- data/lib/telerivet/scheduledmessage.rb +11 -0
- data/lib/telerivet/service.rb +45 -7
- data/lib/telerivet/task.rb +151 -0
- data/lib/telerivet.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 303a6df0ce9d23233621cac3732ab09afb1b9bf968d784441e29bd343a4ec105
|
4
|
+
data.tar.gz: fad6a45b9e7b0cd84668f49a129a6600b3fcd4898b18d193d476deede36c9323
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b030343b0e5d79d4c1d520d348baccfe77a7d171fab5b86f1f3a0b16e914f82ad3c5eab796fd2ddcec3480a1f952e030208f5db2eaaa568b3eb079fddbaa1ca
|
7
|
+
data.tar.gz: a8c12e9cfbb08f568f40cb4647646d033aa55d1864b1acd28219ff27d587d04ef2bff994b8aa0ab43c3082446de03bebe2ad90a99ba25a22ea40700505954e68
|
@@ -0,0 +1,139 @@
|
|
1
|
+
|
2
|
+
module Telerivet
|
3
|
+
|
4
|
+
#
|
5
|
+
# Represents a transaction where airtime is sent to a mobile phone number.
|
6
|
+
#
|
7
|
+
# To send airtime, first [create a Custom Actions service to send a particular amount of
|
8
|
+
# airtime](/dashboard/add_service?subtype_id=main.service.rules.contact&action_id=main.rule.sendairtime),
|
9
|
+
# then trigger the service using [service.invoke](#Service.invoke),
|
10
|
+
# [project.sendBroadcast](#Project.sendBroadcast), or
|
11
|
+
# [project.scheduleMessage](#Project.scheduleMessage).
|
12
|
+
#
|
13
|
+
# Fields:
|
14
|
+
#
|
15
|
+
# - id
|
16
|
+
# * ID of the airtime transaction
|
17
|
+
# * Read-only
|
18
|
+
#
|
19
|
+
# - to_number
|
20
|
+
# * Destination phone number in international format (no leading +)
|
21
|
+
# * Read-only
|
22
|
+
#
|
23
|
+
# - operator_name
|
24
|
+
# * Operator name
|
25
|
+
# * Read-only
|
26
|
+
#
|
27
|
+
# - country
|
28
|
+
# * Country code
|
29
|
+
# * Read-only
|
30
|
+
#
|
31
|
+
# - status
|
32
|
+
# * Current status of airtime transaction (`successful`, `failed`, `cancelled`,
|
33
|
+
# `queued`, `pending_approval`, or `pending_payment`)
|
34
|
+
# * Read-only
|
35
|
+
#
|
36
|
+
# - status_text
|
37
|
+
# * Error or success message returned by airtime provider, if available
|
38
|
+
# * Read-only
|
39
|
+
#
|
40
|
+
# - value
|
41
|
+
# * Value of airtime sent to destination phone number, in units of value_currency
|
42
|
+
# * Read-only
|
43
|
+
#
|
44
|
+
# - value_currency
|
45
|
+
# * Currency code of price
|
46
|
+
# * Read-only
|
47
|
+
#
|
48
|
+
# - price
|
49
|
+
# * Price charged for airtime transaction, in units of price_currency
|
50
|
+
# * Read-only
|
51
|
+
#
|
52
|
+
# - price_currency
|
53
|
+
# * Currency code of price
|
54
|
+
# * Read-only
|
55
|
+
#
|
56
|
+
# - contact_id
|
57
|
+
# * ID of the contact the airtime was sent to
|
58
|
+
# * Read-only
|
59
|
+
#
|
60
|
+
# - service_id
|
61
|
+
# * ID of the service that sent the airtime
|
62
|
+
# * Read-only
|
63
|
+
#
|
64
|
+
# - project_id
|
65
|
+
# * ID of the project that the airtime transaction belongs to
|
66
|
+
# * Read-only
|
67
|
+
#
|
68
|
+
# - external_id
|
69
|
+
# * The ID of this transaction from an external airtime gateway provider, if available.
|
70
|
+
# * Read-only
|
71
|
+
#
|
72
|
+
# - vars (Hash)
|
73
|
+
# * Custom variables stored for this transaction
|
74
|
+
# * Updatable via API
|
75
|
+
#
|
76
|
+
class AirtimeTransaction < Entity
|
77
|
+
def id
|
78
|
+
get('id')
|
79
|
+
end
|
80
|
+
|
81
|
+
def to_number
|
82
|
+
get('to_number')
|
83
|
+
end
|
84
|
+
|
85
|
+
def operator_name
|
86
|
+
get('operator_name')
|
87
|
+
end
|
88
|
+
|
89
|
+
def country
|
90
|
+
get('country')
|
91
|
+
end
|
92
|
+
|
93
|
+
def status
|
94
|
+
get('status')
|
95
|
+
end
|
96
|
+
|
97
|
+
def status_text
|
98
|
+
get('status_text')
|
99
|
+
end
|
100
|
+
|
101
|
+
def value
|
102
|
+
get('value')
|
103
|
+
end
|
104
|
+
|
105
|
+
def value_currency
|
106
|
+
get('value_currency')
|
107
|
+
end
|
108
|
+
|
109
|
+
def price
|
110
|
+
get('price')
|
111
|
+
end
|
112
|
+
|
113
|
+
def price_currency
|
114
|
+
get('price_currency')
|
115
|
+
end
|
116
|
+
|
117
|
+
def contact_id
|
118
|
+
get('contact_id')
|
119
|
+
end
|
120
|
+
|
121
|
+
def service_id
|
122
|
+
get('service_id')
|
123
|
+
end
|
124
|
+
|
125
|
+
def project_id
|
126
|
+
get('project_id')
|
127
|
+
end
|
128
|
+
|
129
|
+
def external_id
|
130
|
+
get('external_id')
|
131
|
+
end
|
132
|
+
|
133
|
+
def get_base_api_path()
|
134
|
+
"/projects/#{get('project_id')}/airtime_transactions/#{get('id')}"
|
135
|
+
end
|
136
|
+
|
137
|
+
end
|
138
|
+
|
139
|
+
end
|
data/lib/telerivet/broadcast.rb
CHANGED
@@ -109,7 +109,7 @@ module Telerivet
|
|
109
109
|
#
|
110
110
|
# - source
|
111
111
|
# * How the message originated within Telerivet
|
112
|
-
# * Allowed values: phone, provider, web, api, service, webhook, scheduled
|
112
|
+
# * Allowed values: phone, provider, web, api, service, webhook, scheduled, integration
|
113
113
|
# * Read-only
|
114
114
|
#
|
115
115
|
# - simulated (bool)
|
@@ -144,6 +144,13 @@ module Telerivet
|
|
144
144
|
# * Custom variables stored for this broadcast
|
145
145
|
# * Read-only
|
146
146
|
#
|
147
|
+
# - route_params (Hash)
|
148
|
+
# * Route-specific parameters for the messages in the broadcast. The parameters object
|
149
|
+
# may have keys matching the `phone_type` field of a phone (basic route) that may be
|
150
|
+
# used to send messages in this broadcast. The corresponding value is an object with
|
151
|
+
# route-specific parameters to use when sending messages with that type of route.
|
152
|
+
# * Read-only
|
153
|
+
#
|
147
154
|
# - price (number)
|
148
155
|
# * The total price of all messages in this broadcast, if known.
|
149
156
|
# * Read-only
|
@@ -282,6 +289,10 @@ class Broadcast < Entity
|
|
282
289
|
get('media')
|
283
290
|
end
|
284
291
|
|
292
|
+
def route_params
|
293
|
+
get('route_params')
|
294
|
+
end
|
295
|
+
|
285
296
|
def price
|
286
297
|
get('price')
|
287
298
|
end
|
data/lib/telerivet/contact.rb
CHANGED
@@ -27,6 +27,11 @@ module Telerivet
|
|
27
27
|
# * True if Telerivet is blocked from sending messages to this contact
|
28
28
|
# * Updatable via API
|
29
29
|
#
|
30
|
+
# - conversation_status
|
31
|
+
# * Current status of the conversation with this contact
|
32
|
+
# * Allowed values: closed, active, handled
|
33
|
+
# * Updatable via API
|
34
|
+
#
|
30
35
|
# - last_message_time (UNIX timestamp)
|
31
36
|
# * Last time the contact sent or received a message (null if no messages have been sent
|
32
37
|
# or received)
|
@@ -133,7 +138,8 @@ class Contact < Entity
|
|
133
138
|
#
|
134
139
|
# - source
|
135
140
|
# * Filter messages by source
|
136
|
-
# * Allowed values: phone, provider, web, api, service, webhook, scheduled
|
141
|
+
# * Allowed values: phone, provider, web, api, service, webhook, scheduled,
|
142
|
+
# integration
|
137
143
|
#
|
138
144
|
# - starred (bool)
|
139
145
|
# * Filter messages by starred/unstarred
|
@@ -141,7 +147,7 @@ class Contact < Entity
|
|
141
147
|
# - status
|
142
148
|
# * Filter messages by status
|
143
149
|
# * Allowed values: ignored, processing, received, sent, queued, failed,
|
144
|
-
# failed_queued, cancelled, delivered, not_delivered
|
150
|
+
# failed_queued, cancelled, delivered, not_delivered, read
|
145
151
|
#
|
146
152
|
# - time_created[min] (UNIX timestamp)
|
147
153
|
# * Filter messages created on or after a particular time
|
@@ -151,18 +157,26 @@ class Contact < Entity
|
|
151
157
|
#
|
152
158
|
# - external_id
|
153
159
|
# * Filter messages by ID from an external provider
|
160
|
+
# * Allowed modifiers: external_id[ne], external_id[exists]
|
154
161
|
#
|
155
162
|
# - contact_id
|
156
163
|
# * ID of the contact who sent/received the message
|
164
|
+
# * Allowed modifiers: contact_id[ne], contact_id[exists]
|
157
165
|
#
|
158
166
|
# - phone_id
|
159
167
|
# * ID of the phone (basic route) that sent/received the message
|
160
168
|
#
|
161
169
|
# - broadcast_id
|
162
170
|
# * ID of the broadcast containing the message
|
171
|
+
# * Allowed modifiers: broadcast_id[ne], broadcast_id[exists]
|
163
172
|
#
|
164
173
|
# - scheduled_id
|
165
174
|
# * ID of the scheduled message that created this message
|
175
|
+
# * Allowed modifiers: scheduled_id[ne], scheduled_id[exists]
|
176
|
+
#
|
177
|
+
# - group_id
|
178
|
+
# * Filter messages sent or received by contacts in a particular group. The group must
|
179
|
+
# be a normal group, not a dynamic group.
|
166
180
|
#
|
167
181
|
# - sort
|
168
182
|
# * Sort the results based on a field
|
@@ -243,16 +257,15 @@ class Contact < Entity
|
|
243
257
|
#
|
244
258
|
# - time_created (UNIX timestamp)
|
245
259
|
# * Filter scheduled messages by time_created
|
246
|
-
# * Allowed modifiers: time_created[
|
260
|
+
# * Allowed modifiers: time_created[min], time_created[max]
|
247
261
|
#
|
248
262
|
# - next_time (UNIX timestamp)
|
249
263
|
# * Filter scheduled messages by next_time
|
250
|
-
# * Allowed modifiers: next_time[
|
251
|
-
# next_time[max]
|
264
|
+
# * Allowed modifiers: next_time[min], next_time[max], next_time[exists]
|
252
265
|
#
|
253
266
|
# - sort
|
254
267
|
# * Sort the results based on a field
|
255
|
-
# * Allowed values: default,
|
268
|
+
# * Allowed values: default, next_time
|
256
269
|
# * Default: default
|
257
270
|
#
|
258
271
|
# - sort_dir
|
@@ -284,7 +297,7 @@ class Contact < Entity
|
|
284
297
|
#
|
285
298
|
# - time_created (UNIX timestamp)
|
286
299
|
# * Filter data rows by the time they were created
|
287
|
-
# * Allowed modifiers: time_created[
|
300
|
+
# * Allowed modifiers: time_created[min], time_created[max]
|
288
301
|
#
|
289
302
|
# - sort
|
290
303
|
# * Sort the results based on a field
|
@@ -325,9 +338,9 @@ class Contact < Entity
|
|
325
338
|
#
|
326
339
|
# - vars (Hash)
|
327
340
|
# * Filter states by value of a custom variable (e.g. vars[email], vars[foo], etc.)
|
328
|
-
# * Allowed modifiers: vars[foo][
|
329
|
-
# vars[foo][
|
330
|
-
# vars[foo][
|
341
|
+
# * Allowed modifiers: vars[foo][ne], vars[foo][prefix], vars[foo][not_prefix],
|
342
|
+
# vars[foo][gte], vars[foo][gt], vars[foo][lt], vars[foo][lte], vars[foo][min],
|
343
|
+
# vars[foo][max], vars[foo][exists]
|
331
344
|
#
|
332
345
|
# - sort
|
333
346
|
# * Sort the results based on a field
|
@@ -405,6 +418,14 @@ class Contact < Entity
|
|
405
418
|
set('send_blocked', value)
|
406
419
|
end
|
407
420
|
|
421
|
+
def conversation_status
|
422
|
+
get('conversation_status')
|
423
|
+
end
|
424
|
+
|
425
|
+
def conversation_status=(value)
|
426
|
+
set('conversation_status', value)
|
427
|
+
end
|
428
|
+
|
408
429
|
def last_message_time
|
409
430
|
get('last_message_time')
|
410
431
|
end
|
data/lib/telerivet/datatable.rb
CHANGED
@@ -22,7 +22,8 @@ module Telerivet
|
|
22
22
|
# * Updatable via API
|
23
23
|
#
|
24
24
|
# - num_rows (int)
|
25
|
-
# * Number of rows in the table
|
25
|
+
# * Number of rows in the table. For performance reasons, this number may sometimes be
|
26
|
+
# out-of-date.
|
26
27
|
# * Read-only
|
27
28
|
#
|
28
29
|
# - show_add_row (bool)
|
@@ -54,16 +55,16 @@ class DataTable < Entity
|
|
54
55
|
#
|
55
56
|
# - time_created (UNIX timestamp)
|
56
57
|
# * Filter data rows by the time they were created
|
57
|
-
# * Allowed modifiers: time_created[
|
58
|
+
# * Allowed modifiers: time_created[min], time_created[max]
|
58
59
|
#
|
59
60
|
# - contact_id
|
60
61
|
# * Filter data rows associated with a particular contact
|
61
62
|
#
|
62
63
|
# - vars (Hash)
|
63
64
|
# * Filter data rows by value of a custom variable (e.g. vars[q1], vars[foo], etc.)
|
64
|
-
# * Allowed modifiers: vars[foo][
|
65
|
-
# vars[foo][
|
66
|
-
# vars[foo][
|
65
|
+
# * Allowed modifiers: vars[foo][ne], vars[foo][prefix], vars[foo][not_prefix],
|
66
|
+
# vars[foo][gte], vars[foo][gt], vars[foo][lt], vars[foo][lte], vars[foo][min],
|
67
|
+
# vars[foo][max], vars[foo][exists]
|
67
68
|
#
|
68
69
|
# - sort
|
69
70
|
# * Sort the results based on a field
|
@@ -168,25 +169,36 @@ class DataTable < Entity
|
|
168
169
|
# * Required
|
169
170
|
#
|
170
171
|
# - options (Hash)
|
172
|
+
# * Required
|
171
173
|
#
|
172
174
|
# - name (string, max 64 characters)
|
173
175
|
# * Display name for the field
|
174
176
|
#
|
175
177
|
# - type (string)
|
176
178
|
# * Field type
|
177
|
-
# * Allowed values: text, long_text,
|
178
|
-
#
|
179
|
+
# * Allowed values: text, long_text, phone_number, email, url, audio, date, date_time,
|
180
|
+
# number, boolean, select
|
179
181
|
#
|
180
182
|
# - order (int)
|
181
183
|
# * Order in which to display the field
|
182
184
|
#
|
185
|
+
# - items (array)
|
186
|
+
# * Array of up to 100 objects containing `value` and `label` string properties to
|
187
|
+
# show in the dropdown list when type is `select`. Each `value` and `label` must be
|
188
|
+
# between 1 and 256 characters in length.
|
189
|
+
# * Required if type is `select`
|
190
|
+
#
|
183
191
|
# - readonly (bool)
|
184
192
|
# * Set to true to prevent editing the field in the Telerivet web app
|
193
|
+
#
|
194
|
+
# - lookup_key (bool)
|
195
|
+
# * Set to true to allow using this field as a lookup key when importing rows via the
|
196
|
+
# Telerivet web app
|
185
197
|
#
|
186
198
|
# Returns:
|
187
199
|
# object
|
188
200
|
#
|
189
|
-
def set_field_metadata(variable, options
|
201
|
+
def set_field_metadata(variable, options)
|
190
202
|
return @api.do_request("POST", get_base_api_path() + "/fields/#{variable}", options)
|
191
203
|
end
|
192
204
|
|
data/lib/telerivet/group.rb
CHANGED
@@ -50,28 +50,26 @@ class Group < Entity
|
|
50
50
|
# * Filter contacts by phone number
|
51
51
|
# * Allowed modifiers: phone_number[ne], phone_number[prefix],
|
52
52
|
# phone_number[not_prefix], phone_number[gte], phone_number[gt], phone_number[lt],
|
53
|
-
# phone_number[lte]
|
53
|
+
# phone_number[lte], phone_number[exists]
|
54
54
|
#
|
55
55
|
# - time_created (UNIX timestamp)
|
56
56
|
# * Filter contacts by time created
|
57
|
-
# * Allowed modifiers: time_created[
|
57
|
+
# * Allowed modifiers: time_created[min], time_created[max]
|
58
58
|
#
|
59
59
|
# - last_message_time (UNIX timestamp)
|
60
60
|
# * Filter contacts by last time a message was sent or received
|
61
|
-
# * Allowed modifiers: last_message_time[
|
62
|
-
# last_message_time[
|
61
|
+
# * Allowed modifiers: last_message_time[min], last_message_time[max],
|
62
|
+
# last_message_time[exists]
|
63
63
|
#
|
64
64
|
# - last_incoming_message_time (UNIX timestamp)
|
65
65
|
# * Filter contacts by last time a message was received
|
66
|
-
# * Allowed modifiers: last_incoming_message_time[
|
67
|
-
# last_incoming_message_time[
|
68
|
-
# last_incoming_message_time[max]
|
66
|
+
# * Allowed modifiers: last_incoming_message_time[min],
|
67
|
+
# last_incoming_message_time[max], last_incoming_message_time[exists]
|
69
68
|
#
|
70
69
|
# - last_outgoing_message_time (UNIX timestamp)
|
71
70
|
# * Filter contacts by last time a message was sent
|
72
|
-
# * Allowed modifiers: last_outgoing_message_time[
|
73
|
-
# last_outgoing_message_time[
|
74
|
-
# last_outgoing_message_time[max]
|
71
|
+
# * Allowed modifiers: last_outgoing_message_time[min],
|
72
|
+
# last_outgoing_message_time[max], last_outgoing_message_time[exists]
|
75
73
|
#
|
76
74
|
# - incoming_message_count (int)
|
77
75
|
# * Filter contacts by number of messages received from the contact
|
@@ -88,9 +86,9 @@ class Group < Entity
|
|
88
86
|
#
|
89
87
|
# - vars (Hash)
|
90
88
|
# * Filter contacts by value of a custom variable (e.g. vars[email], vars[foo], etc.)
|
91
|
-
# * Allowed modifiers: vars[foo][
|
92
|
-
# vars[foo][
|
93
|
-
# vars[foo][
|
89
|
+
# * Allowed modifiers: vars[foo][ne], vars[foo][prefix], vars[foo][not_prefix],
|
90
|
+
# vars[foo][gte], vars[foo][gt], vars[foo][lt], vars[foo][lte], vars[foo][min],
|
91
|
+
# vars[foo][max], vars[foo][exists]
|
94
92
|
#
|
95
93
|
# - sort
|
96
94
|
# * Sort the results based on a field
|
@@ -130,16 +128,15 @@ class Group < Entity
|
|
130
128
|
#
|
131
129
|
# - time_created (UNIX timestamp)
|
132
130
|
# * Filter scheduled messages by time_created
|
133
|
-
# * Allowed modifiers: time_created[
|
131
|
+
# * Allowed modifiers: time_created[min], time_created[max]
|
134
132
|
#
|
135
133
|
# - next_time (UNIX timestamp)
|
136
134
|
# * Filter scheduled messages by next_time
|
137
|
-
# * Allowed modifiers: next_time[
|
138
|
-
# next_time[max]
|
135
|
+
# * Allowed modifiers: next_time[min], next_time[max], next_time[exists]
|
139
136
|
#
|
140
137
|
# - sort
|
141
138
|
# * Sort the results based on a field
|
142
|
-
# * Allowed values: default,
|
139
|
+
# * Allowed values: default, next_time
|
143
140
|
# * Default: default
|
144
141
|
#
|
145
142
|
# - sort_dir
|
data/lib/telerivet/label.rb
CHANGED
@@ -43,7 +43,8 @@ class Label < Entity
|
|
43
43
|
#
|
44
44
|
# - source
|
45
45
|
# * Filter messages by source
|
46
|
-
# * Allowed values: phone, provider, web, api, service, webhook, scheduled
|
46
|
+
# * Allowed values: phone, provider, web, api, service, webhook, scheduled,
|
47
|
+
# integration
|
47
48
|
#
|
48
49
|
# - starred (bool)
|
49
50
|
# * Filter messages by starred/unstarred
|
@@ -51,7 +52,7 @@ class Label < Entity
|
|
51
52
|
# - status
|
52
53
|
# * Filter messages by status
|
53
54
|
# * Allowed values: ignored, processing, received, sent, queued, failed,
|
54
|
-
# failed_queued, cancelled, delivered, not_delivered
|
55
|
+
# failed_queued, cancelled, delivered, not_delivered, read
|
55
56
|
#
|
56
57
|
# - time_created[min] (UNIX timestamp)
|
57
58
|
# * Filter messages created on or after a particular time
|
@@ -61,18 +62,26 @@ class Label < Entity
|
|
61
62
|
#
|
62
63
|
# - external_id
|
63
64
|
# * Filter messages by ID from an external provider
|
65
|
+
# * Allowed modifiers: external_id[ne], external_id[exists]
|
64
66
|
#
|
65
67
|
# - contact_id
|
66
68
|
# * ID of the contact who sent/received the message
|
69
|
+
# * Allowed modifiers: contact_id[ne], contact_id[exists]
|
67
70
|
#
|
68
71
|
# - phone_id
|
69
72
|
# * ID of the phone (basic route) that sent/received the message
|
70
73
|
#
|
71
74
|
# - broadcast_id
|
72
75
|
# * ID of the broadcast containing the message
|
76
|
+
# * Allowed modifiers: broadcast_id[ne], broadcast_id[exists]
|
73
77
|
#
|
74
78
|
# - scheduled_id
|
75
79
|
# * ID of the scheduled message that created this message
|
80
|
+
# * Allowed modifiers: scheduled_id[ne], scheduled_id[exists]
|
81
|
+
#
|
82
|
+
# - group_id
|
83
|
+
# * Filter messages sent or received by contacts in a particular group. The group must
|
84
|
+
# be a normal group, not a dynamic group.
|
76
85
|
#
|
77
86
|
# - sort
|
78
87
|
# * Sort the results based on a field
|
data/lib/telerivet/message.rb
CHANGED
@@ -18,7 +18,7 @@ module Telerivet
|
|
18
18
|
# - status
|
19
19
|
# * Current status of the message
|
20
20
|
# * Allowed values: ignored, processing, received, sent, queued, failed, failed_queued,
|
21
|
-
# cancelled, delivered, not_delivered
|
21
|
+
# cancelled, delivered, not_delivered, read
|
22
22
|
# * Read-only
|
23
23
|
#
|
24
24
|
# - message_type
|
@@ -28,7 +28,7 @@ module Telerivet
|
|
28
28
|
#
|
29
29
|
# - source
|
30
30
|
# * How the message originated within Telerivet
|
31
|
-
# * Allowed values: phone, provider, web, api, service, webhook, scheduled
|
31
|
+
# * Allowed values: phone, provider, web, api, service, webhook, scheduled, integration
|
32
32
|
# * Read-only
|
33
33
|
#
|
34
34
|
# - time_created (UNIX timestamp)
|
@@ -71,6 +71,13 @@ module Telerivet
|
|
71
71
|
# * List of IDs of labels applied to this message
|
72
72
|
# * Read-only
|
73
73
|
#
|
74
|
+
# - route_params (Hash)
|
75
|
+
# * Route-specific parameters for the message. The parameters object may have keys
|
76
|
+
# matching the `phone_type` field of a phone (basic route) that may be used to send the
|
77
|
+
# message. The corresponding value is an object with route-specific parameters to use
|
78
|
+
# when the message is sent by that type of route.
|
79
|
+
# * Read-only
|
80
|
+
#
|
74
81
|
# - vars (Hash)
|
75
82
|
# * Custom variables stored for this message
|
76
83
|
# * Updatable via API
|
@@ -122,15 +129,6 @@ module Telerivet
|
|
122
129
|
# * Allowed values: female, male
|
123
130
|
# * Read-only
|
124
131
|
#
|
125
|
-
# - mms_parts (array)
|
126
|
-
# * A list of parts in the MMS message, the same as returned by the
|
127
|
-
# [getMMSParts](#Message.getMMSParts) method.
|
128
|
-
#
|
129
|
-
# Note: This property is only present when retrieving an individual
|
130
|
-
# MMS message by ID, not when querying a list of messages. In other cases, use
|
131
|
-
# [getMMSParts](#Message.getMMSParts).
|
132
|
-
# * Read-only
|
133
|
-
#
|
134
132
|
# - track_clicks (boolean)
|
135
133
|
# * If true, URLs in the message content are short URLs that redirect to a destination
|
136
134
|
# URL.
|
@@ -138,12 +136,12 @@ module Telerivet
|
|
138
136
|
#
|
139
137
|
# - short_urls (array)
|
140
138
|
# * For text messages containing short URLs, this is an array of objects with the
|
141
|
-
# properties `short_url`, `link_type`,
|
142
|
-
# clicked)
|
143
|
-
# property. If `link_type` is "media", the object also
|
144
|
-
# property (the index in the media array). If `link_type` is
|
145
|
-
# contains a `service_id` property. This property is
|
146
|
-
# contain short URLs.
|
139
|
+
# properties `short_url`, `link_type`, `time_clicked` (the first time that URL was
|
140
|
+
# clicked), and `expiration_time`. If `link_type` is "redirect", the object also
|
141
|
+
# contains a `destination_url` property. If `link_type` is "media", the object also
|
142
|
+
# contains an `media_index` property (the index in the media array). If `link_type` is
|
143
|
+
# "service", the object also contains a `service_id` property. This property is
|
144
|
+
# undefined for messages that do not contain short URLs.
|
147
145
|
# * Read-only
|
148
146
|
#
|
149
147
|
# - media (array)
|
@@ -154,6 +152,27 @@ module Telerivet
|
|
154
152
|
# temporary and may not be valid for more than 1 day.
|
155
153
|
# * Read-only
|
156
154
|
#
|
155
|
+
# - mms_parts (array)
|
156
|
+
# * A list of parts in the MMS message (only for incoming MMS messages received via
|
157
|
+
# Telerivet Gateway Android app).
|
158
|
+
#
|
159
|
+
# Each MMS part in the list is an object with the following
|
160
|
+
# properties:
|
161
|
+
#
|
162
|
+
# - cid: MMS content-id
|
163
|
+
# - type: MIME type
|
164
|
+
# - filename: original filename
|
165
|
+
# - size (int): number of bytes
|
166
|
+
# - url: URL where the content for this part is stored (secret but
|
167
|
+
# publicly accessible, so you could link/embed it in a web page without having to
|
168
|
+
# re-host it yourself)
|
169
|
+
#
|
170
|
+
# In general, the `media` property of the message is recommended for
|
171
|
+
# retrieving information about MMS media files, instead of `mms_parts`.
|
172
|
+
# The `mms_parts` property is also only present when retrieving an
|
173
|
+
# individual MMS message by ID, not when querying a list of messages.
|
174
|
+
# * Read-only
|
175
|
+
#
|
157
176
|
# - time_clicked (UNIX timestamp)
|
158
177
|
# * If the message contains any short URLs, this is the first time that a short URL in
|
159
178
|
# the message was clicked. This property is undefined for messages that do not contain
|
@@ -237,18 +256,15 @@ class Message < Entity
|
|
237
256
|
end
|
238
257
|
|
239
258
|
#
|
240
|
-
# Retrieves a list of MMS parts for this message (
|
259
|
+
# (Deprecated) Retrieves a list of MMS parts for this message (only for incoming MMS messages
|
260
|
+
# received via Telerivet Gateway Android app).
|
261
|
+
# Note: This only works for MMS messages received via the Telerivet
|
262
|
+
# Gateway Android app.
|
263
|
+
# In general, the `media` property of the message is recommended for
|
264
|
+
# retrieving information about MMS media files.
|
241
265
|
#
|
242
|
-
#
|
243
|
-
#
|
244
|
-
#
|
245
|
-
# - cid: MMS content-id
|
246
|
-
# - type: MIME type
|
247
|
-
# - filename: original filename
|
248
|
-
# - size (int): number of bytes
|
249
|
-
# - url: URL where the content for this part is stored (secret but
|
250
|
-
# publicly accessible, so you could link/embed it in a web page without having to re-host it
|
251
|
-
# yourself)
|
266
|
+
# The return value has the same format as the `mms_parts` property of
|
267
|
+
# the Message object.
|
252
268
|
#
|
253
269
|
# Returns:
|
254
270
|
# array
|
@@ -364,6 +380,10 @@ class Message < Entity
|
|
364
380
|
get('label_ids')
|
365
381
|
end
|
366
382
|
|
383
|
+
def route_params
|
384
|
+
get('route_params')
|
385
|
+
end
|
386
|
+
|
367
387
|
def priority
|
368
388
|
get('priority')
|
369
389
|
end
|
@@ -408,10 +428,6 @@ class Message < Entity
|
|
408
428
|
get('tts_voice')
|
409
429
|
end
|
410
430
|
|
411
|
-
def mms_parts
|
412
|
-
get('mms_parts')
|
413
|
-
end
|
414
|
-
|
415
431
|
def track_clicks
|
416
432
|
get('track_clicks')
|
417
433
|
end
|
@@ -424,6 +440,10 @@ class Message < Entity
|
|
424
440
|
get('media')
|
425
441
|
end
|
426
442
|
|
443
|
+
def mms_parts
|
444
|
+
get('mms_parts')
|
445
|
+
end
|
446
|
+
|
427
447
|
def time_clicked
|
428
448
|
get('time_clicked')
|
429
449
|
end
|