twilio-ruby 5.20.1 → 5.21.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +22 -0
- data/README.md +2 -2
- data/lib/twilio-ruby/rest/accounts/v1/credential.rb +4 -4
- data/lib/twilio-ruby/rest/accounts/v1/credential/aws.rb +21 -20
- data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +21 -19
- data/lib/twilio-ruby/rest/api.rb +8 -7
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +32 -28
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +56 -37
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +27 -27
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +248 -165
- data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +35 -35
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +15 -11
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +104 -114
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +4 -4
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +48 -46
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +29 -22
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +36 -28
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +35 -21
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +24 -20
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +27 -27
- data/lib/twilio-ruby/rest/authy/v1/service/entity/factor.rb +7 -0
- data/lib/twilio-ruby/rest/authy/v1/service/entity/factor/challenge.rb +7 -0
- data/lib/twilio-ruby/rest/client.rb +8 -7
- data/lib/twilio-ruby/rest/fax.rb +2 -1
- data/lib/twilio-ruby/rest/fax/v1.rb +2 -1
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +85 -75
- data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +16 -16
- data/lib/twilio-ruby/rest/verify/v1/service.rb +8 -2
- data/lib/twilio-ruby/rest/verify/v1/service/verification.rb +120 -3
- data/lib/twilio-ruby/rest/video/v1/composition.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/authy/v1/service/entity/factor/challenge_spec.rb +5 -0
- data/spec/integration/authy/v1/service/entity/factor_spec.rb +4 -0
- data/spec/integration/verify/v1/service/verification_spec.rb +107 -1
- data/spec/integration/video/v1/composition_spec.rb +28 -3
- metadata +2 -2
@@ -17,8 +17,8 @@ module Twilio
|
|
17
17
|
# Initialize the RecordingList
|
18
18
|
# @param [Version] version Version that contains the resource
|
19
19
|
# @param [String] account_sid The SID of the
|
20
|
-
# [Account](https://www.twilio.com/docs/api/rest/account) that created
|
21
|
-
#
|
20
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that created the
|
21
|
+
# Conference Recording resource.
|
22
22
|
# @param [String] conference_sid The Conference SID that identifies the conference
|
23
23
|
# associated with the recording.
|
24
24
|
# @return [RecordingList] RecordingList
|
@@ -34,9 +34,9 @@ module Twilio
|
|
34
34
|
# Lists RecordingInstance records from the API as a list.
|
35
35
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
36
36
|
# memory before returning.
|
37
|
-
# @param [Time] date_created_before The `
|
38
|
-
# @param [Time] date_created The `
|
39
|
-
# @param [Time] date_created_after The `
|
37
|
+
# @param [Time] date_created_before The `YYYY-MM-DD` value of the resources to read
|
38
|
+
# @param [Time] date_created The `YYYY-MM-DD` value of the resources to read
|
39
|
+
# @param [Time] date_created_after The `YYYY-MM-DD` value of the resources to read
|
40
40
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
41
41
|
# guarantees to never return more than limit. Default is no limit
|
42
42
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -58,9 +58,9 @@ module Twilio
|
|
58
58
|
# Streams RecordingInstance records from the API as an Enumerable.
|
59
59
|
# This operation lazily loads records as efficiently as possible until the limit
|
60
60
|
# is reached.
|
61
|
-
# @param [Time] date_created_before The `
|
62
|
-
# @param [Time] date_created The `
|
63
|
-
# @param [Time] date_created_after The `
|
61
|
+
# @param [Time] date_created_before The `YYYY-MM-DD` value of the resources to read
|
62
|
+
# @param [Time] date_created The `YYYY-MM-DD` value of the resources to read
|
63
|
+
# @param [Time] date_created_after The `YYYY-MM-DD` value of the resources to read
|
64
64
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
65
65
|
# guarantees to never return more than limit. Default is no limit.
|
66
66
|
# @param [Integer] page_size Number of records to fetch per request, when
|
@@ -98,9 +98,9 @@ module Twilio
|
|
98
98
|
##
|
99
99
|
# Retrieve a single page of RecordingInstance records from the API.
|
100
100
|
# Request is executed immediately.
|
101
|
-
# @param [Time] date_created_before The `
|
102
|
-
# @param [Time] date_created The `
|
103
|
-
# @param [Time] date_created_after The `
|
101
|
+
# @param [Time] date_created_before The `YYYY-MM-DD` value of the resources to read
|
102
|
+
# @param [Time] date_created The `YYYY-MM-DD` value of the resources to read
|
103
|
+
# @param [Time] date_created_after The `YYYY-MM-DD` value of the resources to read
|
104
104
|
# @param [String] page_token PageToken provided by the API
|
105
105
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
106
106
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
@@ -182,11 +182,11 @@ module Twilio
|
|
182
182
|
# @param [Version] version Version that contains the resource
|
183
183
|
# @param [String] account_sid The SID of the
|
184
184
|
# [Account](https://www.twilio.com/docs/api/rest/account) that created the
|
185
|
-
#
|
185
|
+
# Conference Recording resource to fetch.
|
186
186
|
# @param [String] conference_sid The Conference SID that identifies the conference
|
187
187
|
# associated with the recording to fetch.
|
188
188
|
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
189
|
-
#
|
189
|
+
# Conference Recording resource to fetch.
|
190
190
|
# @return [RecordingContext] RecordingContext
|
191
191
|
def initialize(version, account_sid, conference_sid, sid)
|
192
192
|
super(version)
|
@@ -198,10 +198,10 @@ module Twilio
|
|
198
198
|
|
199
199
|
##
|
200
200
|
# Update the RecordingInstance
|
201
|
-
# @param [recording.Status] status The new status of the
|
202
|
-
# `stopped`, `paused`,
|
201
|
+
# @param [recording.Status] status The new status of the recording. Can be:
|
202
|
+
# `stopped`, `paused`, `in-progress`.
|
203
203
|
# @param [String] pause_behavior Whether to record during a pause. Can be: `skip`
|
204
|
-
# or `silence` and the default is `silence`.
|
204
|
+
# or `silence` and the default is `silence`. `skip` does not record during the
|
205
205
|
# pause period, while `silence` will replace the actual audio of the call with
|
206
206
|
# silence during the pause period. This parameter only applies when setting
|
207
207
|
# `status` is set to `paused`.
|
@@ -273,12 +273,12 @@ module Twilio
|
|
273
273
|
# @param [Version] version Version that contains the resource
|
274
274
|
# @param [Hash] payload payload that contains response from Twilio
|
275
275
|
# @param [String] account_sid The SID of the
|
276
|
-
# [Account](https://www.twilio.com/docs/api/rest/account) that created
|
277
|
-
#
|
276
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that created the
|
277
|
+
# Conference Recording resource.
|
278
278
|
# @param [String] conference_sid The Conference SID that identifies the conference
|
279
279
|
# associated with the recording.
|
280
280
|
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
281
|
-
#
|
281
|
+
# Conference Recording resource to fetch.
|
282
282
|
# @return [RecordingInstance] RecordingInstance
|
283
283
|
def initialize(version, payload, account_sid: nil, conference_sid: nil, sid: nil)
|
284
284
|
super(version)
|
@@ -330,7 +330,7 @@ module Twilio
|
|
330
330
|
end
|
331
331
|
|
332
332
|
##
|
333
|
-
# @return [String] The SID of the Account that created
|
333
|
+
# @return [String] The SID of the Account that created the resource
|
334
334
|
def account_sid
|
335
335
|
@properties['account_sid']
|
336
336
|
end
|
@@ -342,7 +342,7 @@ module Twilio
|
|
342
342
|
end
|
343
343
|
|
344
344
|
##
|
345
|
-
# @return [String] The SID of the Call
|
345
|
+
# @return [String] The SID of the Call the resource is associated with
|
346
346
|
def call_sid
|
347
347
|
@properties['call_sid']
|
348
348
|
end
|
@@ -354,13 +354,13 @@ module Twilio
|
|
354
354
|
end
|
355
355
|
|
356
356
|
##
|
357
|
-
# @return [Time] The RFC 2822 date and time in GMT that
|
357
|
+
# @return [Time] The RFC 2822 date and time in GMT that the resource was created
|
358
358
|
def date_created
|
359
359
|
@properties['date_created']
|
360
360
|
end
|
361
361
|
|
362
362
|
##
|
363
|
-
# @return [Time] The RFC 2822 date and time in GMT that
|
363
|
+
# @return [Time] The RFC 2822 date and time in GMT that the resource was last updated
|
364
364
|
def date_updated
|
365
365
|
@properties['date_updated']
|
366
366
|
end
|
@@ -372,31 +372,31 @@ module Twilio
|
|
372
372
|
end
|
373
373
|
|
374
374
|
##
|
375
|
-
# @return [String] The length of the recording
|
375
|
+
# @return [String] The length of the recording in seconds
|
376
376
|
def duration
|
377
377
|
@properties['duration']
|
378
378
|
end
|
379
379
|
|
380
380
|
##
|
381
|
-
# @return [String] The unique string that identifies
|
381
|
+
# @return [String] The unique string that identifies the resource
|
382
382
|
def sid
|
383
383
|
@properties['sid']
|
384
384
|
end
|
385
385
|
|
386
386
|
##
|
387
|
-
# @return [String] The one-time cost of creating
|
387
|
+
# @return [String] The one-time cost of creating the recording.
|
388
388
|
def price
|
389
389
|
@properties['price']
|
390
390
|
end
|
391
391
|
|
392
392
|
##
|
393
|
-
# @return [String] The currency used in the price property
|
393
|
+
# @return [String] The currency used in the price property.
|
394
394
|
def price_unit
|
395
395
|
@properties['price_unit']
|
396
396
|
end
|
397
397
|
|
398
398
|
##
|
399
|
-
# @return [recording.Status] The status of
|
399
|
+
# @return [recording.Status] The status of the recording
|
400
400
|
def status
|
401
401
|
@properties['status']
|
402
402
|
end
|
@@ -408,35 +408,35 @@ module Twilio
|
|
408
408
|
end
|
409
409
|
|
410
410
|
##
|
411
|
-
# @return [recording.Source] How
|
411
|
+
# @return [recording.Source] How the recording was created
|
412
412
|
def source
|
413
413
|
@properties['source']
|
414
414
|
end
|
415
415
|
|
416
416
|
##
|
417
|
-
# @return [String] More information about why the recording is missing, if
|
417
|
+
# @return [String] More information about why the recording is missing, if status is `absent`.
|
418
418
|
def error_code
|
419
419
|
@properties['error_code']
|
420
420
|
end
|
421
421
|
|
422
422
|
##
|
423
|
-
# @return [Hash]
|
423
|
+
# @return [Hash] How to decrypt the recording.
|
424
424
|
def encryption_details
|
425
425
|
@properties['encryption_details']
|
426
426
|
end
|
427
427
|
|
428
428
|
##
|
429
|
-
# @return [String] The URI of
|
429
|
+
# @return [String] The URI of the resource, relative to `https://api.twilio.com`
|
430
430
|
def uri
|
431
431
|
@properties['uri']
|
432
432
|
end
|
433
433
|
|
434
434
|
##
|
435
435
|
# Update the RecordingInstance
|
436
|
-
# @param [recording.Status] status The new status of the
|
437
|
-
# `stopped`, `paused`,
|
436
|
+
# @param [recording.Status] status The new status of the recording. Can be:
|
437
|
+
# `stopped`, `paused`, `in-progress`.
|
438
438
|
# @param [String] pause_behavior Whether to record during a pause. Can be: `skip`
|
439
|
-
# or `silence` and the default is `silence`.
|
439
|
+
# or `silence` and the default is `silence`. `skip` does not record during the
|
440
440
|
# pause period, while `silence` will replace the actual audio of the call with
|
441
441
|
# silence during the pause period. This parameter only applies when setting
|
442
442
|
# `status` is set to `paused`.
|
@@ -148,8 +148,11 @@ module Twilio
|
|
148
148
|
##
|
149
149
|
# Initialize the KeyContext
|
150
150
|
# @param [Version] version Version that contains the resource
|
151
|
-
# @param [String] account_sid The
|
152
|
-
#
|
151
|
+
# @param [String] account_sid The SID of the
|
152
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that created the Key
|
153
|
+
# resource to fetch.
|
154
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the Key
|
155
|
+
# resource to fetch.
|
153
156
|
# @return [KeyContext] KeyContext
|
154
157
|
def initialize(version, account_sid, sid)
|
155
158
|
super(version)
|
@@ -176,8 +179,8 @@ module Twilio
|
|
176
179
|
|
177
180
|
##
|
178
181
|
# Update the KeyInstance
|
179
|
-
# @param [String] friendly_name A descriptive string
|
180
|
-
#
|
182
|
+
# @param [String] friendly_name A descriptive string that you create to describe
|
183
|
+
# the resource. It can be up to 64 characters long.
|
181
184
|
# @return [KeyInstance] Updated KeyInstance
|
182
185
|
def update(friendly_name: :unset)
|
183
186
|
data = Twilio::Values.of({'FriendlyName' => friendly_name, })
|
@@ -220,7 +223,8 @@ module Twilio
|
|
220
223
|
# @param [Hash] payload payload that contains response from Twilio
|
221
224
|
# @param [String] account_sid A 34 character string that uniquely identifies this
|
222
225
|
# resource.
|
223
|
-
# @param [String] sid The
|
226
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the Key
|
227
|
+
# resource to fetch.
|
224
228
|
# @return [KeyInstance] KeyInstance
|
225
229
|
def initialize(version, payload, account_sid: nil, sid: nil)
|
226
230
|
super(version)
|
@@ -250,25 +254,25 @@ module Twilio
|
|
250
254
|
end
|
251
255
|
|
252
256
|
##
|
253
|
-
# @return [String]
|
257
|
+
# @return [String] The unique string that identifies the resource
|
254
258
|
def sid
|
255
259
|
@properties['sid']
|
256
260
|
end
|
257
261
|
|
258
262
|
##
|
259
|
-
# @return [String]
|
263
|
+
# @return [String] The string that you assigned to describe the resource
|
260
264
|
def friendly_name
|
261
265
|
@properties['friendly_name']
|
262
266
|
end
|
263
267
|
|
264
268
|
##
|
265
|
-
# @return [Time] The
|
269
|
+
# @return [Time] The RFC 2822 date and time in GMT that the resource was created
|
266
270
|
def date_created
|
267
271
|
@properties['date_created']
|
268
272
|
end
|
269
273
|
|
270
274
|
##
|
271
|
-
# @return [Time] The
|
275
|
+
# @return [Time] The RFC 2822 date and time in GMT that the resource was last updated
|
272
276
|
def date_updated
|
273
277
|
@properties['date_updated']
|
274
278
|
end
|
@@ -282,8 +286,8 @@ module Twilio
|
|
282
286
|
|
283
287
|
##
|
284
288
|
# Update the KeyInstance
|
285
|
-
# @param [String] friendly_name A descriptive string
|
286
|
-
#
|
289
|
+
# @param [String] friendly_name A descriptive string that you create to describe
|
290
|
+
# the resource. It can be up to 64 characters long.
|
287
291
|
# @return [KeyInstance] Updated KeyInstance
|
288
292
|
def update(friendly_name: :unset)
|
289
293
|
context.update(friendly_name: friendly_name, )
|
@@ -15,8 +15,9 @@ module Twilio
|
|
15
15
|
##
|
16
16
|
# Initialize the MessageList
|
17
17
|
# @param [Version] version Version that contains the resource
|
18
|
-
# @param [String] account_sid The
|
19
|
-
# [Account](https://www.twilio.com/docs/api/rest/account) that sent
|
18
|
+
# @param [String] account_sid The SID of the
|
19
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that sent the message
|
20
|
+
# that created the resource.
|
20
21
|
# @return [MessageList] MessageList
|
21
22
|
def initialize(version, account_sid: nil)
|
22
23
|
super(version)
|
@@ -29,87 +30,76 @@ module Twilio
|
|
29
30
|
##
|
30
31
|
# Retrieve a single page of MessageInstance records from the API.
|
31
32
|
# Request is executed immediately.
|
32
|
-
# @param [String] to The destination phone number
|
33
|
+
# @param [String] to The destination phone number in
|
34
|
+
# [E.164](https://www.twilio.com/docs/glossary/what-e164) format for SMS/MMS or
|
35
|
+
# [Channel user
|
33
36
|
# address](https://www.twilio.com/docs/sms/channels#channel-addresses) for other
|
34
|
-
# 3rd
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
# `delivered`, or `undelivered`. Twilio will POST its [standard request
|
37
|
+
# 3rd-party channels.
|
38
|
+
# @param [String] status_callback The URL we should call using the
|
39
|
+
# `status_callback_method` to send status information to your application. If
|
40
|
+
# specified, we POST these message status changes to the URL: `queued`, `failed`,
|
41
|
+
# `sent`, `delivered`, or `undelivered`. Twilio will POST its [standard request
|
40
42
|
# parameters](https://www.twilio.com/docs/sms/twiml#request-parameters) as well as
|
41
43
|
# some additional parameters including `MessageSid`, `MessageStatus`, and
|
42
|
-
# `ErrorCode
|
43
|
-
#
|
44
|
-
# override the Status Callback URL of the [Messaging
|
44
|
+
# `ErrorCode`. If you include this parameter with the `messaging_service_sid`, we
|
45
|
+
# use this URL instead of the Status Callback URL of the [Messaging
|
45
46
|
# Service](https://www.twilio.com/docs/sms/services/api). URLs must contain a
|
46
|
-
# valid hostname
|
47
|
-
# @param [String] application_sid
|
48
|
-
#
|
49
|
-
# `
|
50
|
-
# [application](https://www.twilio.com/docs/usage/api/applications)
|
51
|
-
# `
|
52
|
-
# `
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
# will fail and
|
59
|
-
# message
|
60
|
-
# @param [Boolean] provide_feedback
|
61
|
-
#
|
62
|
-
# the message using the [Message
|
63
|
-
# API](https://www.twilio.com/docs/sms/api/message-feedback). This
|
64
|
-
# `false` by default.
|
65
|
-
# @param [String] validity_period
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
# guarantee that
|
70
|
-
#
|
71
|
-
# @param [
|
72
|
-
#
|
73
|
-
# @param [String]
|
74
|
-
#
|
75
|
-
#
|
76
|
-
# @param [Boolean]
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
# @param [Boolean] force_opt_in A boolean that forcefully whitelists a from:to
|
81
|
-
# pair when set to true.
|
82
|
-
# @param [String] from A Twilio phone number (in
|
83
|
-
# [E.164](https://www.twilio.com/docs/glossary/what-e164) format), [alphanumeric
|
47
|
+
# valid hostname and underscores are not allowed.
|
48
|
+
# @param [String] application_sid The SID of the application that should receive
|
49
|
+
# message status. We POST a `message_sid` parameter and a `message_status`
|
50
|
+
# parameter with a value of `sent` or `failed` to the
|
51
|
+
# [application](https://www.twilio.com/docs/usage/api/applications)'s
|
52
|
+
# `message_status_callback`. If a `status_callback` parameter is also passed, it
|
53
|
+
# will be ignored and the application's `message_status_callback` parameter will
|
54
|
+
# be used.
|
55
|
+
# @param [String] max_price The maximum total price in US dollars that you will
|
56
|
+
# pay for the message to be delivered. Can be a decimal value that has up to 4
|
57
|
+
# decimal places. All messages are queued for delivery and the message cost is
|
58
|
+
# checked before the message is sent. If the cost exceeds `max_price`, the message
|
59
|
+
# will fail and a status of `Failed` is sent to the status callback. If `MaxPrice`
|
60
|
+
# is not set, the message cost is not checked.
|
61
|
+
# @param [Boolean] provide_feedback Whether to confirm delivery of the message.
|
62
|
+
# Set this value to `true` if you are sending messages that have a trackable user
|
63
|
+
# action and you intend to confirm delivery of the message using the [Message
|
64
|
+
# Feedback API](https://www.twilio.com/docs/sms/api/message-feedback). This
|
65
|
+
# parameter is `false` by default.
|
66
|
+
# @param [String] validity_period How long in seconds the message can remain in
|
67
|
+
# our outgoing message queue. After this period elapses, the message fails and we
|
68
|
+
# call your status callback. Can be between 1 and the default value of 14,400
|
69
|
+
# seconds. After a message has been accepted by a carrier, however, we cannot
|
70
|
+
# guarantee that the message will not be queued after this period. We recommend
|
71
|
+
# that this value be at least 5 seconds.
|
72
|
+
# @param [Boolean] smart_encoded Whether to detect Unicode characters that have a
|
73
|
+
# similar GSM-7 character and replace them. Can be: `true` or `false`.
|
74
|
+
# @param [String] interactive_data A JSON string that represents an interactive
|
75
|
+
# message. An interactive message is a category of messages that includes a list
|
76
|
+
# picker, a time picker, and an Apple Pay request.
|
77
|
+
# @param [Boolean] force_opt_in Whether to forcefully whitelist a from:to pair.
|
78
|
+
# Can be: `true` or `false`.
|
79
|
+
# @param [String] from A Twilio phone number in
|
80
|
+
# [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric
|
84
81
|
# sender
|
85
|
-
# ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id)
|
86
|
-
#
|
87
|
-
# address](https://www.twilio.com/docs/sms/channels#channel-addresses) enabled for
|
88
|
-
# the type of message you wish to send. Phone numbers or [short
|
89
|
-
# codes](https://www.twilio.com/docs/sms/api/short-codes) purchased from Twilio
|
90
|
-
# work here. You cannot (for example) spoof messages from your own cell phone
|
91
|
-
# number. *Do not use this parameter if you are using `MessagingServiceSid`.*
|
92
|
-
# @param [String] messaging_service_sid The 34-character unique ID of the
|
93
|
-
# [Messaging
|
82
|
+
# ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-codes) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty.
|
83
|
+
# @param [String] messaging_service_sid The SID of the [Messaging
|
94
84
|
# Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot)
|
95
|
-
# you want to associate with
|
96
|
-
#
|
97
|
-
# Features](https://www.twilio.com/console/sms/services) you have configured
|
98
|
-
# only this parameter is set, Twilio will
|
99
|
-
# select the `
|
100
|
-
#
|
101
|
-
# @param [String] body The text of the message you want to send
|
102
|
-
# characters.
|
103
|
-
# @param [String] media_url The URL
|
104
|
-
#
|
105
|
-
#
|
106
|
-
# types](https://www.twilio.com/docs/sms/accepted-mime-types) are also
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
110
|
-
#
|
85
|
+
# you want to associate with the Message. Set this parameter to use the [Messaging
|
86
|
+
# Service Settings and Copilot
|
87
|
+
# Features](https://www.twilio.com/console/sms/services) you have configured and
|
88
|
+
# leave the `from` parameter empty. When only this parameter is set, Twilio will
|
89
|
+
# use your enabled Copilot Features to select the `from` phone number for
|
90
|
+
# delivery.
|
91
|
+
# @param [String] body The text of the message you want to send. Can be up to
|
92
|
+
# 1,600 characters in length.
|
93
|
+
# @param [String] media_url The URL of the media to send with the message. The
|
94
|
+
# media can be of type `gif`, `png`, and `jpeg` and will be formatted correctly on
|
95
|
+
# the recipient's device. [Other
|
96
|
+
# types](https://www.twilio.com/docs/sms/accepted-mime-types) of media are also
|
97
|
+
# accepted. The media size limit is 5MB. To send more than one image in the
|
98
|
+
# message body, provide multiple `media_url` parameters in the POST request. You
|
99
|
+
# can include up to 10 `media_url` parameters per message. You can send images in
|
100
|
+
# an SMS message in only the US and Canada.
|
111
101
|
# @return [MessageInstance] Newly created MessageInstance
|
112
|
-
def create(to: nil, status_callback: :unset, application_sid: :unset, max_price: :unset, provide_feedback: :unset, validity_period: :unset,
|
102
|
+
def create(to: nil, status_callback: :unset, application_sid: :unset, max_price: :unset, provide_feedback: :unset, validity_period: :unset, smart_encoded: :unset, interactive_data: :unset, force_opt_in: :unset, from: :unset, messaging_service_sid: :unset, body: :unset, media_url: :unset)
|
113
103
|
data = Twilio::Values.of({
|
114
104
|
'To' => to,
|
115
105
|
'From' => from,
|
@@ -121,11 +111,6 @@ module Twilio
|
|
121
111
|
'MaxPrice' => max_price,
|
122
112
|
'ProvideFeedback' => provide_feedback,
|
123
113
|
'ValidityPeriod' => validity_period,
|
124
|
-
'MaxRate' => max_rate,
|
125
|
-
'ForceDelivery' => force_delivery,
|
126
|
-
'ProviderSid' => provider_sid,
|
127
|
-
'ContentRetention' => content_retention,
|
128
|
-
'AddressRetention' => address_retention,
|
129
114
|
'SmartEncoded' => smart_encoded,
|
130
115
|
'InteractiveData' => interactive_data,
|
131
116
|
'ForceOptIn' => force_opt_in,
|
@@ -144,9 +129,9 @@ module Twilio
|
|
144
129
|
# Lists MessageInstance records from the API as a list.
|
145
130
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
146
131
|
# memory before returning.
|
147
|
-
# @param [String] to
|
148
|
-
# @param [String] from
|
149
|
-
# sender ID.
|
132
|
+
# @param [String] to Read messages sent to only this phone number.
|
133
|
+
# @param [String] from Read messages sent from only this phone number or
|
134
|
+
# alphanumeric sender ID.
|
150
135
|
# @param [Time] date_sent_before Filter by date sent
|
151
136
|
# @param [Time] date_sent Filter by date sent
|
152
137
|
# @param [Time] date_sent_after Filter by date sent
|
@@ -173,9 +158,9 @@ module Twilio
|
|
173
158
|
# Streams MessageInstance records from the API as an Enumerable.
|
174
159
|
# This operation lazily loads records as efficiently as possible until the limit
|
175
160
|
# is reached.
|
176
|
-
# @param [String] to
|
177
|
-
# @param [String] from
|
178
|
-
# sender ID.
|
161
|
+
# @param [String] to Read messages sent to only this phone number.
|
162
|
+
# @param [String] from Read messages sent from only this phone number or
|
163
|
+
# alphanumeric sender ID.
|
179
164
|
# @param [Time] date_sent_before Filter by date sent
|
180
165
|
# @param [Time] date_sent Filter by date sent
|
181
166
|
# @param [Time] date_sent_after Filter by date sent
|
@@ -218,9 +203,9 @@ module Twilio
|
|
218
203
|
##
|
219
204
|
# Retrieve a single page of MessageInstance records from the API.
|
220
205
|
# Request is executed immediately.
|
221
|
-
# @param [String] to
|
222
|
-
# @param [String] from
|
223
|
-
# sender ID.
|
206
|
+
# @param [String] to Read messages sent to only this phone number.
|
207
|
+
# @param [String] from Read messages sent from only this phone number or
|
208
|
+
# alphanumeric sender ID.
|
224
209
|
# @param [Time] date_sent_before Filter by date sent
|
225
210
|
# @param [Time] date_sent Filter by date sent
|
226
211
|
# @param [Time] date_sent_after Filter by date sent
|
@@ -300,8 +285,11 @@ module Twilio
|
|
300
285
|
##
|
301
286
|
# Initialize the MessageContext
|
302
287
|
# @param [Version] version Version that contains the resource
|
303
|
-
# @param [String] account_sid The
|
304
|
-
#
|
288
|
+
# @param [String] account_sid The SID of the
|
289
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that created the Message
|
290
|
+
# resource to fetch.
|
291
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
292
|
+
# Message resource to fetch.
|
305
293
|
# @return [MessageContext] MessageContext
|
306
294
|
def initialize(version, account_sid, sid)
|
307
295
|
super(version)
|
@@ -339,8 +327,8 @@ module Twilio
|
|
339
327
|
|
340
328
|
##
|
341
329
|
# Update the MessageInstance
|
342
|
-
# @param [String] body The text of the message you want to send
|
343
|
-
# characters.
|
330
|
+
# @param [String] body The text of the message you want to send. Can be up to
|
331
|
+
# 1,600 characters long.
|
344
332
|
# @return [MessageInstance] Updated MessageInstance
|
345
333
|
def update(body: nil)
|
346
334
|
data = Twilio::Values.of({'Body' => body, })
|
@@ -408,9 +396,11 @@ module Twilio
|
|
408
396
|
# Initialize the MessageInstance
|
409
397
|
# @param [Version] version Version that contains the resource
|
410
398
|
# @param [Hash] payload payload that contains response from Twilio
|
411
|
-
# @param [String] account_sid The
|
412
|
-
# [Account](https://www.twilio.com/docs/api/rest/account) that sent
|
413
|
-
#
|
399
|
+
# @param [String] account_sid The SID of the
|
400
|
+
# [Account](https://www.twilio.com/docs/api/rest/account) that sent the message
|
401
|
+
# that created the resource.
|
402
|
+
# @param [String] sid The Twilio-provided string that uniquely identifies the
|
403
|
+
# Message resource to fetch.
|
414
404
|
# @return [MessageInstance] MessageInstance
|
415
405
|
def initialize(version, payload, account_sid: nil, sid: nil)
|
416
406
|
super(version)
|
@@ -456,37 +446,37 @@ module Twilio
|
|
456
446
|
end
|
457
447
|
|
458
448
|
##
|
459
|
-
# @return [String] The
|
449
|
+
# @return [String] The SID of the Account that created the resource
|
460
450
|
def account_sid
|
461
451
|
@properties['account_sid']
|
462
452
|
end
|
463
453
|
|
464
454
|
##
|
465
|
-
# @return [String] The version
|
455
|
+
# @return [String] The API version used to process the message
|
466
456
|
def api_version
|
467
457
|
@properties['api_version']
|
468
458
|
end
|
469
459
|
|
470
460
|
##
|
471
|
-
# @return [String] The
|
461
|
+
# @return [String] The message text
|
472
462
|
def body
|
473
463
|
@properties['body']
|
474
464
|
end
|
475
465
|
|
476
466
|
##
|
477
|
-
# @return [Time] The date
|
467
|
+
# @return [Time] The RFC 2822 date and time in GMT that the resource was created
|
478
468
|
def date_created
|
479
469
|
@properties['date_created']
|
480
470
|
end
|
481
471
|
|
482
472
|
##
|
483
|
-
# @return [Time] The date
|
473
|
+
# @return [Time] The RFC 2822 date and time in GMT that the resource was last updated
|
484
474
|
def date_updated
|
485
475
|
@properties['date_updated']
|
486
476
|
end
|
487
477
|
|
488
478
|
##
|
489
|
-
# @return [Time] The date the message was sent
|
479
|
+
# @return [Time] The RFC 2822 date and time in GMT when the message was sent
|
490
480
|
def date_sent
|
491
481
|
@properties['date_sent']
|
492
482
|
end
|
@@ -504,7 +494,7 @@ module Twilio
|
|
504
494
|
end
|
505
495
|
|
506
496
|
##
|
507
|
-
# @return [String]
|
497
|
+
# @return [String] The description of the error_code
|
508
498
|
def error_message
|
509
499
|
@properties['error_message']
|
510
500
|
end
|
@@ -516,19 +506,19 @@ module Twilio
|
|
516
506
|
end
|
517
507
|
|
518
508
|
##
|
519
|
-
# @return [String] The
|
509
|
+
# @return [String] The SID of the Messaging Service used with the message.
|
520
510
|
def messaging_service_sid
|
521
511
|
@properties['messaging_service_sid']
|
522
512
|
end
|
523
513
|
|
524
514
|
##
|
525
|
-
# @return [String]
|
515
|
+
# @return [String] The number of media files associated with the message
|
526
516
|
def num_media
|
527
517
|
@properties['num_media']
|
528
518
|
end
|
529
519
|
|
530
520
|
##
|
531
|
-
# @return [String]
|
521
|
+
# @return [String] The number of messages used to deliver the message body
|
532
522
|
def num_segments
|
533
523
|
@properties['num_segments']
|
534
524
|
end
|
@@ -540,25 +530,25 @@ module Twilio
|
|
540
530
|
end
|
541
531
|
|
542
532
|
##
|
543
|
-
# @return [String] The currency in which
|
533
|
+
# @return [String] The currency in which price is measured
|
544
534
|
def price_unit
|
545
535
|
@properties['price_unit']
|
546
536
|
end
|
547
537
|
|
548
538
|
##
|
549
|
-
# @return [String]
|
539
|
+
# @return [String] The unique string that identifies the resource
|
550
540
|
def sid
|
551
541
|
@properties['sid']
|
552
542
|
end
|
553
543
|
|
554
544
|
##
|
555
|
-
# @return [message.Status] The status of
|
545
|
+
# @return [message.Status] The status of the message
|
556
546
|
def status
|
557
547
|
@properties['status']
|
558
548
|
end
|
559
549
|
|
560
550
|
##
|
561
|
-
# @return [String]
|
551
|
+
# @return [String] A list of related resources identified by their relative URIs
|
562
552
|
def subresource_uris
|
563
553
|
@properties['subresource_uris']
|
564
554
|
end
|
@@ -570,7 +560,7 @@ module Twilio
|
|
570
560
|
end
|
571
561
|
|
572
562
|
##
|
573
|
-
# @return [String] The URI
|
563
|
+
# @return [String] The URI of the resource, relative to `https://api.twilio.com`
|
574
564
|
def uri
|
575
565
|
@properties['uri']
|
576
566
|
end
|
@@ -591,8 +581,8 @@ module Twilio
|
|
591
581
|
|
592
582
|
##
|
593
583
|
# Update the MessageInstance
|
594
|
-
# @param [String] body The text of the message you want to send
|
595
|
-
# characters.
|
584
|
+
# @param [String] body The text of the message you want to send. Can be up to
|
585
|
+
# 1,600 characters long.
|
596
586
|
# @return [MessageInstance] Updated MessageInstance
|
597
587
|
def update(body: nil)
|
598
588
|
context.update(body: body, )
|