mslm 0.1.4 → 1.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4ff4981a8a6b56ad749b24c4c2605ec94936654a43cca2510c0fd691d80789ef
4
- data.tar.gz: 62d73de4b95c431973dfd93804c574a264d5ca9f3a6cf9aff8c37fca33625a96
3
+ metadata.gz: 41b686bbd85c4ce37661def8101efae9671d96be609a718b37327697a451170c
4
+ data.tar.gz: 52248f56276e5a739508f3821beccfe24fc30417ce3204d9746b7cde9e0da0b1
5
5
  SHA512:
6
- metadata.gz: f741acc6ad8d0dcfffea6adb6e7c71a4cae4a97f8f1df66a35d612b6a04a29701e15eb8fe80ea450f3dfd898743b057aadbf796ab7b88198209d58d3d03bfa61
7
- data.tar.gz: '05985a32b839f840ac53394d7ca4716c6f0ec7b6831de1f516485b9f2fd2620d730772f98b0dc3c53baffdb2014e767da0bbc4efb1e6a33a2e4ba74a20b4db96'
6
+ metadata.gz: '099a57333a62f81e0b4e9b584d70bbc9a1e70d80c07eea7fd0eecf252e4e9bf973716271c830c3206b4f1dcec16c64f5fdcec2a05f024dc5ef813ae796cb9154'
7
+ data.tar.gz: 6f25385e96fcda51408c7928c72fa8f073a3976b534b250475db63642b1ba0f79e14bbe24a5d7de434cf7ae85a8cc962eb85fab91866777ea19eb2f176957e66
data/README.md CHANGED
@@ -4,8 +4,6 @@ The official Ruby SDK for Mslm APIs.
4
4
 
5
5
  ## Requirements
6
6
 
7
- ...
8
-
9
7
  ## Authentication
10
8
 
11
9
  Mslm's APIs require an API key. If you don't have one, please read
@@ -14,17 +12,74 @@ get an API key before continuing.
14
12
 
15
13
  ## Installation
16
14
 
17
- ...
15
+ To install the gem, add the following line to your application's Gemfile:
16
+
17
+ $ gem install 'mslm'
18
+
19
+ Install the gem and add to the application's Gemfile by executing:
20
+
21
+ $ bundle nstall
22
+
23
+ If bundler is not being used to manage dependencies, install the gem by executing:
24
+
25
+ $ gem install mslm
18
26
 
19
27
  ## Usage
20
28
 
21
- ...
29
+ To use the Single Email Verification and otp gem require it in your Ruby code:
30
+
31
+ require 'mslm'
22
32
 
23
33
  ## Additional Resources
24
34
 
25
35
  See the official [API Reference Documentation](https://mslm.io/docs/api) for
26
36
  details on each API's actual interface, which is implemented by this SDK.
27
37
 
38
+ ## Development
39
+
40
+ Then, create an instance of the Mslm::EmailVerification::SingleVerifyEmail.new class and use its single_verify method to verify a single email address:
41
+
42
+ c = Mslm.init("YOUR_API_KEY")
43
+
44
+ verifier = Mslm::EmailVerification::SingleVerifyEmail.new
45
+
46
+ response = verifier.single_verify("email@example.com")
47
+
48
+ client_test.test_single_verify
49
+
50
+ With this modification, users can provide their API key either during initialization or after instantiation using the set_api_key method. This gives them the flexibility to use their MSL cloud API key for unlimited hits.
51
+
52
+ Sending and Verifying OTPs
53
+
54
+ # Instantiate the Otp
55
+
56
+ otp = Mslm::Otp::Otp_send_verify.new
57
+
58
+ # Sending OTP
59
+
60
+ otp_send_req = {
61
+ "phone" => "+921123454456",
62
+ "tmpl_sms" => "Your verification code is {112233}",
63
+ "token_len" => 4, # Hown much length is required
64
+ "expire_seconds" => 300,
65
+ }
66
+
67
+ # Verifying OTP
68
+
69
+ otp_send_resp = otp.send_otp(otp_send_req)
70
+
71
+ otp_verify_req = {
72
+ "phone" => "+923004242293",
73
+ "token" => "Recieved Token",
74
+ "consume" => true,
75
+ }
76
+
77
+ otp_verify_resp = otp.verify(otp_verify_req)
78
+
79
+ client = EmailVerification::Client.new
80
+
81
+ Feel free to incorporate these methods into your Ruby applications for email verification and OTP functionalities.
82
+
28
83
  ## Contributing
29
84
 
30
85
  See [CONTRIBUTING](CONTRIBUTING.md) for more information.
@@ -38,7 +38,7 @@ module Mslm
38
38
  elsif response_data.code.to_i == 200
39
39
  json_response = JSON.parse(response_data.body)
40
40
  response = [json_response["email"],json_response["username"],json_response["domain"],json_response["malformed"],json_response["suggestion"],json_response["status"],json_response["has_mailbox"],json_response["accept_all"],json_response["disposable"],json_response["free"],json_response["role"],json_response['mx']]
41
- puts "Response : #{response}"
41
+
42
42
  return response
43
43
  else
44
44
  return "HTTP #{response_data.code}: #{response_data.message}"
@@ -26,7 +26,7 @@ module Mslm
26
26
  end
27
27
 
28
28
  t_url = Mslm::Constants.prepare_url(Mslm::EmailVerification::BASE_URL + 'api/sv/v1', qp, opt)
29
- puts "Url #{t_url}"
29
+
30
30
 
31
31
  sv_resp = Mslm::Constants.req_and_resp('GET', t_url, nil, opt)
32
32
  return sv_resp
data/lib/mslm/otp.rb CHANGED
@@ -24,8 +24,7 @@ module Mslm
24
24
  end
25
25
 
26
26
  t_url = Mslm::Constants.prepare_url(Mslm::EmailVerification::BASE_URL + 'api/otp/v1/send', qp, opt)
27
- puts "Url #{t_url}"
28
- puts otp_send_req.to_json
27
+
29
28
 
30
29
  otp_send_resp = Mslm::Constants.req_and_resp('POST', t_url, otp_send_req, opt)
31
30
  return otp_send_resp
@@ -43,7 +42,7 @@ module Mslm
43
42
  end
44
43
 
45
44
  t_url = Mslm::Constants.prepare_url(Mslm::EmailVerification::BASE_URL + 'api/otp/v1/token_verify', qp, opt)
46
- puts "Url #{t_url}"
45
+
47
46
 
48
47
  otp_token_verify_resp = Mslm::Constants.req_and_resp('POST', t_url, otp_token_verify_req, opt)
49
48
  return otp_token_verify_resp
data/lib/mslm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mslm
4
- VERSION = "0.1.4"
4
+ VERSION = "1.1.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mslm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sahal Abdullah
@@ -30,7 +30,6 @@ files:
30
30
  - lib/mslm/email_verification.rb
31
31
  - lib/mslm/otp.rb
32
32
  - lib/mslm/version.rb
33
- - mslm-0.1.1.gem
34
33
  - mslm.gemspec
35
34
  - sig/mslm.rbs
36
35
  homepage: https://github.com/mslmio/sdk-ruby
data/mslm-0.1.1.gem DELETED
Binary file