direct7 0.0.19 → 0.0.21
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/README.md +1 -1
- data/VERSION +1 -1
- data/direct7.gemspec +1 -1
- data/lib/direct7/sms.rb +3 -2
- data/lib/direct7/whatsapp.rb +9 -1
- data/test/test.rb +110 -54
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31d1a59eedacf7f8307df809d7716217a0c57f16023339fb1ec126cff1f7db23
|
4
|
+
data.tar.gz: 1882754a1f6facf4278a5c4d2a767fcf92ed95be40406ced0f54379f56e9517f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 979e33b834bff279c92928cdc43e5131d94a789ae6f91d4f75a6bcc7a0db0cc490f0c3f6366b4d5ff426bf5cb0b6307aaa555a0614fc69bdb125a86f9925a1b2
|
7
|
+
data.tar.gz: 7b451cd82032800a2c7918d8f682b425c864d86cf8bfecd97d29e569ca51381bb97d7019b351156778037891aa5831c300aca9fda230e19ee80fe82adcd245fe
|
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.21
|
data/direct7.gemspec
CHANGED
@@ -4,7 +4,7 @@ require "direct7/version"
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "direct7"
|
7
|
-
spec.version = "0.0.
|
7
|
+
spec.version = "0.0.21"
|
8
8
|
spec.authors = ["Direct7 Networks"]
|
9
9
|
spec.email = ["support@d7networks.com"]
|
10
10
|
spec.summary = "Ruby SDK for Direct7 Platform REST API"
|
data/lib/direct7/sms.rb
CHANGED
@@ -8,7 +8,7 @@ module Direct7
|
|
8
8
|
@client = client
|
9
9
|
end
|
10
10
|
|
11
|
-
def send_message(originator, report_url, schedule_time, *args)
|
11
|
+
def send_message(originator, report_url, schedule_time, tag, *args)
|
12
12
|
messages = []
|
13
13
|
args.each do |message|
|
14
14
|
messages << {
|
@@ -22,7 +22,8 @@ module Direct7
|
|
22
22
|
message_globals = {
|
23
23
|
'originator' => originator,
|
24
24
|
'report_url' => report_url,
|
25
|
-
'schedule_time' => schedule_time
|
25
|
+
'schedule_time' => schedule_time,
|
26
|
+
'tag' => tag
|
26
27
|
};
|
27
28
|
payload = {
|
28
29
|
'messages' => messages,
|
data/lib/direct7/whatsapp.rb
CHANGED
@@ -83,7 +83,7 @@ module Direct7
|
|
83
83
|
response
|
84
84
|
end
|
85
85
|
|
86
|
-
def send_whatsapp_templated_message(originator, recipient, template_id, language, body_parameter_values=nil, media_type=nil, text_header_title=nil, media_url=nil, latitude=nil, longitude=nil, name=nil, address=nil, lto_expiration_time_ms=nil, coupon_code=nil, quick_replies=nil, actions=nil, carousel_cards=nil)
|
86
|
+
def send_whatsapp_templated_message(originator, recipient, template_id, language, body_parameter_values=nil, media_type=nil, text_header_title=nil, media_url=nil, latitude=nil, longitude=nil, name=nil, address=nil, lto_expiration_time_ms=nil, coupon_code=nil, quick_replies=nil, actions=nil,button_flow=nil, carousel_cards=nil)
|
87
87
|
allowed_media_types = ['image', 'document', 'video', 'audio', 'text', 'location']
|
88
88
|
template = {
|
89
89
|
'template_id' => template_id,
|
@@ -132,6 +132,12 @@ module Direct7
|
|
132
132
|
}
|
133
133
|
end
|
134
134
|
|
135
|
+
if button_flow
|
136
|
+
message['content']['template']['button'] = {
|
137
|
+
"button_flow"=>button_flow,
|
138
|
+
}
|
139
|
+
end
|
140
|
+
|
135
141
|
if coupon_code
|
136
142
|
message['content']['template']['buttons'] = {
|
137
143
|
'coupon_code' => [
|
@@ -223,6 +229,8 @@ module Direct7
|
|
223
229
|
message['content']['interactive']['action'] = {
|
224
230
|
'parameters' => parameters,
|
225
231
|
}
|
232
|
+
elsif interactive_type == 'flow'
|
233
|
+
message['content']['interactive']['action'] = parameters
|
226
234
|
end
|
227
235
|
end
|
228
236
|
|
data/test/test.rb
CHANGED
@@ -118,21 +118,21 @@ class TestSERVICES < Test::Unit::TestCase
|
|
118
118
|
response = @client.whatsapp.send_whatsapp_freeform_message(
|
119
119
|
originator= "971563XXXXXX",
|
120
120
|
recipient= "991999999XXXX",
|
121
|
-
message_type="CONTACTS",
|
121
|
+
message_type="CONTACTS",
|
122
122
|
body=nil,
|
123
123
|
first_name="Barbara",
|
124
124
|
last_name="Johnson",
|
125
125
|
formatted_name="Barbara J. Johnson",
|
126
|
-
middle_name="Joana",
|
126
|
+
middle_name="Joana",
|
127
127
|
suffix="Esq.",
|
128
128
|
prefix="Dr.",
|
129
129
|
birthday='4567-12-12',
|
130
|
-
phones=phones,
|
130
|
+
phones=phones,
|
131
131
|
emails=emails,
|
132
132
|
urls=urls,
|
133
133
|
latitude=nil, longitude=nil, name=nil, address=nil, type=nil, url=nil, caption=nil, filename=nil, message_id=nil, emoji=nil,
|
134
134
|
contact_addresses=contact_addresses,
|
135
|
-
|
135
|
+
|
136
136
|
)
|
137
137
|
# response = @client.whatsapp.get_status(request_id="81eca535-8131-4866-be18-b3d933604069")
|
138
138
|
puts response
|
@@ -145,7 +145,7 @@ class TestSERVICES < Test::Unit::TestCase
|
|
145
145
|
recipient='+991999999XXXX',
|
146
146
|
message_type='TEXT',
|
147
147
|
body='HI',
|
148
|
-
|
148
|
+
|
149
149
|
)
|
150
150
|
puts response
|
151
151
|
end
|
@@ -171,9 +171,9 @@ class TestSERVICES < Test::Unit::TestCase
|
|
171
171
|
originator='971563XXXXXX',
|
172
172
|
recipient='+991999999XXXX',
|
173
173
|
message_type='ATTACHMENT',
|
174
|
-
body=nil, first_name=nil, last_name=nil, formatted_name=nil, middle_name=nil, suffix=nil, prefix=nil, birthday=nil, phones=nil, emails=nil, urls=nil, latitude=nil, longitude=nil, name=nil, address=nil,
|
175
|
-
type='image',
|
176
|
-
url='https://t4.ftcdn.net/jpg/01/43/23/83/360_F_143238306_lh0ap42wgot36y44WybfQpvsJB5A1CHc.jpg',
|
174
|
+
body=nil, first_name=nil, last_name=nil, formatted_name=nil, middle_name=nil, suffix=nil, prefix=nil, birthday=nil, phones=nil, emails=nil, urls=nil, latitude=nil, longitude=nil, name=nil, address=nil,
|
175
|
+
type='image',
|
176
|
+
url='https://t4.ftcdn.net/jpg/01/43/23/83/360_F_143238306_lh0ap42wgot36y44WybfQpvsJB5A1CHc.jpg',
|
177
177
|
caption='Tet'
|
178
178
|
)
|
179
179
|
puts response
|
@@ -186,9 +186,9 @@ class TestSERVICES < Test::Unit::TestCase
|
|
186
186
|
originator='971563XXXXXX',
|
187
187
|
recipient='+991999999XXXX',
|
188
188
|
message_type='ATTACHMENT',
|
189
|
-
body=nil, first_name=nil, last_name=nil, formatted_name=nil, middle_name=nil, suffix=nil, prefix=nil, birthday=nil, phones=nil, emails=nil, urls=nil, latitude=nil, longitude=nil, name=nil, address=nil,
|
190
|
-
type='video',
|
191
|
-
url='https://www.onirikal.com/videos/mp4/nestlegold.mp4',
|
189
|
+
body=nil, first_name=nil, last_name=nil, formatted_name=nil, middle_name=nil, suffix=nil, prefix=nil, birthday=nil, phones=nil, emails=nil, urls=nil, latitude=nil, longitude=nil, name=nil, address=nil,
|
190
|
+
type='video',
|
191
|
+
url='https://www.onirikal.com/videos/mp4/nestlegold.mp4',
|
192
192
|
caption='Tet'
|
193
193
|
)
|
194
194
|
puts response
|
@@ -200,9 +200,9 @@ class TestSERVICES < Test::Unit::TestCase
|
|
200
200
|
originator='971563XXXXXX',
|
201
201
|
recipient='+991999999XXXX',
|
202
202
|
message_type='ATTACHMENT',
|
203
|
-
body=nil, first_name=nil, last_name=nil, formatted_name=nil, middle_name=nil, suffix=nil, prefix=nil, birthday=nil, phones=nil, emails=nil, urls=nil, latitude=nil, longitude=nil, name=nil, address=nil,
|
204
|
-
type='document',
|
205
|
-
url='https://www.clickdimensions.com/links/TestPDFfile.pdf',
|
203
|
+
body=nil, first_name=nil, last_name=nil, formatted_name=nil, middle_name=nil, suffix=nil, prefix=nil, birthday=nil, phones=nil, emails=nil, urls=nil, latitude=nil, longitude=nil, name=nil, address=nil,
|
204
|
+
type='document',
|
205
|
+
url='https://www.clickdimensions.com/links/TestPDFfile.pdf',
|
206
206
|
caption= "Test PDF file pdf",
|
207
207
|
filename= "TestPDFfile.pdf"
|
208
208
|
)
|
@@ -215,8 +215,8 @@ class TestSERVICES < Test::Unit::TestCase
|
|
215
215
|
originator='971563XXXXXX',
|
216
216
|
recipient='+991999999XXXX',
|
217
217
|
message_type='ATTACHMENT',
|
218
|
-
body=nil, first_name=nil, last_name=nil, formatted_name=nil, middle_name=nil, suffix=nil, prefix=nil, birthday=nil, phones=nil, emails=nil, urls=nil, latitude=nil, longitude=nil, name=nil, address=nil,
|
219
|
-
type='audio',
|
218
|
+
body=nil, first_name=nil, last_name=nil, formatted_name=nil, middle_name=nil, suffix=nil, prefix=nil, birthday=nil, phones=nil, emails=nil, urls=nil, latitude=nil, longitude=nil, name=nil, address=nil,
|
219
|
+
type='audio',
|
220
220
|
url='http://fate-suite.ffmpeg.org/mpegaudio/extra_overread.mp3'
|
221
221
|
)
|
222
222
|
puts response
|
@@ -229,8 +229,8 @@ class TestSERVICES < Test::Unit::TestCase
|
|
229
229
|
originator='971563XXXXXX',
|
230
230
|
recipient='+991999999XXXX',
|
231
231
|
message_type='ATTACHMENT',
|
232
|
-
body=nil, first_name=nil, last_name=nil, formatted_name=nil, middle_name=nil, suffix=nil, prefix=nil, birthday=nil, phones=nil, emails=nil, urls=nil, latitude=nil, longitude=nil, name=nil, address=nil,
|
233
|
-
type='sticker',
|
232
|
+
body=nil, first_name=nil, last_name=nil, formatted_name=nil, middle_name=nil, suffix=nil, prefix=nil, birthday=nil, phones=nil, emails=nil, urls=nil, latitude=nil, longitude=nil, name=nil, address=nil,
|
233
|
+
type='sticker',
|
234
234
|
url='https://raw.githubusercontent.com/sagarbhavsar4328/dummys3bucket/master/sample3.webp'
|
235
235
|
)
|
236
236
|
puts response
|
@@ -242,10 +242,10 @@ class TestSERVICES < Test::Unit::TestCase
|
|
242
242
|
originator='971563XXXXXX',
|
243
243
|
recipient='+991999999XXXX',
|
244
244
|
message_type='LOCATION',
|
245
|
-
body=nil, first_name=nil, last_name=nil, formatted_name=nil, middle_name=nil, suffix=nil, prefix=nil, birthday=nil, phones=nil, emails=nil, urls=nil,
|
246
|
-
latitude='12.93803129081362',
|
247
|
-
longitude='77.61088653615994',
|
248
|
-
name='Mobile Pvt Ltd',
|
245
|
+
body=nil, first_name=nil, last_name=nil, formatted_name=nil, middle_name=nil, suffix=nil, prefix=nil, birthday=nil, phones=nil, emails=nil, urls=nil,
|
246
|
+
latitude='12.93803129081362',
|
247
|
+
longitude='77.61088653615994',
|
248
|
+
name='Mobile Pvt Ltd',
|
249
249
|
address='Bengaluru, Karnataka 56009'
|
250
250
|
)
|
251
251
|
puts response
|
@@ -254,7 +254,7 @@ class TestSERVICES < Test::Unit::TestCase
|
|
254
254
|
# // Templated: no body parm
|
255
255
|
def test_send_whatsapp_templated_message
|
256
256
|
response = @client.whatsapp.send_whatsapp_templated_message(
|
257
|
-
originator='971563XXXXXX',
|
257
|
+
originator='971563XXXXXX',
|
258
258
|
recipient='991999999XXXX',
|
259
259
|
template_id="testing_alpha", language="en"
|
260
260
|
)
|
@@ -264,9 +264,9 @@ class TestSERVICES < Test::Unit::TestCase
|
|
264
264
|
# // Templated: with body parm
|
265
265
|
def test_send_whatsapp_templated_message
|
266
266
|
response = @client.whatsapp.send_whatsapp_templated_message(
|
267
|
-
originator='971563XXXXXX',
|
267
|
+
originator='971563XXXXXX',
|
268
268
|
recipient='991999999XXXX',
|
269
|
-
template_id="with_personalize",
|
269
|
+
template_id="with_personalize",
|
270
270
|
language="en",
|
271
271
|
body_parameter_values={"0": "Anil"}
|
272
272
|
)
|
@@ -276,7 +276,7 @@ class TestSERVICES < Test::Unit::TestCase
|
|
276
276
|
# Templated: Text
|
277
277
|
def test_send_whatsapp_templated_message
|
278
278
|
response = @client.whatsapp.send_whatsapp_templated_message(
|
279
|
-
originator='971563XXXXXX',
|
279
|
+
originator='971563XXXXXX',
|
280
280
|
recipient='991999999XXXX',
|
281
281
|
template_id="header_param", language="en",
|
282
282
|
body_parameter_values=nil,
|
@@ -289,9 +289,9 @@ class TestSERVICES < Test::Unit::TestCase
|
|
289
289
|
# Templated: Image
|
290
290
|
def test_send_whatsapp_templated_message
|
291
291
|
response = @client.whatsapp.send_whatsapp_templated_message(
|
292
|
-
originator='971563XXXXXX',
|
292
|
+
originator='971563XXXXXX',
|
293
293
|
recipient='991999999XXXX',
|
294
|
-
template_id="image",
|
294
|
+
template_id="image",
|
295
295
|
language="en",
|
296
296
|
body_parameter_values=nil,
|
297
297
|
media_type="image",
|
@@ -304,9 +304,9 @@ class TestSERVICES < Test::Unit::TestCase
|
|
304
304
|
# Templated: Video
|
305
305
|
def test_send_whatsapp_templated_message
|
306
306
|
response = @client.whatsapp.send_whatsapp_templated_message(
|
307
|
-
originator='971563XXXXXX',
|
307
|
+
originator='971563XXXXXX',
|
308
308
|
recipient='991999999XXXX',
|
309
|
-
template_id="video",
|
309
|
+
template_id="video",
|
310
310
|
language="en",
|
311
311
|
body_parameter_values=nil,
|
312
312
|
media_type="video",
|
@@ -319,9 +319,9 @@ class TestSERVICES < Test::Unit::TestCase
|
|
319
319
|
# Templated: document
|
320
320
|
def test_send_whatsapp_templated_message
|
321
321
|
response = @client.whatsapp.send_whatsapp_templated_message(
|
322
|
-
originator='971563XXXXXX',
|
322
|
+
originator='971563XXXXXX',
|
323
323
|
recipient='991999999XXXX',
|
324
|
-
template_id="document",
|
324
|
+
template_id="document",
|
325
325
|
language="en",
|
326
326
|
body_parameter_values={"0": "first_parameter_in_your_template"},
|
327
327
|
media_type="document",
|
@@ -334,9 +334,9 @@ class TestSERVICES < Test::Unit::TestCase
|
|
334
334
|
# Templated: Location
|
335
335
|
def test_send_whatsapp_templated_message
|
336
336
|
response = @client.whatsapp.send_whatsapp_templated_message(
|
337
|
-
originator='971563XXXXXX',
|
337
|
+
originator='971563XXXXXX',
|
338
338
|
recipient='991999999XXXX',
|
339
|
-
template_id='location',
|
339
|
+
template_id='location',
|
340
340
|
language='en',
|
341
341
|
body_parameter_values=nil,
|
342
342
|
media_type='location',
|
@@ -362,16 +362,44 @@ class TestSERVICES < Test::Unit::TestCase
|
|
362
362
|
}
|
363
363
|
]
|
364
364
|
response = @client.whatsapp.send_whatsapp_templated_message(
|
365
|
-
originator='971563XXXXXX',
|
365
|
+
originator='971563XXXXXX',
|
366
366
|
recipient='991999999XXXX',
|
367
|
-
template_id="quick_reply",
|
367
|
+
template_id="quick_reply",
|
368
368
|
language="en",
|
369
369
|
body_parameter_values=nil, media_type=nil, text_header_title=nil, media_url=nil, latitude=nil, longitude=nil, name=nil, address=nil,lto_expiration_time_ms=nil, coupon_code=nil,
|
370
370
|
quick_replies=quick_replies
|
371
371
|
)
|
372
372
|
puts response
|
373
373
|
end
|
374
|
-
|
374
|
+
|
375
|
+
# Templated :button_flow
|
376
|
+
button_flow=[
|
377
|
+
{"flow_token":"unused",
|
378
|
+
"action_type":"flow",
|
379
|
+
"index":"0",
|
380
|
+
"flow_action_data":{}
|
381
|
+
}
|
382
|
+
]
|
383
|
+
def test_send_whatsapp_templated_message
|
384
|
+
button_flow=[
|
385
|
+
{"flow_token":"unused",
|
386
|
+
"action_type":"flow",
|
387
|
+
"index":"0",
|
388
|
+
"flow_action_data":{}
|
389
|
+
}
|
390
|
+
]
|
391
|
+
response = @client.whatsapp.send_whatsapp_templated_message(
|
392
|
+
originator='971563XXXXXX',
|
393
|
+
recipient='991999999XXXX',
|
394
|
+
template_id="call_to_action",
|
395
|
+
language="en",
|
396
|
+
body_parameter_values=nil, media_type=nil, text_header_title=nil, media_url=nil, latitude=nil, longitude=nil, name=nil, address=nil,lto_expiration_time_ms=nil, coupon_code=nil,
|
397
|
+
quick_replies=nil,
|
398
|
+
actions=nil,
|
399
|
+
button_flow=button_flow
|
400
|
+
)
|
401
|
+
puts response
|
402
|
+
end
|
375
403
|
|
376
404
|
# Templated: actions
|
377
405
|
actions = [
|
@@ -381,7 +409,7 @@ class TestSERVICES < Test::Unit::TestCase
|
|
381
409
|
"action_payload" => "dash"
|
382
410
|
}
|
383
411
|
]
|
384
|
-
|
412
|
+
|
385
413
|
def test_send_whatsapp_templated_message
|
386
414
|
actions = [
|
387
415
|
{
|
@@ -391,9 +419,9 @@ class TestSERVICES < Test::Unit::TestCase
|
|
391
419
|
}
|
392
420
|
]
|
393
421
|
response = @client.whatsapp.send_whatsapp_templated_message(
|
394
|
-
originator='971563XXXXXX',
|
422
|
+
originator='971563XXXXXX',
|
395
423
|
recipient='991999999XXXX',
|
396
|
-
template_id="call_to_action",
|
424
|
+
template_id="call_to_action",
|
397
425
|
language="en",
|
398
426
|
body_parameter_values=nil, media_type=nil, text_header_title=nil, media_url=nil, latitude=nil, longitude=nil, name=nil, address=nil,lto_expiration_time_ms=nil, coupon_code=nil,
|
399
427
|
quick_replies=nil,
|
@@ -405,11 +433,11 @@ class TestSERVICES < Test::Unit::TestCase
|
|
405
433
|
# // Templated: coupon_code
|
406
434
|
def test_send_whatsapp_templated_message
|
407
435
|
response = @client.whatsapp.send_whatsapp_templated_message(
|
408
|
-
originator='971563XXXXXX',
|
436
|
+
originator='971563XXXXXX',
|
409
437
|
recipient='991999999XXXX',
|
410
|
-
template_id="coupon_code",
|
438
|
+
template_id="coupon_code",
|
411
439
|
language="en",
|
412
|
-
body_parameter_values={"0": "first_parameter_in_your_template"},
|
440
|
+
body_parameter_values={"0": "first_parameter_in_your_template"},
|
413
441
|
media_type=nil, text_header_title=nil, media_url=nil, latitude=nil, longitude=nil, name=nil, address=nil,lto_expiration_time_ms=nil,
|
414
442
|
coupon_code="DAS558HG"
|
415
443
|
)
|
@@ -419,7 +447,7 @@ class TestSERVICES < Test::Unit::TestCase
|
|
419
447
|
# Templated: LTO
|
420
448
|
def test_send_whatsapp_templated_message
|
421
449
|
response = @client.whatsapp.send_whatsapp_templated_message(
|
422
|
-
originator='971563XXXXXX',
|
450
|
+
originator='971563XXXXXX',
|
423
451
|
recipient='991999999XXXX',
|
424
452
|
template_id="limited_time_offer", language="en",
|
425
453
|
body_parameter_values=nil,
|
@@ -492,9 +520,9 @@ class TestSERVICES < Test::Unit::TestCase
|
|
492
520
|
}
|
493
521
|
]
|
494
522
|
response = @client.whatsapp.send_whatsapp_templated_message(
|
495
|
-
originator='971563XXXXXX',
|
523
|
+
originator='971563XXXXXX',
|
496
524
|
recipient='991999999XXXX',
|
497
|
-
template_id="carousel_card",
|
525
|
+
template_id="carousel_card",
|
498
526
|
language="en",
|
499
527
|
body_parameter_values=nil, media_type=nil, text_header_title=nil, media_url=nil, latitude=nil, longitude=nil, name=nil, address=nil,lto_expiration_time_ms=nil, coupon_code=nil,
|
500
528
|
quick_replies=nil, actions=nil, carousel_cards=cards
|
@@ -509,7 +537,7 @@ class TestSERVICES < Test::Unit::TestCase
|
|
509
537
|
"url": "https://www.luckyshrub.com?clickID=kqDGWd24Q5TRwoEQTICY7W1JKoXvaZOXWAS7h1P76s0R7Paec4"
|
510
538
|
}
|
511
539
|
response = @client.whatsapp.send_whatsapp_interactive_message(
|
512
|
-
originator='971563XXXXXX',
|
540
|
+
originator='971563XXXXXX',
|
513
541
|
recipient='991999999XXXX',
|
514
542
|
interactive_type= "cta_url",
|
515
543
|
header_type= "text",
|
@@ -530,7 +558,7 @@ class TestSERVICES < Test::Unit::TestCase
|
|
530
558
|
"reply": {"id": "2", "title": "Credit"}
|
531
559
|
}]
|
532
560
|
response = @client.whatsapp.send_whatsapp_interactive_message(
|
533
|
-
originator='971563XXXXXX',
|
561
|
+
originator='971563XXXXXX',
|
534
562
|
recipient='991999999XXXX',
|
535
563
|
interactive_type= "button",
|
536
564
|
header_type= "text",
|
@@ -538,7 +566,7 @@ class TestSERVICES < Test::Unit::TestCase
|
|
538
566
|
header_link=nil, header_file_name=nil,
|
539
567
|
body_text= "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
|
540
568
|
footer_text= "Thank You",
|
541
|
-
parameters= nil, sections=nil,
|
569
|
+
parameters= nil, sections=nil,
|
542
570
|
buttons=buttons
|
543
571
|
)
|
544
572
|
puts response
|
@@ -547,7 +575,7 @@ class TestSERVICES < Test::Unit::TestCase
|
|
547
575
|
# Interactive : location request
|
548
576
|
def test_send_whatsapp_interactive_message
|
549
577
|
response = @client.whatsapp.send_whatsapp_interactive_message(
|
550
|
-
originator='971563XXXXXX',
|
578
|
+
originator='971563XXXXXX',
|
551
579
|
recipient='991999999XXXX',
|
552
580
|
interactive_type= "location_request_message",
|
553
581
|
header_type= nil,
|
@@ -555,7 +583,7 @@ class TestSERVICES < Test::Unit::TestCase
|
|
555
583
|
header_link=nil, header_file_name=nil,
|
556
584
|
body_text= "Lets make a trip!",
|
557
585
|
footer_text= nil,
|
558
|
-
parameters= nil, sections=nil,
|
586
|
+
parameters= nil, sections=nil,
|
559
587
|
buttons=nil
|
560
588
|
)
|
561
589
|
puts response
|
@@ -614,7 +642,7 @@ class TestSERVICES < Test::Unit::TestCase
|
|
614
642
|
]
|
615
643
|
}
|
616
644
|
response = @client.whatsapp.send_whatsapp_interactive_message(
|
617
|
-
originator='971563XXXXXX',
|
645
|
+
originator='971563XXXXXX',
|
618
646
|
recipient='991999999XXXX',
|
619
647
|
interactive_type= "address_message",
|
620
648
|
header_type= "text",
|
@@ -626,7 +654,35 @@ class TestSERVICES < Test::Unit::TestCase
|
|
626
654
|
)
|
627
655
|
puts response
|
628
656
|
end
|
657
|
+
# Interactive :Flow
|
658
|
+
def test_send_whatsapp_templated_message
|
659
|
+
flow_parameter= {
|
660
|
+
"name": "flow",
|
661
|
+
"parameters": {
|
662
|
+
"flow_message_version": "3",
|
663
|
+
"flow_token": "unused",
|
664
|
+
"flow_id": "530404409952136",
|
665
|
+
"flow_cta": "Book Demo",
|
666
|
+
"flow_action": "navigate",
|
667
|
+
"flow_action_payload": {
|
668
|
+
"screen": "screen_"
|
669
|
+
}
|
670
|
+
}
|
671
|
+
}
|
629
672
|
|
673
|
+
response = @client.whatsapp.send_whatsapp_interactive_message(
|
674
|
+
originator='971563XXXXXX',
|
675
|
+
recipient='991999999XXXX',
|
676
|
+
interactive_type= "flow",
|
677
|
+
header_type= "text",
|
678
|
+
header_text= "Payment$ for D7 Whatsapp Service",
|
679
|
+
header_link=nil, header_file_name=nil,
|
680
|
+
body_text= "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
|
681
|
+
footer_text= "Thank You",
|
682
|
+
parameters=flow_parameter,
|
683
|
+
)
|
684
|
+
puts response
|
685
|
+
end
|
630
686
|
# Interactive : list
|
631
687
|
def test_send_whatsapp_interactive_message
|
632
688
|
sections = [
|
@@ -657,7 +713,7 @@ class TestSERVICES < Test::Unit::TestCase
|
|
657
713
|
}
|
658
714
|
]
|
659
715
|
response = @client.whatsapp.send_whatsapp_interactive_message(
|
660
|
-
originator='971563XXXXXX',
|
716
|
+
originator='971563XXXXXX',
|
661
717
|
recipient='991999999XXXX',
|
662
718
|
interactive_type= "list",
|
663
719
|
header_type= "text",
|
@@ -665,7 +721,7 @@ class TestSERVICES < Test::Unit::TestCase
|
|
665
721
|
header_link=nil, header_file_name=nil,
|
666
722
|
body_text= "Direct7 Networks is a messaging service provider that specializes in helping organizations efficiently communicate with their customers.",
|
667
723
|
footer_text= "Thank You",
|
668
|
-
parameters= nil, sections=sections,
|
724
|
+
parameters= nil, sections=sections,
|
669
725
|
buttons=nil, list_button_text='Choose Service'
|
670
726
|
)
|
671
727
|
puts response
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: direct7
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Direct7 Networks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|