telerivet 1.4.5 → 1.7.0
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 +155 -0
- data/lib/telerivet/apicursor.rb +26 -22
- data/lib/telerivet/broadcast.rb +16 -5
- data/lib/telerivet/contact.rb +38 -14
- data/lib/telerivet/datatable.rb +20 -8
- data/lib/telerivet/group.rb +18 -18
- data/lib/telerivet/label.rb +12 -3
- data/lib/telerivet/message.rb +77 -35
- data/lib/telerivet/organization.rb +124 -2
- data/lib/telerivet/phone.rb +21 -10
- data/lib/telerivet/project.rb +1237 -49
- data/lib/telerivet/relativescheduledmessage.rb +361 -0
- data/lib/telerivet/route.rb +1 -1
- data/lib/telerivet/scheduledmessage.rb +112 -22
- data/lib/telerivet/service.rb +175 -38
- data/lib/telerivet/task.rb +151 -0
- data/lib/telerivet.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2276ff47e23f0670121a7295c0cf3d860740ebb0c1980de13e15ae2f25c2659d
|
4
|
+
data.tar.gz: 55db2507c8bcfa9f8ed0c3102f830dea689fd57ef57d0a00f1b488eebf46f4b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdd68937b393e61a1ec76e536b0abfcf30e3bb16127b2ea6a37f221013c8ee9d43aa99f5bf758eeb70d04c0366ffcfe1a2e4af576d0620507412b92ac8ceeab7
|
7
|
+
data.tar.gz: 50cf5362c2926a104d8e1d6cd15ee5473589cdf31e78e516f9e6ad1af335baec040de5b5cf8598dc8e95008e08fe9775a448da465fffc708030b8e217d86e52a
|
@@ -0,0 +1,155 @@
|
|
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
|
+
# - time_created (UNIX timestamp)
|
32
|
+
# * The time that the airtime transaction was created on Telerivet's servers
|
33
|
+
# * Read-only
|
34
|
+
#
|
35
|
+
# - transaction_time (UNIX timestamp)
|
36
|
+
# * The time that the airtime transaction was sent, or null if it has not been sent
|
37
|
+
# * Read-only
|
38
|
+
#
|
39
|
+
# - status
|
40
|
+
# * Current status of airtime transaction (`successful`, `failed`, `cancelled`,
|
41
|
+
# `queued`, `pending_approval`, or `pending_payment`)
|
42
|
+
# * Read-only
|
43
|
+
#
|
44
|
+
# - status_text
|
45
|
+
# * Error or success message returned by airtime provider, if available
|
46
|
+
# * Read-only
|
47
|
+
#
|
48
|
+
# - value
|
49
|
+
# * Value of airtime sent to destination phone number, in units of value_currency
|
50
|
+
# * Read-only
|
51
|
+
#
|
52
|
+
# - value_currency
|
53
|
+
# * Currency code of price
|
54
|
+
# * Read-only
|
55
|
+
#
|
56
|
+
# - price
|
57
|
+
# * Price charged for airtime transaction, in units of price_currency
|
58
|
+
# * Read-only
|
59
|
+
#
|
60
|
+
# - price_currency
|
61
|
+
# * Currency code of price
|
62
|
+
# * Read-only
|
63
|
+
#
|
64
|
+
# - contact_id
|
65
|
+
# * ID of the contact the airtime was sent to
|
66
|
+
# * Read-only
|
67
|
+
#
|
68
|
+
# - service_id
|
69
|
+
# * ID of the service that sent the airtime
|
70
|
+
# * Read-only
|
71
|
+
#
|
72
|
+
# - project_id
|
73
|
+
# * ID of the project that the airtime transaction belongs to
|
74
|
+
# * Read-only
|
75
|
+
#
|
76
|
+
# - external_id
|
77
|
+
# * The ID of this transaction from an external airtime gateway provider, if available.
|
78
|
+
# * Read-only
|
79
|
+
#
|
80
|
+
# - vars (Hash)
|
81
|
+
# * Custom variables stored for this transaction
|
82
|
+
# * Updatable via API
|
83
|
+
#
|
84
|
+
class AirtimeTransaction < Entity
|
85
|
+
def id
|
86
|
+
get('id')
|
87
|
+
end
|
88
|
+
|
89
|
+
def to_number
|
90
|
+
get('to_number')
|
91
|
+
end
|
92
|
+
|
93
|
+
def operator_name
|
94
|
+
get('operator_name')
|
95
|
+
end
|
96
|
+
|
97
|
+
def country
|
98
|
+
get('country')
|
99
|
+
end
|
100
|
+
|
101
|
+
def time_created
|
102
|
+
get('time_created')
|
103
|
+
end
|
104
|
+
|
105
|
+
def transaction_time
|
106
|
+
get('transaction_time')
|
107
|
+
end
|
108
|
+
|
109
|
+
def status
|
110
|
+
get('status')
|
111
|
+
end
|
112
|
+
|
113
|
+
def status_text
|
114
|
+
get('status_text')
|
115
|
+
end
|
116
|
+
|
117
|
+
def value
|
118
|
+
get('value')
|
119
|
+
end
|
120
|
+
|
121
|
+
def value_currency
|
122
|
+
get('value_currency')
|
123
|
+
end
|
124
|
+
|
125
|
+
def price
|
126
|
+
get('price')
|
127
|
+
end
|
128
|
+
|
129
|
+
def price_currency
|
130
|
+
get('price_currency')
|
131
|
+
end
|
132
|
+
|
133
|
+
def contact_id
|
134
|
+
get('contact_id')
|
135
|
+
end
|
136
|
+
|
137
|
+
def service_id
|
138
|
+
get('service_id')
|
139
|
+
end
|
140
|
+
|
141
|
+
def project_id
|
142
|
+
get('project_id')
|
143
|
+
end
|
144
|
+
|
145
|
+
def external_id
|
146
|
+
get('external_id')
|
147
|
+
end
|
148
|
+
|
149
|
+
def get_base_api_path()
|
150
|
+
"/projects/#{get('project_id')}/airtime_transactions/#{get('id')}"
|
151
|
+
end
|
152
|
+
|
153
|
+
end
|
154
|
+
|
155
|
+
end
|
data/lib/telerivet/apicursor.rb
CHANGED
@@ -13,16 +13,16 @@ class APICursor
|
|
13
13
|
|
14
14
|
def initialize(api, item_cls, path, params = nil)
|
15
15
|
params ||= {}
|
16
|
-
|
16
|
+
|
17
17
|
if params.has_key?('count')
|
18
18
|
raise Exception, "Cannot construct APICursor with 'count' parameter. Call the count() method instead."
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
@api = api
|
22
22
|
@item_cls = item_cls
|
23
23
|
@path = path
|
24
24
|
@params = params
|
25
|
-
|
25
|
+
|
26
26
|
@count = -1
|
27
27
|
@pos = nil
|
28
28
|
@data = nil
|
@@ -31,15 +31,15 @@ class APICursor
|
|
31
31
|
@limit = nil
|
32
32
|
@offset = 0
|
33
33
|
end
|
34
|
-
|
34
|
+
|
35
35
|
def each()
|
36
36
|
loop do
|
37
37
|
item = self.next()
|
38
|
-
return if item == nil
|
38
|
+
return if item == nil
|
39
39
|
yield item
|
40
40
|
end
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
43
|
#
|
44
44
|
# Limits the maximum number of entities fetched by this query.
|
45
45
|
#
|
@@ -60,7 +60,7 @@ class APICursor
|
|
60
60
|
@limit = _limit
|
61
61
|
self
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
#
|
65
65
|
# Returns the total count of entities matching the current query, without actually fetching
|
66
66
|
# the entities themselves.
|
@@ -76,13 +76,13 @@ class APICursor
|
|
76
76
|
if @count == -1
|
77
77
|
params = @params.clone
|
78
78
|
params['count'] = 1
|
79
|
-
|
79
|
+
|
80
80
|
res = @api.do_request("GET", @path, params)
|
81
81
|
@count = res['count'].to_i
|
82
82
|
end
|
83
83
|
@count
|
84
84
|
end
|
85
|
-
|
85
|
+
|
86
86
|
def all()
|
87
87
|
to_a
|
88
88
|
end
|
@@ -97,37 +97,41 @@ class APICursor
|
|
97
97
|
return false if @limit != nil && @offset >= @limit
|
98
98
|
|
99
99
|
load_next_page() if @data == nil
|
100
|
-
|
100
|
+
|
101
101
|
return true if @pos < @data.length
|
102
|
-
|
102
|
+
|
103
103
|
return false if !@truncated
|
104
|
-
|
104
|
+
|
105
105
|
load_next_page()
|
106
|
-
|
106
|
+
|
107
107
|
@pos < @data.length
|
108
108
|
end
|
109
|
-
|
109
|
+
|
110
110
|
#
|
111
111
|
# Returns the next entity in the result set.
|
112
112
|
#
|
113
113
|
# Returns:
|
114
114
|
# Telerivet::Entity
|
115
115
|
#
|
116
|
-
def next()
|
116
|
+
def next()
|
117
117
|
if @limit != nil && @offset >= @limit
|
118
118
|
return nil
|
119
119
|
end
|
120
|
-
|
120
|
+
|
121
121
|
if @data == nil || (@pos >= @data.length && @truncated)
|
122
122
|
load_next_page()
|
123
123
|
end
|
124
|
-
|
124
|
+
|
125
125
|
if @pos < @data.length
|
126
126
|
item_data = @data[@pos]
|
127
127
|
@pos += 1
|
128
128
|
@offset += 1
|
129
129
|
cls = @item_cls
|
130
|
-
|
130
|
+
if cls
|
131
|
+
return cls.new(@api, item_data, true)
|
132
|
+
else
|
133
|
+
return item_data
|
134
|
+
end
|
131
135
|
else
|
132
136
|
return nil
|
133
137
|
end
|
@@ -135,17 +139,17 @@ class APICursor
|
|
135
139
|
|
136
140
|
def load_next_page()
|
137
141
|
request_params = @params.clone
|
138
|
-
|
142
|
+
|
139
143
|
if @next_marker != nil
|
140
144
|
request_params['marker'] = @next_marker
|
141
145
|
end
|
142
|
-
|
146
|
+
|
143
147
|
if @limit != nil && !request_params.has_key?("page_size")
|
144
148
|
request_params['page_size'] = [@limit, 200].min
|
145
149
|
end
|
146
|
-
|
150
|
+
|
147
151
|
response = @api.do_request("GET", @path, request_params)
|
148
|
-
|
152
|
+
|
149
153
|
@data = response['data']
|
150
154
|
@truncated = response['truncated']
|
151
155
|
@next_marker = response['next_marker']
|
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, service
|
78
|
+
# * Allowed values: sms, mms, ussd, ussd_session, call, chat, service
|
79
79
|
# * Read-only
|
80
80
|
#
|
81
81
|
# - content (string)
|
@@ -97,7 +97,7 @@ module Telerivet
|
|
97
97
|
# * Allowed values: female, male
|
98
98
|
# * Read-only
|
99
99
|
#
|
100
|
-
# -
|
100
|
+
# - replace_variables (bool)
|
101
101
|
# * Set to true if Telerivet will render variables like [[contact.name]] in the message
|
102
102
|
# content, false otherwise
|
103
103
|
# * Read-only
|
@@ -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
|
@@ -250,8 +257,8 @@ class Broadcast < Entity
|
|
250
257
|
get('tts_voice')
|
251
258
|
end
|
252
259
|
|
253
|
-
def
|
254
|
-
get('
|
260
|
+
def replace_variables
|
261
|
+
get('replace_variables')
|
255
262
|
end
|
256
263
|
|
257
264
|
def status
|
@@ -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)
|
@@ -58,8 +63,8 @@ module Telerivet
|
|
58
63
|
# * Read-only
|
59
64
|
#
|
60
65
|
# - default_route_id
|
61
|
-
# * ID of the phone or route that Telerivet will use by default to
|
62
|
-
# contact (null if using project default route)
|
66
|
+
# * ID of the basic route (phone) or custom route that Telerivet will use by default to
|
67
|
+
# send messages to this contact (null if using project default route)
|
63
68
|
# * Updatable via API
|
64
69
|
#
|
65
70
|
# - group_ids (array of strings)
|
@@ -129,11 +134,12 @@ class Contact < Entity
|
|
129
134
|
#
|
130
135
|
# - message_type
|
131
136
|
# * Filter messages by message_type
|
132
|
-
# * Allowed values: sms, mms, ussd, call, service
|
137
|
+
# * Allowed values: sms, mms, ussd, ussd_session, call, chat, service
|
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
|
@@ -239,20 +253,22 @@ class Contact < Entity
|
|
239
253
|
#
|
240
254
|
# - message_type
|
241
255
|
# * Filter scheduled messages by message_type
|
242
|
-
# * Allowed values: sms, mms, ussd, call, service
|
256
|
+
# * Allowed values: sms, mms, ussd, ussd_session, call, chat, service
|
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
|
-
#
|
264
|
+
# * Allowed modifiers: next_time[min], next_time[max], next_time[exists]
|
265
|
+
#
|
266
|
+
# - relative_scheduled_id
|
267
|
+
# * Filter scheduled messages created for a relative scheduled message
|
252
268
|
#
|
253
269
|
# - sort
|
254
270
|
# * Sort the results based on a field
|
255
|
-
# * Allowed values: default,
|
271
|
+
# * Allowed values: default, next_time
|
256
272
|
# * Default: default
|
257
273
|
#
|
258
274
|
# - sort_dir
|
@@ -284,7 +300,7 @@ class Contact < Entity
|
|
284
300
|
#
|
285
301
|
# - time_created (UNIX timestamp)
|
286
302
|
# * Filter data rows by the time they were created
|
287
|
-
# * Allowed modifiers: time_created[
|
303
|
+
# * Allowed modifiers: time_created[min], time_created[max]
|
288
304
|
#
|
289
305
|
# - sort
|
290
306
|
# * Sort the results based on a field
|
@@ -325,9 +341,9 @@ class Contact < Entity
|
|
325
341
|
#
|
326
342
|
# - vars (Hash)
|
327
343
|
# * 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][
|
344
|
+
# * Allowed modifiers: vars[foo][ne], vars[foo][prefix], vars[foo][not_prefix],
|
345
|
+
# vars[foo][gte], vars[foo][gt], vars[foo][lt], vars[foo][lte], vars[foo][min],
|
346
|
+
# vars[foo][max], vars[foo][exists]
|
331
347
|
#
|
332
348
|
# - sort
|
333
349
|
# * Sort the results based on a field
|
@@ -405,6 +421,14 @@ class Contact < Entity
|
|
405
421
|
set('send_blocked', value)
|
406
422
|
end
|
407
423
|
|
424
|
+
def conversation_status
|
425
|
+
get('conversation_status')
|
426
|
+
end
|
427
|
+
|
428
|
+
def conversation_status=(value)
|
429
|
+
set('conversation_status', value)
|
430
|
+
end
|
431
|
+
|
408
432
|
def last_message_time
|
409
433
|
get('last_message_time')
|
410
434
|
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, secret, phone_number, email, url, audio, date,
|
180
|
+
# date_time, number, boolean, checkbox, select, radio
|
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
|
@@ -126,20 +124,22 @@ class Group < Entity
|
|
126
124
|
#
|
127
125
|
# - message_type
|
128
126
|
# * Filter scheduled messages by message_type
|
129
|
-
# * Allowed values: sms, mms, ussd, call, service
|
127
|
+
# * Allowed values: sms, mms, ussd, ussd_session, call, chat, service
|
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
|
-
#
|
135
|
+
# * Allowed modifiers: next_time[min], next_time[max], next_time[exists]
|
136
|
+
#
|
137
|
+
# - relative_scheduled_id
|
138
|
+
# * Filter scheduled messages created for a relative scheduled message
|
139
139
|
#
|
140
140
|
# - sort
|
141
141
|
# * Sort the results based on a field
|
142
|
-
# * Allowed values: default,
|
142
|
+
# * Allowed values: default, next_time
|
143
143
|
# * Default: default
|
144
144
|
#
|
145
145
|
# - sort_dir
|