direct7 0.0.1 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/Direct7/AuthenticationError.html +206 -0
- data/doc/Direct7/BadRequest.html +124 -0
- data/doc/Direct7/Client.html +1125 -0
- data/doc/Direct7/ClientError.html +124 -0
- data/doc/Direct7/InsufficientCreditError.html +124 -0
- data/doc/Direct7/NUMBER_LOOKUP.html +283 -0
- data/doc/Direct7/NotFoundError.html +124 -0
- data/doc/Direct7/SLACK.html +349 -0
- data/doc/Direct7/SMS.html +349 -0
- data/doc/Direct7/ServerError.html +124 -0
- data/doc/Direct7/VERIFY.html +493 -0
- data/doc/Direct7/VIBER.html +351 -0
- data/doc/Direct7/ValidationError.html +124 -0
- data/doc/Direct7/WHATSAPP.html +527 -0
- data/doc/Direct7.html +133 -0
- data/doc/_index.html +272 -0
- data/doc/class_list.html +51 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +497 -0
- data/doc/file.README.html +253 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/index.html +253 -0
- data/doc/js/app.js +314 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +331 -0
- data/doc/top-level-namespace.html +110 -0
- data/lib/direct7/version.rb +2 -2
- data/lib/direct7.rb +1 -0
- metadata +47 -3
data/doc/index.html
ADDED
@@ -0,0 +1,253 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
File: README
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.34
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "README";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index</a> »
|
40
|
+
<span class="title">File: README</span>
|
41
|
+
|
42
|
+
</div>
|
43
|
+
|
44
|
+
<div id="search">
|
45
|
+
|
46
|
+
<a class="full_list_link" id="class_list_link"
|
47
|
+
href="class_list.html">
|
48
|
+
|
49
|
+
<svg width="24" height="24">
|
50
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
51
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
52
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
</svg>
|
54
|
+
</a>
|
55
|
+
|
56
|
+
</div>
|
57
|
+
<div class="clear"></div>
|
58
|
+
</div>
|
59
|
+
|
60
|
+
<div id="content"><div id='filecontents'>
|
61
|
+
<h1 id="label-Direct7+Ruby+SDK">Direct7 Ruby SDK</h1>
|
62
|
+
|
63
|
+
<p>This Ruby SDK provides a convenient and easy-to-use interface to the Direct7 REST API. The SDK allows you to perform all the operations that are available through the REST API.</p>
|
64
|
+
|
65
|
+
<h2 id="label-Installation">Installation</h2>
|
66
|
+
|
67
|
+
<p>The SDK is available on RubyGems and can be installed using <code>gem</code>:</p>
|
68
|
+
|
69
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='id identifier rubyid_install'>install</span> <span class='id identifier rubyid_direct7'>direct7</span>
|
70
|
+
</code></pre>
|
71
|
+
|
72
|
+
<h2 id="label-Usage">Usage</h2>
|
73
|
+
|
74
|
+
<p>The SDK is designed to be easy to use. To get started, you need to create a client instance:</p>
|
75
|
+
|
76
|
+
<h3 id="label-Send+SMS">Send SMS</h3>
|
77
|
+
|
78
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
79
|
+
|
80
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
81
|
+
|
82
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_sms'>sms</span><span class='period'>.</span><span class='id identifier rubyid_send_message'>send_message</span><span class='lparen'>(</span> <span class='id identifier rubyid_recipients'>recipients</span> <span class='op'>=</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>+91999999XXXX</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Greetings from D7 API</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_originator'>originator</span> <span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>SignOTP</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_report_url'>report_url</span> <span class='op'>=</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>https://the_url_to_recieve_delivery_report.com</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_unicode'>unicode</span> <span class='op'>=</span><span class='kw'>true</span><span class='rparen'>)</span>
|
83
|
+
</code></pre>
|
84
|
+
|
85
|
+
<h3 id="label-Send+SMS+-28Unicode-29">Send SMS (Unicode)</h3>
|
86
|
+
|
87
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
88
|
+
|
89
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
90
|
+
|
91
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_sms'>sms</span><span class='period'>.</span><span class='id identifier rubyid_send_message'>send_message</span><span class='lparen'>(</span><span class='id identifier rubyid_recipients'>recipients</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>+97150900XXXX</span><span class='tstring_end'>"</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>+97845900XXX</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>مرحبا بالعالم!</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_originator'>originator</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>SignOTP</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_report_url'>report_url</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://the_url_to_recieve_delivery_report.com</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_unicode'>unicode</span> <span class='op'>=</span> <span class='const'>True</span><span class='rparen'>)</span>
|
92
|
+
</code></pre>
|
93
|
+
|
94
|
+
<h3 id="label-Get+Request+Status">Get Request Status</h3>
|
95
|
+
|
96
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
97
|
+
|
98
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
99
|
+
|
100
|
+
<span class='comment'># request_id is the id returned in the response of send_message
|
101
|
+
</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_sms'>sms</span><span class='period'>.</span><span class='id identifier rubyid_get_status'>get_status</span><span class='lparen'>(</span><span class='id identifier rubyid_request_id'>request_id</span><span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>001a1a4e-0221-4cb7-a524-a2a5b337cbe8</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
102
|
+
</code></pre>
|
103
|
+
|
104
|
+
<h3 id="label-Send+OTP">Send OTP</h3>
|
105
|
+
|
106
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
107
|
+
|
108
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
109
|
+
|
110
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_verify'>verify</span><span class='period'>.</span><span class='id identifier rubyid_send_otp'>send_otp</span><span class='lparen'>(</span><span class='id identifier rubyid_originator'>originator</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>SignOTP</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_recipient'>recipient</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>+97150900XXXX</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Greetings from D7 API, your mobile verification code is: {}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_expiry'>expiry</span> <span class='op'>=</span> <span class='int'>600</span><span class='comma'>,</span> <span class='id identifier rubyid_data_coding'>data_coding</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>text</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
111
|
+
</code></pre>
|
112
|
+
|
113
|
+
<h3 id="label-Re-Send+OTP">Re-Send OTP</h3>
|
114
|
+
|
115
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
116
|
+
|
117
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
118
|
+
|
119
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_verify'>verify</span><span class='period'>.</span><span class='id identifier rubyid_resend_otp'>resend_otp</span><span class='lparen'>(</span><span class='id identifier rubyid_otp_id'>otp_id</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0012c7f5-2ba5-49db-8901-4ee9be6dc8d1</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
120
|
+
</code></pre>
|
121
|
+
|
122
|
+
<h3 id="label-Verify+OTP">Verify OTP</h3>
|
123
|
+
|
124
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
125
|
+
|
126
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
127
|
+
|
128
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_verify'>verify</span><span class='period'>.</span><span class='id identifier rubyid_verify_otp'>verify_otp</span><span class='lparen'>(</span><span class='id identifier rubyid_otp_id'>otp_id</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0012c7f5-2ba5-49db-8901-4ee9be6dc8d1</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_otp_code'>otp_code</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>1425</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
129
|
+
</code></pre>
|
130
|
+
|
131
|
+
<h3 id="label-Get+Request+Status">Get Request Status</h3>
|
132
|
+
|
133
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
134
|
+
|
135
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
136
|
+
|
137
|
+
<span class='comment'># otp_id is the id returned in the response of send_otp
|
138
|
+
</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_verify'>verify</span><span class='period'>.</span><span class='id identifier rubyid_get_status'>get_status</span><span class='lparen'>(</span><span class='id identifier rubyid_otp_id'>otp_id</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0012c7f5-2ba5-49db-8901-4ee9be6dc8d1</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
139
|
+
</code></pre>
|
140
|
+
|
141
|
+
<h3 id="label-Send+Viber+Message">Send Viber Message</h3>
|
142
|
+
|
143
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
144
|
+
|
145
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
146
|
+
|
147
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_viber'>viber</span><span class='period'>.</span><span class='id identifier rubyid_send_viber_message'>send_viber_message</span><span class='lparen'>(</span><span class='id identifier rubyid_recipients'>recipients</span><span class='op'>=</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>+97150900XXXX</span><span class='tstring_end'>"</span></span><span class='comma'>,</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>+97845900XXX</span><span class='tstring_end'>"</span></span><span class='rbracket'>]</span><span class='comma'>,</span> <span class='id identifier rubyid_content'>content</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Greetings from D7 API</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_label'>label</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>PROMOTION</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_originator'>originator</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>INFO2WAY</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_call_back_url'>call_back_url</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://the_url_to_recieve_delivery_report.com</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
148
|
+
</code></pre>
|
149
|
+
|
150
|
+
<h3 id="label-Get+Request+Status">Get Request Status</h3>
|
151
|
+
|
152
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
153
|
+
|
154
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
155
|
+
|
156
|
+
<span class='comment'># request_id is the id returned in the response of send_viber_message
|
157
|
+
</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_viber'>viber</span><span class='period'>.</span><span class='id identifier rubyid_get_status'>get_status</span><span class='lparen'>(</span><span class='id identifier rubyid_request_id'>request_id</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0012c7f5-2ba5-49db-8901-4ee9be6dc8d1</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
158
|
+
</code></pre>
|
159
|
+
|
160
|
+
<h3 id="label-Send+Slack+Message">Send Slack Message</h3>
|
161
|
+
|
162
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
163
|
+
|
164
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
165
|
+
|
166
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_slack'>slack</span><span class='period'>.</span><span class='id identifier rubyid_send_slack_message'>send_slack_message</span><span class='lparen'>(</span><span class='id identifier rubyid_content'>content</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Greetings from D7 API</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_work_space_name'>work_space_name</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>WorkspaceName</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_channel_name'>channel_name</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>ChannelName</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_report_url'>report_url</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://the_url_to_recieve_delivery_report.com</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
167
|
+
</code></pre>
|
168
|
+
|
169
|
+
<h3 id="label-Get+Request+Status">Get Request Status</h3>
|
170
|
+
|
171
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
172
|
+
|
173
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
174
|
+
|
175
|
+
<span class='comment'># request_id is the id returned in the response of send_slack_message
|
176
|
+
</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_slack'>slack</span><span class='period'>.</span><span class='id identifier rubyid_get_status'>get_status</span><span class='lparen'>(</span><span class='id identifier rubyid_request_id'>request_id</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0012c7f5-2ba5-49db-8901-4ee9be6dc8d1</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
177
|
+
</code></pre>
|
178
|
+
|
179
|
+
<h3 id="label-Search+Your+Number+details">Search Your Number details</h3>
|
180
|
+
|
181
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
182
|
+
|
183
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
184
|
+
|
185
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_number_lookup'>number_lookup</span><span class='period'>.</span><span class='id identifier rubyid_search_number_details'>search_number_details</span><span class='lparen'>(</span><span class='id identifier rubyid_recipient'>recipient</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>+914257845XXXX</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
186
|
+
</code></pre>
|
187
|
+
|
188
|
+
<h3 id="label-Send+Whatsapp+Free-form+Message+-28Contact+Details-29">Send Whatsapp Free-form Message (Contact Details)</h3>
|
189
|
+
|
190
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
191
|
+
|
192
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
193
|
+
|
194
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_whatsapp'>whatsapp</span><span class='period'>.</span><span class='id identifier rubyid_send_whatsapp_freeform_message'>send_whatsapp_freeform_message</span><span class='lparen'>(</span><span class='id identifier rubyid_originator'>originator</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>91906152XXXX</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_recipient'>recipient</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>91906152XXXX</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_message_type'>message_type</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>CONTACTS</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_first_name'>first_name</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Amal</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_last_name'>last_name</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Anu</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_display_name'>display_name</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>Amal Anu</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_phone'>phone</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>91906152XXXX</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_email'>email</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>amal@gmail.com</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
195
|
+
</code></pre>
|
196
|
+
|
197
|
+
<h3 id="label-Send+Whatsapp+Templated+Message.">Send Whatsapp Templated Message.</h3>
|
198
|
+
|
199
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
200
|
+
|
201
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
202
|
+
|
203
|
+
<span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_whatsapp'>whatsapp</span><span class='period'>.</span><span class='id identifier rubyid_send_whatsapp_templated_message'>send_whatsapp_templated_message</span><span class='lparen'>(</span><span class='id identifier rubyid_originator'>originator</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>91906152XXXX</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_recipient'>recipient</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>91906152XXXX</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_message_type'>message_type</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>TEMPLATE</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_template_id'>template_id</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>monthly_promotion</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_body_parameter_values'>body_parameter_values</span><span class='op'>=</span><span class='lbrace'>{</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0</span><span class='label_end'>":</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>promotion</span><span class='tstring_end'>"</span></span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
204
|
+
</code></pre>
|
205
|
+
|
206
|
+
<h3 id="label-Get+Request+Status">Get Request Status</h3>
|
207
|
+
|
208
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>direct7</span><span class='tstring_end'>'</span></span>
|
209
|
+
|
210
|
+
<span class='id identifier rubyid_client'>client</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Direct7.html" title="Direct7 (module)">Direct7</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Direct7/Client.html" title="Direct7::Client (class)">Client</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Direct7/Client.html#initialize-instance_method" title="Direct7::Client#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>Your API token</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span>
|
211
|
+
|
212
|
+
<span class='comment'># request_id is the id returned in the response of send_message
|
213
|
+
</span><span class='id identifier rubyid_client'>client</span><span class='period'>.</span><span class='id identifier rubyid_whatsapp'>whatsapp</span><span class='period'>.</span><span class='id identifier rubyid_get_status'>get_status</span><span class='lparen'>(</span><span class='id identifier rubyid_request_id'>request_id</span><span class='op'>=</span><span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>0012c7f5-2ba5-49db-8901-4ee9be6dc8d1</span><span class='tstring_end'>"</span></span><span class='rparen'>)</span>
|
214
|
+
</code></pre>
|
215
|
+
|
216
|
+
<h2 id="label-FAQ">FAQ</h2>
|
217
|
+
|
218
|
+
<h3 id="label-How+do+I+get+my+API+token-3F">How do I get my API token?</h3>
|
219
|
+
|
220
|
+
<p>You can get your API token from the Direct7 dashboard. If you don't have an account yet, you can create one for free.</p>
|
221
|
+
|
222
|
+
<h3 id="label-Supported+ruby+versions">Supported ruby versions</h3>
|
223
|
+
|
224
|
+
<p>The SDK supports ruby 3.0 and higher.</p>
|
225
|
+
|
226
|
+
<h3 id="label-Supported+APIs">Supported APIs</h3>
|
227
|
+
|
228
|
+
<p>As of now, the SDK supports the following APIs:</p>
|
229
|
+
|
230
|
+
<p>| API | Supported? | |————————|:————————:| | SMS API | ✅ | | Verify API | ✅ | | Whatsapp API | ✅ | | Number Lookup API | ✅ | | Viber API | ✅ | | Slack API | ✅ |</p>
|
231
|
+
|
232
|
+
<h3 id="label-How+do+I+get+started-3F">How do I get started?</h3>
|
233
|
+
|
234
|
+
<p>You can find the platform documentation @ <a href="https://d7networks.com/docs/">Direct7 Docs</a>.</p>
|
235
|
+
|
236
|
+
<h3 id="label-How+do+I+get+help-3F">How do I get help?</h3>
|
237
|
+
|
238
|
+
<p>If you need help using the SDK, you can create an issue on GitHub or email to support@d7networks.com</p>
|
239
|
+
|
240
|
+
<h2 id="label-Contributing">Contributing</h2>
|
241
|
+
|
242
|
+
<p>We welcome contributions to the Direct7 ruby SDK. If you have any ideas for improvements or bug fixes, please feel free to create an issue on GitHub.</p>
|
243
|
+
</div></div>
|
244
|
+
|
245
|
+
<div id="footer">
|
246
|
+
Generated on Fri Nov 3 09:22:45 2023 by
|
247
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
248
|
+
0.9.34 (ruby-2.7.4).
|
249
|
+
</div>
|
250
|
+
|
251
|
+
</div>
|
252
|
+
</body>
|
253
|
+
</html>
|