mslm 0.1.4 → 1.1.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/README.md +59 -4
- data/lib/mslm/constants/constants.rb +1 -1
- data/lib/mslm/email_verification.rb +1 -1
- data/lib/mslm/otp.rb +2 -2
- data/lib/mslm/version.rb +1 -1
- metadata +1 -2
- data/mslm-0.1.1.gem +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 75f70ca919f9e05e035ef25e60333b12ef7eaa0a21a9bae0ef3b4fe278be2420
|
|
4
|
+
data.tar.gz: 7a739d1fb655f2e8dbd4fef8b49ec972901c0981a84b578fb3af4f5099cee06c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ca0b18c70f54fdd8ed824f0c386e6cac8838420c13f8675ca11be1deeac86f454b4599d1663c6605d27f57648f68df4914a70b2706e97223cb574cdc563b97f6
|
|
7
|
+
data.tar.gz: 9a201dc68da8853a3768c44a6163b97f287093cacead1df50b19d34428606c8ec51e4791cf8d11f15da803ec9d0b682f395d76b2abf00564a6d1a2c9687c2427
|
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
|
-
|
|
41
|
+
|
|
42
42
|
return response
|
|
43
43
|
else
|
|
44
44
|
return "HTTP #{response_data.code}: #{response_data.message}"
|
data/lib/mslm/otp.rb
CHANGED
|
@@ -24,7 +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}"
|
|
27
|
+
# puts "Url #{t_url}"
|
|
28
28
|
puts otp_send_req.to_json
|
|
29
29
|
|
|
30
30
|
otp_send_resp = Mslm::Constants.req_and_resp('POST', t_url, otp_send_req, opt)
|
|
@@ -43,7 +43,7 @@ module Mslm
|
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
t_url = Mslm::Constants.prepare_url(Mslm::EmailVerification::BASE_URL + 'api/otp/v1/token_verify', qp, opt)
|
|
46
|
-
puts "Url #{t_url}"
|
|
46
|
+
# puts "Url #{t_url}"
|
|
47
47
|
|
|
48
48
|
otp_token_verify_resp = Mslm::Constants.req_and_resp('POST', t_url, otp_token_verify_req, opt)
|
|
49
49
|
return otp_token_verify_resp
|
data/lib/mslm/version.rb
CHANGED
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:
|
|
4
|
+
version: 1.1.0
|
|
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
|