sentdm 0.32.0 → 0.34.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/CHANGELOG.md +16 -0
- data/README.md +1 -1
- data/lib/sentdm/client.rb +6 -0
- data/lib/sentdm/models/channel_event_payload.rb +154 -7
- data/lib/sentdm/models/contact_event.rb +15 -7
- data/lib/sentdm/models/contact_event_payload.rb +77 -16
- data/lib/sentdm/models/conversation_messages_list.rb +214 -6
- data/lib/sentdm/models/inbound_message_event_payload.rb +70 -3
- data/lib/sentdm/models/me_retrieve_response.rb +21 -1
- data/lib/sentdm/models/message_event_payload.rb +42 -1
- data/lib/sentdm/models/message_retrieve_activities_response.rb +42 -5
- data/lib/sentdm/models/message_retrieve_status_response.rb +222 -8
- data/lib/sentdm/models/message_send_params.rb +67 -3
- data/lib/sentdm/models/message_send_response.rb +13 -4
- data/lib/sentdm/models/template_body.rb +82 -1
- data/lib/sentdm/models/template_create_params.rb +11 -1
- data/lib/sentdm/models/template_header.rb +91 -3
- data/lib/sentdm/models/template_variable.rb +15 -1
- data/lib/sentdm/models/webhook_create_params.rb +31 -1
- data/lib/sentdm/models/webhook_list_events_response.rb +497 -9
- data/lib/sentdm/models/webhook_update_params.rb +31 -1
- data/lib/sentdm/resources/me.rb +5 -0
- data/lib/sentdm/resources/messages.rb +33 -5
- data/lib/sentdm/resources/templates.rb +3 -1
- data/lib/sentdm/resources/webhooks.rb +9 -3
- data/lib/sentdm/version.rb +1 -1
- data/lib/sentdm.rb +1 -1
- data/rbi/sentdm/client.rbi +6 -0
- data/rbi/sentdm/models/channel_event_payload.rbi +273 -10
- data/rbi/sentdm/models/contact_event.rbi +28 -12
- data/rbi/sentdm/models/contact_event_payload.rbi +118 -28
- data/rbi/sentdm/models/conversation_messages_list.rbi +308 -10
- data/rbi/sentdm/models/inbound_message_event_payload.rbi +110 -2
- data/rbi/sentdm/models/me_retrieve_response.rbi +35 -0
- data/rbi/sentdm/models/message_event_payload.rbi +50 -0
- data/rbi/sentdm/models/message_retrieve_activities_response.rbi +49 -5
- data/rbi/sentdm/models/message_retrieve_status_response.rbi +320 -12
- data/rbi/sentdm/models/message_send_params.rbi +100 -2
- data/rbi/sentdm/models/message_send_response.rbi +15 -5
- data/rbi/sentdm/models/template_body.rbi +133 -0
- data/rbi/sentdm/models/template_create_params.rbi +15 -0
- data/rbi/sentdm/models/template_header.rbi +143 -2
- data/rbi/sentdm/models/template_variable.rbi +10 -0
- data/rbi/sentdm/models/webhook_create_params.rbi +61 -0
- data/rbi/sentdm/models/webhook_list_events_response.rbi +747 -12
- data/rbi/sentdm/models/webhook_update_params.rbi +61 -0
- data/rbi/sentdm/resources/me.rbi +5 -0
- data/rbi/sentdm/resources/messages.rbi +58 -3
- data/rbi/sentdm/resources/templates.rbi +6 -0
- data/rbi/sentdm/resources/webhooks.rbi +15 -1
- data/sig/sentdm/models/channel_event_payload.rbs +62 -0
- data/sig/sentdm/models/contact_event_payload.rbs +24 -9
- data/sig/sentdm/models/conversation_messages_list.rbs +99 -6
- data/sig/sentdm/models/inbound_message_event_payload.rbs +37 -0
- data/sig/sentdm/models/me_retrieve_response.rbs +7 -0
- data/sig/sentdm/models/message_event_payload.rbs +20 -0
- data/sig/sentdm/models/message_retrieve_activities_response.rbs +15 -0
- data/sig/sentdm/models/message_retrieve_status_response.rbs +99 -6
- data/sig/sentdm/models/message_send_params.rbs +15 -0
- data/sig/sentdm/models/template_body.rbs +44 -0
- data/sig/sentdm/models/template_create_params.rbs +7 -0
- data/sig/sentdm/models/template_header.rbs +44 -0
- data/sig/sentdm/models/webhook_create_params.rbs +29 -0
- data/sig/sentdm/models/webhook_list_events_response.rbs +252 -0
- data/sig/sentdm/models/webhook_update_params.rbs +29 -0
- data/sig/sentdm/resources/messages.rbs +3 -0
- data/sig/sentdm/resources/templates.rbs +1 -0
- data/sig/sentdm/resources/webhooks.rbs +2 -0
- metadata +2 -2
|
@@ -5,7 +5,12 @@ module Sentdm
|
|
|
5
5
|
# @see Sentdm::Resources::Messages#retrieve_status
|
|
6
6
|
class MessageRetrieveStatusResponse < Sentdm::Internal::Type::BaseModel
|
|
7
7
|
# @!attribute data
|
|
8
|
-
# Message response for v3 API — same shape as v2 with snake_case JSON conventions
|
|
8
|
+
# Message response for v3 API — same shape as v2 with snake_case JSON conventions.
|
|
9
|
+
#
|
|
10
|
+
# The shape of a message that was sent immediately: it never has a scheduled_at
|
|
11
|
+
# key. A message that is or was held for a later instant is a
|
|
12
|
+
# ScheduledMessageResponse, and the endpoint decides which of the two to answer
|
|
13
|
+
# with. From always returns this type.
|
|
9
14
|
#
|
|
10
15
|
# @return [Sentdm::Models::MessageRetrieveStatusResponse::Data, nil]
|
|
11
16
|
optional :data, -> { Sentdm::Models::MessageRetrieveStatusResponse::Data }, nil?: true
|
|
@@ -29,9 +34,12 @@ module Sentdm
|
|
|
29
34
|
optional :success, Sentdm::Internal::Type::Boolean
|
|
30
35
|
|
|
31
36
|
# @!method initialize(data: nil, error: nil, meta: nil, success: nil)
|
|
37
|
+
# Some parameter documentations has been truncated, see
|
|
38
|
+
# {Sentdm::Models::MessageRetrieveStatusResponse} for more details.
|
|
39
|
+
#
|
|
32
40
|
# Standard API response envelope for all v3 endpoints
|
|
33
41
|
#
|
|
34
|
-
# @param data [Sentdm::Models::MessageRetrieveStatusResponse::Data, nil] Message response for v3 API — same shape as v2 with snake_case JSON conventions
|
|
42
|
+
# @param data [Sentdm::Models::MessageRetrieveStatusResponse::Data, nil] Message response for v3 API — same shape as v2 with snake_case JSON conventions.
|
|
35
43
|
#
|
|
36
44
|
# @param error [Sentdm::Models::ErrorDetail, nil] Error information
|
|
37
45
|
#
|
|
@@ -85,7 +93,14 @@ module Sentdm
|
|
|
85
93
|
|
|
86
94
|
# @!attribute message_body
|
|
87
95
|
# Structured message body format for database storage. Preserves channel-specific
|
|
88
|
-
# components (header, body, footer, buttons).
|
|
96
|
+
# components (header, header media, body, footer, buttons, MMS subject and media).
|
|
97
|
+
#
|
|
98
|
+
# Persisted as the messageBody jsonb column on Messages. Every write path goes
|
|
99
|
+
# through MessageUtils.MessageBodyJsonOptions, which writes nulls, so the envelope
|
|
100
|
+
# shape is stable regardless of channel or status. Anything that rebuilds this
|
|
101
|
+
# object field by field — the four IMessageBodyStrategy implementations and
|
|
102
|
+
# MessageUtils.BuildSegmentBody — has to carry every member, or that member is
|
|
103
|
+
# silently dropped on whichever path forgot it.
|
|
89
104
|
#
|
|
90
105
|
# @return [Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody, nil]
|
|
91
106
|
optional :message_body,
|
|
@@ -107,6 +122,24 @@ module Sentdm
|
|
|
107
122
|
# @return [Float, nil]
|
|
108
123
|
optional :price, Float, nil?: true
|
|
109
124
|
|
|
125
|
+
# @!attribute reason
|
|
126
|
+
# A human-readable sentence for reason_code, for example "Insufficient balance".
|
|
127
|
+
# Omitted whenever reason_code is.
|
|
128
|
+
#
|
|
129
|
+
# @return [String, nil]
|
|
130
|
+
optional :reason, String, nil?: true
|
|
131
|
+
|
|
132
|
+
# @!attribute reason_code
|
|
133
|
+
# Why the message is at its current status, as a stable platform code such as
|
|
134
|
+
# DELIVERY_007, BUSINESS_003 or DELIVERY_003. Present when the current status is
|
|
135
|
+
# FAILED, FILTERED or BLOCKED and the lifecycle was loaded; omitted otherwise.
|
|
136
|
+
# Switch on this rather than on reason: the code is stable, the wording may be
|
|
137
|
+
# improved. It is the platform's classification of the outcome, never a carrier or
|
|
138
|
+
# vendor code.
|
|
139
|
+
#
|
|
140
|
+
# @return [String, nil]
|
|
141
|
+
optional :reason_code, String, nil?: true
|
|
142
|
+
|
|
110
143
|
# @!attribute region_code
|
|
111
144
|
#
|
|
112
145
|
# @return [String, nil]
|
|
@@ -132,11 +165,16 @@ module Sentdm
|
|
|
132
165
|
# @return [String, nil]
|
|
133
166
|
optional :template_name, String, nil?: true
|
|
134
167
|
|
|
135
|
-
# @!method initialize(id: nil, active_contact_price: nil, channel: nil, contact_id: nil, created_at: nil, customer_id: nil, direction: nil, events: nil, message_body: nil, phone: nil, phone_international: nil, price: nil, region_code: nil, status: nil, template_category: nil, template_id: nil, template_name: nil)
|
|
168
|
+
# @!method initialize(id: nil, active_contact_price: nil, channel: nil, contact_id: nil, created_at: nil, customer_id: nil, direction: nil, events: nil, message_body: nil, phone: nil, phone_international: nil, price: nil, reason: nil, reason_code: nil, region_code: nil, status: nil, template_category: nil, template_id: nil, template_name: nil)
|
|
136
169
|
# Some parameter documentations has been truncated, see
|
|
137
170
|
# {Sentdm::Models::MessageRetrieveStatusResponse::Data} for more details.
|
|
138
171
|
#
|
|
139
|
-
# Message response for v3 API — same shape as v2 with snake_case JSON conventions
|
|
172
|
+
# Message response for v3 API — same shape as v2 with snake_case JSON conventions.
|
|
173
|
+
#
|
|
174
|
+
# The shape of a message that was sent immediately: it never has a scheduled_at
|
|
175
|
+
# key. A message that is or was held for a later instant is a
|
|
176
|
+
# ScheduledMessageResponse, and the endpoint decides which of the two to answer
|
|
177
|
+
# with. From always returns this type.
|
|
140
178
|
#
|
|
141
179
|
# @param id [String]
|
|
142
180
|
#
|
|
@@ -162,6 +200,10 @@ module Sentdm
|
|
|
162
200
|
#
|
|
163
201
|
# @param price [Float, nil]
|
|
164
202
|
#
|
|
203
|
+
# @param reason [String, nil] A human-readable sentence for reason_code, for example "Insufficient balance". O
|
|
204
|
+
#
|
|
205
|
+
# @param reason_code [String, nil] Why the message is at its current status, as a stable platform code such as
|
|
206
|
+
#
|
|
165
207
|
# @param region_code [String]
|
|
166
208
|
#
|
|
167
209
|
# @param status [String]
|
|
@@ -188,12 +230,37 @@ module Sentdm
|
|
|
188
230
|
# @return [String, nil]
|
|
189
231
|
optional :description, String, nil?: true
|
|
190
232
|
|
|
191
|
-
# @!
|
|
233
|
+
# @!attribute reason
|
|
234
|
+
# A human-readable sentence for reason_code. Omitted whenever reason_code is.
|
|
235
|
+
#
|
|
236
|
+
# @return [String, nil]
|
|
237
|
+
optional :reason, String, nil?: true
|
|
238
|
+
|
|
239
|
+
# @!attribute reason_code
|
|
240
|
+
# Why the message reached this status, as a stable platform code such as
|
|
241
|
+
# DELIVERY_007. Present on FAILED, FILTERED and BLOCKED events; omitted on every
|
|
242
|
+
# status that needs no explanation. Same wire name and vocabulary as on the
|
|
243
|
+
# activities list and the webhook.
|
|
244
|
+
#
|
|
245
|
+
# @return [String, nil]
|
|
246
|
+
optional :reason_code, String, nil?: true
|
|
247
|
+
|
|
248
|
+
# @!method initialize(status:, timestamp:, description: nil, reason: nil, reason_code: nil)
|
|
249
|
+
# Some parameter documentations has been truncated, see
|
|
250
|
+
# {Sentdm::Models::MessageRetrieveStatusResponse::Data::Event} for more details.
|
|
251
|
+
#
|
|
192
252
|
# Represents a status change event in a message's lifecycle (v3)
|
|
193
253
|
#
|
|
194
254
|
# @param status [String]
|
|
255
|
+
#
|
|
195
256
|
# @param timestamp [Time]
|
|
257
|
+
#
|
|
196
258
|
# @param description [String, nil]
|
|
259
|
+
#
|
|
260
|
+
# @param reason [String, nil] A human-readable sentence for reason_code. Omitted whenever reason_code is.
|
|
261
|
+
#
|
|
262
|
+
# @param reason_code [String, nil] Why the message reached this status, as a stable platform code such as
|
|
263
|
+
# DELIVERY\_
|
|
197
264
|
end
|
|
198
265
|
|
|
199
266
|
# @see Sentdm::Models::MessageRetrieveStatusResponse::Data#message_body
|
|
@@ -220,14 +287,63 @@ module Sentdm
|
|
|
220
287
|
# @return [String, nil]
|
|
221
288
|
optional :header, String, nil?: true
|
|
222
289
|
|
|
223
|
-
# @!
|
|
290
|
+
# @!attribute header_media
|
|
291
|
+
# The media asset that rode a message's header, recorded as sent.
|
|
292
|
+
#
|
|
293
|
+
# @return [Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::HeaderMedia, nil]
|
|
294
|
+
optional :header_media,
|
|
295
|
+
-> { Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::HeaderMedia },
|
|
296
|
+
api_name: :headerMedia,
|
|
297
|
+
nil?: true
|
|
298
|
+
|
|
299
|
+
# @!attribute media
|
|
300
|
+
# MMS attachments, as the publicly fetchable URLs handed to the carrier. Null on
|
|
301
|
+
# every other channel.
|
|
302
|
+
#
|
|
303
|
+
# Persisted rather than derived because a resend and a curfew release rebuild the
|
|
304
|
+
# send from the stored row — MessageReplayCommandBuilder reads templateId and
|
|
305
|
+
# templateVariables and nothing else — so media that lives only on the original
|
|
306
|
+
# request would silently turn a replayed MMS into a text message.
|
|
307
|
+
#
|
|
308
|
+
# @return [Array<Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::Media>, nil]
|
|
309
|
+
optional :media,
|
|
310
|
+
-> { Sentdm::Internal::Type::ArrayOf[Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::Media] },
|
|
311
|
+
nil?: true
|
|
312
|
+
|
|
313
|
+
# @!attribute subject
|
|
314
|
+
# MMS subject line. Null on every other channel.
|
|
315
|
+
#
|
|
316
|
+
# @return [String, nil]
|
|
317
|
+
optional :subject, String, nil?: true
|
|
318
|
+
|
|
319
|
+
# @!method initialize(buttons: nil, content: nil, footer: nil, header: nil, header_media: nil, media: nil, subject: nil)
|
|
320
|
+
# Some parameter documentations has been truncated, see
|
|
321
|
+
# {Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody} for more
|
|
322
|
+
# details.
|
|
323
|
+
#
|
|
224
324
|
# Structured message body format for database storage. Preserves channel-specific
|
|
225
|
-
# components (header, body, footer, buttons).
|
|
325
|
+
# components (header, header media, body, footer, buttons, MMS subject and media).
|
|
326
|
+
#
|
|
327
|
+
# Persisted as the messageBody jsonb column on Messages. Every write path goes
|
|
328
|
+
# through MessageUtils.MessageBodyJsonOptions, which writes nulls, so the envelope
|
|
329
|
+
# shape is stable regardless of channel or status. Anything that rebuilds this
|
|
330
|
+
# object field by field — the four IMessageBodyStrategy implementations and
|
|
331
|
+
# MessageUtils.BuildSegmentBody — has to carry every member, or that member is
|
|
332
|
+
# silently dropped on whichever path forgot it.
|
|
226
333
|
#
|
|
227
334
|
# @param buttons [Array<Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::Button>, nil]
|
|
335
|
+
#
|
|
228
336
|
# @param content [String]
|
|
337
|
+
#
|
|
229
338
|
# @param footer [String, nil]
|
|
339
|
+
#
|
|
230
340
|
# @param header [String, nil]
|
|
341
|
+
#
|
|
342
|
+
# @param header_media [Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::HeaderMedia, nil] The media asset that rode a message's header, recorded as sent.
|
|
343
|
+
#
|
|
344
|
+
# @param media [Array<Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::Media>, nil] MMS attachments, as the publicly fetchable URLs handed to the carrier. Null on e
|
|
345
|
+
#
|
|
346
|
+
# @param subject [String, nil] MMS subject line. Null on every other channel.
|
|
231
347
|
|
|
232
348
|
class Button < Sentdm::Internal::Type::BaseModel
|
|
233
349
|
# @!attribute postback_data
|
|
@@ -256,6 +372,104 @@ module Sentdm
|
|
|
256
372
|
# @param type [String]
|
|
257
373
|
# @param value [String]
|
|
258
374
|
end
|
|
375
|
+
|
|
376
|
+
# @see Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody#header_media
|
|
377
|
+
class HeaderMedia < Sentdm::Internal::Type::BaseModel
|
|
378
|
+
# @!attribute type
|
|
379
|
+
# "image", "video" or "document" — taken from the header's media variable.
|
|
380
|
+
#
|
|
381
|
+
# @return [String, nil]
|
|
382
|
+
optional :type, String
|
|
383
|
+
|
|
384
|
+
# @!attribute url
|
|
385
|
+
# The https URL the caller supplied for this send. Never the template's stored
|
|
386
|
+
# props.sample, which is Meta's expiring header_handle rather than what was
|
|
387
|
+
# delivered.
|
|
388
|
+
#
|
|
389
|
+
# @return [String, nil]
|
|
390
|
+
optional :url, String
|
|
391
|
+
|
|
392
|
+
# @!method initialize(type: nil, url: nil)
|
|
393
|
+
# Some parameter documentations has been truncated, see
|
|
394
|
+
# {Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::HeaderMedia}
|
|
395
|
+
# for more details.
|
|
396
|
+
#
|
|
397
|
+
# The media asset that rode a message's header, recorded as sent.
|
|
398
|
+
#
|
|
399
|
+
# @param type [String] "image", "video" or "document" — taken from the header's media variable.
|
|
400
|
+
#
|
|
401
|
+
# @param url [String] The https URL the caller supplied for this send. Never the template's stored
|
|
402
|
+
end
|
|
403
|
+
|
|
404
|
+
class Media < Sentdm::Internal::Type::BaseModel
|
|
405
|
+
# @!attribute media_type
|
|
406
|
+
# One of MmsMediaTypes when the content type is known. Advisory — a reader should
|
|
407
|
+
# trust the fetched object's own Content-Type.
|
|
408
|
+
#
|
|
409
|
+
# @return [String, nil]
|
|
410
|
+
optional :media_type, String, api_name: :mediaType, nil?: true
|
|
411
|
+
|
|
412
|
+
# @!attribute mime_type
|
|
413
|
+
# Content type as the provider declared it. Null when it declared none.
|
|
414
|
+
#
|
|
415
|
+
# @return [String, nil]
|
|
416
|
+
optional :mime_type, String, api_name: :mimeType, nil?: true
|
|
417
|
+
|
|
418
|
+
# @!attribute size_bytes
|
|
419
|
+
# Size as the provider declared it. Never measured here — nothing downloads the
|
|
420
|
+
# file.
|
|
421
|
+
#
|
|
422
|
+
# @return [Integer, nil]
|
|
423
|
+
optional :size_bytes, Integer, api_name: :sizeBytes, nil?: true
|
|
424
|
+
|
|
425
|
+
# @!attribute source_hash_sha256
|
|
426
|
+
# Inbound only: the SHA-256 the provider declared alongside the attachment, when
|
|
427
|
+
# it declared one. Relayed to the customer so they can verify what they fetch
|
|
428
|
+
# matches what the carrier said it sent. It is the only integrity signal available
|
|
429
|
+
# on an attachment nobody here has read.
|
|
430
|
+
#
|
|
431
|
+
# @return [String, nil]
|
|
432
|
+
optional :source_hash_sha256, String, api_name: :sourceHashSha256, nil?: true
|
|
433
|
+
|
|
434
|
+
# @!attribute url
|
|
435
|
+
# Where the file lives. Outbound: the URL the customer gave us and the carrier
|
|
436
|
+
# fetched. Inbound: the URL the carrier hosts it at, relayed unchanged.
|
|
437
|
+
#
|
|
438
|
+
# @return [String, nil]
|
|
439
|
+
optional :url, String, nil?: true
|
|
440
|
+
|
|
441
|
+
# @!method initialize(media_type: nil, mime_type: nil, size_bytes: nil, source_hash_sha256: nil, url: nil)
|
|
442
|
+
# Some parameter documentations has been truncated, see
|
|
443
|
+
# {Sentdm::Models::MessageRetrieveStatusResponse::Data::MessageBody::Media} for
|
|
444
|
+
# more details.
|
|
445
|
+
#
|
|
446
|
+
# One attachment on a message, in either direction — and in both, a URL somebody
|
|
447
|
+
# else hosts.
|
|
448
|
+
#
|
|
449
|
+
# Outbound: the customer supplied a public URL and we handed it to the carrier.
|
|
450
|
+
# Inbound: the carrier hosts the file and we record where. sent.dm never holds the
|
|
451
|
+
# bytes, so there is no key, no expiry bookkeeping and nothing minted per read —
|
|
452
|
+
# what is stored is what is served.
|
|
453
|
+
#
|
|
454
|
+
# An inbound link expires on the carrier's own schedule and is unauthenticated.
|
|
455
|
+
# That is the customer's to manage, and it is documented where they will see it
|
|
456
|
+
# rather than only here — a recipient who needs an attachment to outlive that
|
|
457
|
+
# window copies it on receipt.
|
|
458
|
+
#
|
|
459
|
+
# Storing a presigned URL is the specific mistake this shape still avoids:
|
|
460
|
+
# M260826130000 and M260826140000 exist because RCS assets were stored as signed
|
|
461
|
+
# URLs and went stale. Nothing here is signed.
|
|
462
|
+
#
|
|
463
|
+
# @param media_type [String, nil] One of MmsMediaTypes when the content type is known. Advisory — a reader should
|
|
464
|
+
#
|
|
465
|
+
# @param mime_type [String, nil] Content type as the provider declared it. Null when it declared none.
|
|
466
|
+
#
|
|
467
|
+
# @param size_bytes [Integer, nil] Size as the provider declared it. Never measured here — nothing downloads the fi
|
|
468
|
+
#
|
|
469
|
+
# @param source_hash_sha256 [String, nil] Inbound only: the SHA-256 the provider declared alongside the attachment, when i
|
|
470
|
+
#
|
|
471
|
+
# @param url [String, nil] Where the file lives. Outbound: the URL the customer gave us and the carrier fet
|
|
472
|
+
end
|
|
259
473
|
end
|
|
260
474
|
end
|
|
261
475
|
end
|
|
@@ -15,6 +15,25 @@ module Sentdm
|
|
|
15
15
|
# @return [Array<String>, nil]
|
|
16
16
|
optional :channel, Sentdm::Internal::Type::ArrayOf[String], nil?: true
|
|
17
17
|
|
|
18
|
+
# @!attribute media_urls
|
|
19
|
+
# Attachments for this send, as publicly fetchable https URLs. Used by the MMS
|
|
20
|
+
# channel and ignored by every other one.
|
|
21
|
+
#
|
|
22
|
+
# Supplying these replaces the media on the template's mms body rather than adding
|
|
23
|
+
# to it, so a template can hold a default creative while a caller still sends
|
|
24
|
+
# something recipient-specific.
|
|
25
|
+
#
|
|
26
|
+
# Their presence is also what makes a message eligible for MMS on an auto-detect
|
|
27
|
+
# send: a message with nothing attached is delivered as SMS, because an MMS with
|
|
28
|
+
# no media is a more expensive text message.
|
|
29
|
+
#
|
|
30
|
+
# The recipient's carrier fetches each URL after the send is accepted, so it must
|
|
31
|
+
# stay publicly reachable — a link that expires, or one behind auth, arrives as a
|
|
32
|
+
# failed message.
|
|
33
|
+
#
|
|
34
|
+
# @return [Array<String>, nil]
|
|
35
|
+
optional :media_urls, Sentdm::Internal::Type::ArrayOf[String], nil?: true
|
|
36
|
+
|
|
18
37
|
# @!attribute sandbox
|
|
19
38
|
# Sandbox flag - when true, the operation is simulated without side effects Useful
|
|
20
39
|
# for testing integrations without actual execution
|
|
@@ -22,6 +41,29 @@ module Sentdm
|
|
|
22
41
|
# @return [Boolean, nil]
|
|
23
42
|
optional :sandbox, Sentdm::Internal::Type::Boolean
|
|
24
43
|
|
|
44
|
+
# @!attribute scheduled_at
|
|
45
|
+
# Optional future send time as an ISO-8601 timestamp with an explicit UTC offset,
|
|
46
|
+
# e.g. 2026-10-01T09:00:00+02:00 or 2026-10-01T07:00:00Z. A value without an
|
|
47
|
+
# offset is rejected (400) rather than read in the server's zone. The offset only
|
|
48
|
+
# fixes the instant: it is stored and echoed in UTC as scheduled_at. Omit to send
|
|
49
|
+
# now. Must be at least one minute ahead and at most 30 days ahead. Accepted
|
|
50
|
+
# messages report SCHEDULED and are released for delivery at this time. Quiet
|
|
51
|
+
# hours, balance and template approval are evaluated at release, not at
|
|
52
|
+
# acceptance: a message whose time falls inside a recipient's protected
|
|
53
|
+
# quiet-hours window is moved to the next allowed time and a second
|
|
54
|
+
# message.scheduled webhook reports the new scheduled_at.
|
|
55
|
+
#
|
|
56
|
+
# @return [Time, nil]
|
|
57
|
+
optional :scheduled_at, Time, nil?: true
|
|
58
|
+
|
|
59
|
+
# @!attribute subject
|
|
60
|
+
# Subject line for this send, overriding the template's. MMS only; ignored on
|
|
61
|
+
# every other channel. Most handsets render it above the body, some ignore it
|
|
62
|
+
# entirely.
|
|
63
|
+
#
|
|
64
|
+
# @return [String, nil]
|
|
65
|
+
optional :subject, String, nil?: true
|
|
66
|
+
|
|
25
67
|
# @!attribute template
|
|
26
68
|
# SDK-style template reference: resolve by ID or by name, with optional
|
|
27
69
|
# parameters.
|
|
@@ -51,14 +93,20 @@ module Sentdm
|
|
|
51
93
|
# @return [String, nil]
|
|
52
94
|
optional :x_profile_id, String
|
|
53
95
|
|
|
54
|
-
# @!method initialize(channel: nil, sandbox: nil, template: nil, text: nil, to: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
|
|
96
|
+
# @!method initialize(channel: nil, media_urls: nil, sandbox: nil, scheduled_at: nil, subject: nil, template: nil, text: nil, to: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
|
|
55
97
|
# Some parameter documentations has been truncated, see
|
|
56
98
|
# {Sentdm::Models::MessageSendParams} for more details.
|
|
57
99
|
#
|
|
58
100
|
# @param channel [Array<String>, nil] Channels to broadcast on, e.g. ["whatsapp", "sms"].
|
|
59
101
|
#
|
|
102
|
+
# @param media_urls [Array<String>, nil] Attachments for this send, as publicly fetchable https URLs. Used by the MMS cha
|
|
103
|
+
#
|
|
60
104
|
# @param sandbox [Boolean] Sandbox flag - when true, the operation is simulated without side effects
|
|
61
105
|
#
|
|
106
|
+
# @param scheduled_at [Time, nil] Optional future send time as an ISO-8601 timestamp with an explicit UTC offset,
|
|
107
|
+
#
|
|
108
|
+
# @param subject [String, nil] Subject line for this send, overriding the template's. MMS only; ignored on ever
|
|
109
|
+
#
|
|
62
110
|
# @param template [Sentdm::Models::MessageSendParams::Template, nil] SDK-style template reference: resolve by ID or by name, with optional parameters
|
|
63
111
|
#
|
|
64
112
|
# @param text [String, nil] Plain-text (free-form) message body. Provide either Template or this.
|
|
@@ -85,12 +133,28 @@ module Sentdm
|
|
|
85
133
|
optional :name, String, nil?: true
|
|
86
134
|
|
|
87
135
|
# @!attribute parameters
|
|
88
|
-
# Template variable parameters for personalization
|
|
136
|
+
# Template variable parameters for personalization, keyed by variable name.
|
|
137
|
+
#
|
|
138
|
+
# Every variable the template declares is required; GET /v3/templates/{id} lists
|
|
139
|
+
# them. Supplying a key the template does not declare is ignored.
|
|
140
|
+
#
|
|
141
|
+
# Media headers. A template whose header is an image (designed in WhatsApp Manager
|
|
142
|
+
# and imported into Sent) declares a reserved header_image key. Its value is a
|
|
143
|
+
# publicly reachable https URL that Meta fetches at send time — Sent does not host
|
|
144
|
+
# the asset, and the sample approved with the template is not reused. The key is
|
|
145
|
+
# derived from the header's media type, so header_video and header_document follow
|
|
146
|
+
# the same shape when those formats ship.
|
|
147
|
+
#
|
|
148
|
+
# "parameters": { "header_image": "https://cdn.example.com/banner.jpg", "name":
|
|
149
|
+
# "John Doe" }
|
|
89
150
|
#
|
|
90
151
|
# @return [Hash{Symbol=>String}, nil]
|
|
91
152
|
optional :parameters, Sentdm::Internal::Type::HashOf[String], nil?: true
|
|
92
153
|
|
|
93
154
|
# @!method initialize(id: nil, name: nil, parameters: nil)
|
|
155
|
+
# Some parameter documentations has been truncated, see
|
|
156
|
+
# {Sentdm::Models::MessageSendParams::Template} for more details.
|
|
157
|
+
#
|
|
94
158
|
# SDK-style template reference: resolve by ID or by name, with optional
|
|
95
159
|
# parameters.
|
|
96
160
|
#
|
|
@@ -98,7 +162,7 @@ module Sentdm
|
|
|
98
162
|
#
|
|
99
163
|
# @param name [String, nil] Template name (mutually exclusive with id)
|
|
100
164
|
#
|
|
101
|
-
# @param parameters [Hash{Symbol=>String}, nil] Template variable parameters for personalization
|
|
165
|
+
# @param parameters [Hash{Symbol=>String}, nil] Template variable parameters for personalization, keyed by variable name.
|
|
102
166
|
end
|
|
103
167
|
end
|
|
104
168
|
end
|
|
@@ -14,7 +14,9 @@ module Sentdm
|
|
|
14
14
|
# its result; this is what a caller sees, and the mapping between them is a
|
|
15
15
|
# decision the endpoint makes.
|
|
16
16
|
#
|
|
17
|
-
# The
|
|
17
|
+
# The shape of an immediate send: it never has a scheduled_at key. A send that
|
|
18
|
+
# carried scheduled_at is a ScheduledSendMessageResponse, and the endpoint decides
|
|
19
|
+
# which of the two to answer with. From always returns this type.
|
|
18
20
|
#
|
|
19
21
|
# @return [Sentdm::Models::MessageSendResponse::Data, nil]
|
|
20
22
|
optional :data, -> { Sentdm::Models::MessageSendResponse::Data }, nil?: true
|
|
@@ -60,7 +62,9 @@ module Sentdm
|
|
|
60
62
|
-> { Sentdm::Internal::Type::ArrayOf[Sentdm::Models::MessageSendResponse::Data::Recipient] }
|
|
61
63
|
|
|
62
64
|
# @!attribute status
|
|
63
|
-
#
|
|
65
|
+
# QUEUED: the batch is accepted. A request that carried scheduled_at is QUEUED
|
|
66
|
+
# here too; each message moves to SCHEDULED once it is held, as GET
|
|
67
|
+
# /v3/messages/{id} and the message.scheduled webhook report.
|
|
64
68
|
#
|
|
65
69
|
# @return [String, nil]
|
|
66
70
|
optional :status, String
|
|
@@ -76,6 +80,9 @@ module Sentdm
|
|
|
76
80
|
optional :template_name, String
|
|
77
81
|
|
|
78
82
|
# @!method initialize(recipients: nil, status: nil, template_id: nil, template_name: nil)
|
|
83
|
+
# Some parameter documentations has been truncated, see
|
|
84
|
+
# {Sentdm::Models::MessageSendResponse::Data} for more details.
|
|
85
|
+
#
|
|
79
86
|
# The result of a multi-recipient send.
|
|
80
87
|
#
|
|
81
88
|
# Declared here rather than in the service layer. POST /v3/messages used to
|
|
@@ -85,11 +92,13 @@ module Sentdm
|
|
|
85
92
|
# its result; this is what a caller sees, and the mapping between them is a
|
|
86
93
|
# decision the endpoint makes.
|
|
87
94
|
#
|
|
88
|
-
# The
|
|
95
|
+
# The shape of an immediate send: it never has a scheduled_at key. A send that
|
|
96
|
+
# carried scheduled_at is a ScheduledSendMessageResponse, and the endpoint decides
|
|
97
|
+
# which of the two to answer with. From always returns this type.
|
|
89
98
|
#
|
|
90
99
|
# @param recipients [Array<Sentdm::Models::MessageSendResponse::Data::Recipient>]
|
|
91
100
|
#
|
|
92
|
-
# @param status [String]
|
|
101
|
+
# @param status [String] QUEUED: the batch is accepted. A request that carried scheduled_at is QUEUED
|
|
93
102
|
#
|
|
94
103
|
# @param template_id [String]
|
|
95
104
|
#
|
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
module Sentdm
|
|
4
4
|
module Models
|
|
5
5
|
class TemplateBody < Sentdm::Internal::Type::BaseModel
|
|
6
|
+
# @!attribute mms
|
|
7
|
+
# MMS-specific content — subject, text and attachments.
|
|
8
|
+
#
|
|
9
|
+
# Like Rcs, an override that cannot stand on its own: a template still needs a
|
|
10
|
+
# MultiChannel body or the Sms + Whatsapp pair to be deliverable at all. Unlike
|
|
11
|
+
# Rcs, it has no fallback at send time — MMS with no media is a more expensive
|
|
12
|
+
# SMS, so a template without this slot is deliberately not MMS-capable and never
|
|
13
|
+
# produces an MMS route candidate.
|
|
14
|
+
#
|
|
15
|
+
# @return [Sentdm::Models::TemplateBody::Mms, nil]
|
|
16
|
+
optional :mms, -> { Sentdm::TemplateBody::Mms }, nil?: true
|
|
17
|
+
|
|
6
18
|
# @!attribute multi_channel
|
|
7
19
|
# The shared body, used for every channel. One half of the choice described above.
|
|
8
20
|
#
|
|
@@ -29,7 +41,7 @@ module Sentdm
|
|
|
29
41
|
# @return [Sentdm::Models::TemplateBodyContent, nil]
|
|
30
42
|
optional :whatsapp, -> { Sentdm::TemplateBodyContent }, nil?: true
|
|
31
43
|
|
|
32
|
-
# @!method initialize(multi_channel: nil, rcs: nil, sms: nil, whatsapp: nil)
|
|
44
|
+
# @!method initialize(mms: nil, multi_channel: nil, rcs: nil, sms: nil, whatsapp: nil)
|
|
33
45
|
# Some parameter documentations has been truncated, see
|
|
34
46
|
# {Sentdm::Models::TemplateBody} for more details.
|
|
35
47
|
#
|
|
@@ -44,6 +56,8 @@ module Sentdm
|
|
|
44
56
|
# channel. rcs is the one true override: it may accompany either strategy to vary
|
|
45
57
|
# the copy, but cannot stand alone.
|
|
46
58
|
#
|
|
59
|
+
# @param mms [Sentdm::Models::TemplateBody::Mms, nil] MMS-specific content — subject, text and attachments.
|
|
60
|
+
#
|
|
47
61
|
# @param multi_channel [Sentdm::Models::TemplateBodyContent, nil] The shared body, used for every channel. One half of the choice described above.
|
|
48
62
|
#
|
|
49
63
|
# @param rcs [Sentdm::Models::TemplateBodyContent, nil] RCS-specific copy that overrides the chosen strategy for RCS only. The one true
|
|
@@ -51,6 +65,73 @@ module Sentdm
|
|
|
51
65
|
# @param sms [Sentdm::Models::TemplateBodyContent, nil] The SMS body. It does not override multiChannel, it replaces it.
|
|
52
66
|
#
|
|
53
67
|
# @param whatsapp [Sentdm::Models::TemplateBodyContent, nil] The WhatsApp body. It does not override multiChannel, it replaces it.
|
|
68
|
+
|
|
69
|
+
# @see Sentdm::Models::TemplateBody#mms
|
|
70
|
+
class Mms < Sentdm::Models::TemplateBodyContent
|
|
71
|
+
# @!attribute media
|
|
72
|
+
# Attachments carried by every send on this template, in order. A per-send
|
|
73
|
+
# media_urls on the request replaces this list rather than adding to it, so a
|
|
74
|
+
# template can hold a default creative and a caller can still send something
|
|
75
|
+
# recipient-specific.
|
|
76
|
+
#
|
|
77
|
+
# @return [Array<Sentdm::Models::TemplateBody::Mms::Media>, nil]
|
|
78
|
+
optional :media, -> { Sentdm::Internal::Type::ArrayOf[Sentdm::TemplateBody::Mms::Media] }, nil?: true
|
|
79
|
+
|
|
80
|
+
# @!attribute subject
|
|
81
|
+
# MMS subject line. Optional — most handsets render it above the body, some ignore
|
|
82
|
+
# it entirely. Deliberately its own field rather than riding TemplateHeader: the
|
|
83
|
+
# header is authored once and shared across every channel, and carries Meta's
|
|
84
|
+
# 60-character cap plus its no-newline, no-emoji text rules, none of which
|
|
85
|
+
# describe an MMS subject.
|
|
86
|
+
#
|
|
87
|
+
# @return [String, nil]
|
|
88
|
+
optional :subject, String, nil?: true
|
|
89
|
+
|
|
90
|
+
# @!method initialize(media: nil, subject: nil)
|
|
91
|
+
# Some parameter documentations has been truncated, see
|
|
92
|
+
# {Sentdm::Models::TemplateBody::Mms} for more details.
|
|
93
|
+
#
|
|
94
|
+
# MMS-specific content — subject, text and attachments.
|
|
95
|
+
#
|
|
96
|
+
# Like Rcs, an override that cannot stand on its own: a template still needs a
|
|
97
|
+
# MultiChannel body or the Sms + Whatsapp pair to be deliverable at all. Unlike
|
|
98
|
+
# Rcs, it has no fallback at send time — MMS with no media is a more expensive
|
|
99
|
+
# SMS, so a template without this slot is deliberately not MMS-capable and never
|
|
100
|
+
# produces an MMS route candidate.
|
|
101
|
+
#
|
|
102
|
+
# @param media [Array<Sentdm::Models::TemplateBody::Mms::Media>, nil] Attachments carried by every send on this template, in order. A per-send media_u
|
|
103
|
+
#
|
|
104
|
+
# @param subject [String, nil] MMS subject line. Optional — most handsets render it above the body, some ignore
|
|
105
|
+
|
|
106
|
+
class Media < Sentdm::Internal::Type::BaseModel
|
|
107
|
+
# @!attribute media_type
|
|
108
|
+
# One of MmsMediaTypes. Advisory: the carrier reads the Content-Type off the
|
|
109
|
+
# fetched object, not this field. It exists so an authoring UI can render the
|
|
110
|
+
# right preview and so a reviewer can see what was intended.
|
|
111
|
+
#
|
|
112
|
+
# @return [String, nil]
|
|
113
|
+
optional :media_type, String, api_name: :mediaType, nil?: true
|
|
114
|
+
|
|
115
|
+
# @!attribute url
|
|
116
|
+
# Publicly fetchable https URL. The carrier's MMSC fetches this at send time, so
|
|
117
|
+
# it has to stay reachable and unauthenticated for the life of the send —
|
|
118
|
+
# including retries and a DLQ replay — which is why a presigned URL is not a valid
|
|
119
|
+
# value here.
|
|
120
|
+
#
|
|
121
|
+
# @return [String, nil]
|
|
122
|
+
optional :url, String
|
|
123
|
+
|
|
124
|
+
# @!method initialize(media_type: nil, url: nil)
|
|
125
|
+
# Some parameter documentations has been truncated, see
|
|
126
|
+
# {Sentdm::Models::TemplateBody::Mms::Media} for more details.
|
|
127
|
+
#
|
|
128
|
+
# One attachment on an MMS template body.
|
|
129
|
+
#
|
|
130
|
+
# @param media_type [String, nil] One of MmsMediaTypes. Advisory: the carrier reads the Content-Type off the
|
|
131
|
+
#
|
|
132
|
+
# @param url [String] Publicly fetchable https URL. The carrier's MMSC fetches this at send time, so i
|
|
133
|
+
end
|
|
134
|
+
end
|
|
54
135
|
end
|
|
55
136
|
end
|
|
56
137
|
end
|
|
@@ -7,6 +7,14 @@ module Sentdm
|
|
|
7
7
|
extend Sentdm::Internal::Type::RequestParameters::Converter
|
|
8
8
|
include Sentdm::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
|
+
# @!attribute auto_create_for_sp
|
|
11
|
+
# Create this template automatically on every sender profile of the organization,
|
|
12
|
+
# now and in future (default: false). Accepted only from an organization that has
|
|
13
|
+
# been enabled for it, and only at creation — it cannot be changed afterwards.
|
|
14
|
+
#
|
|
15
|
+
# @return [Boolean, nil]
|
|
16
|
+
optional :auto_create_for_sp, Sentdm::Internal::Type::Boolean
|
|
17
|
+
|
|
10
18
|
# @!attribute category
|
|
11
19
|
# Template category: MARKETING, UTILITY, AUTHENTICATION (optional, auto-detected
|
|
12
20
|
# if not provided)
|
|
@@ -56,10 +64,12 @@ module Sentdm
|
|
|
56
64
|
# @return [String, nil]
|
|
57
65
|
optional :x_profile_id, String
|
|
58
66
|
|
|
59
|
-
# @!method initialize(category: nil, creation_source: nil, definition: nil, language: nil, sandbox: nil, submit_for_review: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
|
|
67
|
+
# @!method initialize(auto_create_for_sp: nil, category: nil, creation_source: nil, definition: nil, language: nil, sandbox: nil, submit_for_review: nil, idempotency_key: nil, x_profile_id: nil, request_options: {})
|
|
60
68
|
# Some parameter documentations has been truncated, see
|
|
61
69
|
# {Sentdm::Models::TemplateCreateParams} for more details.
|
|
62
70
|
#
|
|
71
|
+
# @param auto_create_for_sp [Boolean] Create this template automatically on every sender profile of the organization,
|
|
72
|
+
#
|
|
63
73
|
# @param category [String, nil] Template category: MARKETING, UTILITY, AUTHENTICATION (optional, auto-detected i
|
|
64
74
|
#
|
|
65
75
|
# @param creation_source [String, nil] Source of template creation (default: from-api)
|