zerobounceindia-sdk 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9abb4cc2155c3b74b941ea0f926f6b8bc18c888d4e9c1d5965de221da80f34e
4
- data.tar.gz: 0b3aff55d16daa5ddf57dde06e3d465c647015d6e030bf2e12e8fdac264b02a7
3
+ metadata.gz: 75dd87aa7657862fa0eb77010eb648e96d07f3914d3939d97048ab3abb1849d5
4
+ data.tar.gz: 213eef658cf8f65081130288d0d6155b0cf31d7ab81e2da8110d3c05e739ae56
5
5
  SHA512:
6
- metadata.gz: e3834c28542ea8a1bd598916667fd2558defd059df0d91d626301b77579a6d4c6bb97c79e7e7c1177a8c5b64bd78ad40f98f6be7ec3e1831bb19ed8aba0ee4c2
7
- data.tar.gz: 02af42a1e49db52c4c88428b096535f276c714cb30181ed91f5e81440555e4b420c2eb56547c84a4d88fe2f7e29b8422aebb00e9b7d07606a60a186a9a84785b
6
+ metadata.gz: e8e1324056738f08f809110de5768fdc2748ee79e03b59cf8c9812d1cad531e722615880cd418b7475f6b56ba7aaf5928a3781ee7232b5c0992676ff1f073103
7
+ data.tar.gz: 267417eabc8f3c2b20f3fa22157a56d5388f7b40465bf84982a4f766b340cc312fde82938745a495596638217af7663a33834101ef44c362780f5916f5e32e30
data/README.md CHANGED
@@ -42,6 +42,12 @@ Zerobounce.credits
42
42
  => 79 # returns -1 for invalid key
43
43
  ```
44
44
 
45
+ Activity
46
+ ```ruby
47
+ Zerobounce.activity('ss@gmail.com')
48
+ => {"found"=>true, "active_in_days"=>"180"}
49
+ ```
50
+
45
51
  Usage statistics
46
52
  ```ruby
47
53
  Zerobounce.api_usage(Date.today, Date.today)
data/README_es.md ADDED
@@ -0,0 +1,399 @@
1
+
2
+ # Zerobounce India
3
+ Ruby client for Zerobounce.net API. Developed based on [this version](https://github.com/afrase/zerobounce) by Aaron Frase.
4
+
5
+ ## Usage
6
+ Add this line to your application's Gemfile:
7
+ ```ruby
8
+ gem 'zerobounceindia-sdk'
9
+ ```
10
+
11
+ And then execute:
12
+ ```bash
13
+ $bundle
14
+ ```
15
+
16
+ Or install it yourself as:
17
+ ```bash
18
+ $gem install zerobounceindia-sdk
19
+ ```
20
+
21
+ Import
22
+ ```ruby
23
+ require 'zerobounce'
24
+ ```
25
+
26
+ Set a valid ZeroBounce API key.
27
+ ```ruby
28
+ Zerobounce.configure do |config|
29
+ config.apikey = '<zerobounce-api-key>'
30
+ ...
31
+ end
32
+ ```
33
+ or
34
+ ```
35
+ Zerobounce.config.apikey = '<zerobounce-api-key>'
36
+ ...
37
+ ```
38
+
39
+ Credits
40
+ ```ruby
41
+ Zerobounce.credits
42
+ => 79 # returns -1 for invalid key
43
+ ```
44
+
45
+ Activity
46
+ ```ruby
47
+ Zerobounce.activity('ss@gmail.com')
48
+ => {"found"=>true, "active_in_days"=>"180"}
49
+ ```
50
+
51
+ Usage statistics
52
+ ```ruby
53
+ Zerobounce.api_usage(Date.today, Date.today)
54
+ =>
55
+ {"total"=>0,
56
+ "status_valid"=>0,
57
+ "status_invalid"=>0,
58
+ "status_catch_all"=>0,
59
+ "status_do_not_mail"=>0,
60
+ "status_spamtrap"=>0,
61
+ "status_unknown"=>0,
62
+ "sub_status_toxic"=>0,
63
+ "sub_status_disposable"=>0,
64
+ "sub_status_role_based"=>0,
65
+ "sub_status_possible_trap"=>0,
66
+ "sub_status_global_suppression"=>0,
67
+ "sub_status_timeout_exceeded"=>0,
68
+ "sub_status_mail_server_temporary_error"=>0,
69
+ "sub_status_mail_server_did_not_respond"=>0,
70
+ "sub_status_greylisted"=>0,
71
+ "sub_status_antispam_system"=>0,
72
+ "sub_status_does_not_accept_mail"=>0,
73
+ "sub_status_exception_occurred"=>0,
74
+ "sub_status_failed_syntax_check"=>0,
75
+ "sub_status_mailbox_not_found"=>0,
76
+ "sub_status_unroutable_ip_address"=>0,
77
+ "sub_status_possible_typo"=>0,
78
+ "sub_status_no_dns_entries"=>0,
79
+ "sub_status_role_based_catch_all"=>0,
80
+ "sub_status_mailbox_quota_exceeded"=>0,
81
+ "sub_status_forcible_disconnect"=>0,
82
+ "sub_status_failed_smtp_connection"=>0,
83
+ "sub_status_mx_forward"=>0,
84
+ "sub_status_alternate"=>0,
85
+ "sub_status_blocked"=>0,
86
+ "sub_status_allowed"=>0,
87
+ "start_date"=>"4/28/2023",
88
+ "end_date"=>"4/28/2023"}
89
+ ```
90
+
91
+ ### Email Validation
92
+
93
+ Validate single eMail
94
+ ```ruby
95
+ Zerobounce.validate('valid@example.com')
96
+ # Zerobounce.validate('valid@example.com', '192.168.0.1') # optional IP address
97
+ =>
98
+ {"address"=>"valid@example.com",
99
+ "status"=>"valid",
100
+ "sub_status"=>"",
101
+ "free_email"=>false,
102
+ "did_you_mean"=>nil,
103
+ "account"=>nil,
104
+ "domain"=>nil,
105
+ "domain_age_days"=>"9692",
106
+ "smtp_provider"=>"example",
107
+ "mx_found"=>"true",
108
+ "mx_record"=>"mx.example.com",
109
+ "firstname"=>"zero",
110
+ "lastname"=>"bounce",
111
+ "gender"=>"male",
112
+ "country"=>nil,
113
+ "region"=>nil,
114
+ "city"=>nil,
115
+ "zipcode"=>nil,
116
+ "processed_at"=>"2023-04-28 15:18:45.631"}
117
+ ```
118
+
119
+ Validate batch
120
+ ```ruby
121
+ emails
122
+ =>
123
+ ["disposable@example.com",
124
+ "invalid@example.com",
125
+ "valid@example.com",
126
+ "toxic@example.com",
127
+ "donotmail@example.com",
128
+ "spamtrap@example.com"]
129
+
130
+ # ip_addresses
131
+ => ["192.168.0.1", "192.168.0.1", "192.168.0.1", "192.168.0.1", "192.168.0.1", "192.168.0.1"]
132
+ # Zerobounce.validate_batch(emails, ip_addresses) # optional ip_addresses parameter
133
+
134
+ Zerobounce.validate_batch(emails)
135
+ =>
136
+ [{"address"=>"disposable@example.com",
137
+ "status"=>"do_not_mail",
138
+ "sub_status"=>"disposable",
139
+ "free_email"=>false,
140
+ "did_you_mean"=>nil,
141
+ "account"=>nil,
142
+ "domain"=>nil,
143
+ "domain_age_days"=>"9692",
144
+ "smtp_provider"=>"example",
145
+ "mx_found"=>"true",
146
+ "mx_record"=>"mx.example.com",
147
+ "firstname"=>"zero",
148
+ "lastname"=>"bounce",
149
+ "gender"=>"male",
150
+ "country"=>nil,
151
+ "region"=>nil,
152
+ "city"=>nil,
153
+ "zipcode"=>nil,
154
+ "processed_at"=>"2023-04-28 15:21:44.340"},
155
+ {"address"=>"invalid@example.com",
156
+ "status"=>"invalid",
157
+ "sub_status"=>"mailbox_not_found",
158
+ "free_email"=>false,
159
+ "did_you_mean"=>nil,
160
+ "account"=>nil,
161
+ "domain"=>nil,
162
+ "domain_age_days"=>"9692",
163
+ "smtp_provider"=>"example",
164
+ "mx_found"=>"true",
165
+ "mx_record"=>"mx.example.com",
166
+ "firstname"=>"zero",
167
+ "lastname"=>"bounce",
168
+ "gender"=>"male",
169
+ "country"=>nil,
170
+ "region"=>nil,
171
+ "city"=>nil,
172
+ "zipcode"=>nil,
173
+ "processed_at"=>"2023-04-28 15:21:44.340"},
174
+ {"address"=>"valid@example.com",
175
+ "status"=>"valid",
176
+ "sub_status"=>"",
177
+ "free_email"=>false,
178
+ "did_you_mean"=>nil,
179
+ "account"=>nil,
180
+ "domain"=>nil,
181
+ "domain_age_days"=>"9692",
182
+ "smtp_provider"=>"example",
183
+ "mx_found"=>"true",
184
+ "mx_record"=>"mx.example.com",
185
+ "firstname"=>"zero",
186
+ "lastname"=>"bounce",
187
+ "gender"=>"male",
188
+ "country"=>nil,
189
+ "region"=>nil,
190
+ "city"=>nil,
191
+ "zipcode"=>nil,
192
+ "processed_at"=>"2023-04-28 15:21:44.340"},
193
+ {"address"=>"toxic@example.com",
194
+ "status"=>"do_not_mail",
195
+ "sub_status"=>"toxic",
196
+ "free_email"=>false,
197
+ "did_you_mean"=>nil,
198
+ "account"=>nil,
199
+ "domain"=>nil,
200
+ "domain_age_days"=>"9692",
201
+ "smtp_provider"=>"example",
202
+ "mx_found"=>"true",
203
+ "mx_record"=>"mx.example.com",
204
+ "firstname"=>"zero",
205
+ "lastname"=>"bounce",
206
+ "gender"=>"male",
207
+ "country"=>nil,
208
+ "region"=>nil,
209
+ "city"=>nil,
210
+ "zipcode"=>nil,
211
+ "processed_at"=>"2023-04-28 15:21:44.340"},
212
+ {"address"=>"donotmail@example.com",
213
+ "status"=>"do_not_mail",
214
+ "sub_status"=>"role_based",
215
+ "free_email"=>false,
216
+ "did_you_mean"=>nil,
217
+ "account"=>nil,
218
+ "domain"=>nil,
219
+ "domain_age_days"=>"9692",
220
+ "smtp_provider"=>"example",
221
+ "mx_found"=>"true",
222
+ "mx_record"=>"mx.example.com",
223
+ "firstname"=>"zero",
224
+ "lastname"=>"bounce",
225
+ "gender"=>"male",
226
+ "country"=>nil,
227
+ "region"=>nil,
228
+ "city"=>nil,
229
+ "zipcode"=>nil,
230
+ "processed_at"=>"2023-04-28 15:21:44.340"},
231
+ {"address"=>"spamtrap@example.com",
232
+ "status"=>"spamtrap",
233
+ "sub_status"=>"",
234
+ "free_email"=>false,
235
+ "did_you_mean"=>nil,
236
+ "account"=>nil,
237
+ "domain"=>nil,
238
+ "domain_age_days"=>"9692",
239
+ "smtp_provider"=>"example",
240
+ "mx_found"=>"true",
241
+ "mx_record"=>"mx.example.com",
242
+ "firstname"=>"zero",
243
+ "lastname"=>"bounce",
244
+ "gender"=>"male",
245
+ "country"=>nil,
246
+ "region"=>nil,
247
+ "city"=>nil,
248
+ "zipcode"=>nil,
249
+ "processed_at"=>"2023-04-28 15:21:44.340"}]
250
+ ```
251
+
252
+ #### Batch File Validation
253
+
254
+ Send file
255
+ ```ruby
256
+ # sample file can be found in the files folder of this repository
257
+ validate_file_path = File.join(Dir.pwd, 'files', 'validation.csv')
258
+ => "/home/zb/wrappers/ruby-test/files/validation.csv"
259
+ Zerobounce.validate_file_send(validate_file_path)
260
+ =>
261
+ {"success"=>true,
262
+ "message"=>"File Accepted",
263
+ "file_name"=>"validation.csv",
264
+ "file_id"=>"75d854a6-565c-49f9-b4c8-b3344480ec4c"}
265
+ # file_id will be required for next steps
266
+ # optional named parameters:
267
+ email_address_column: 1,
268
+ first_name_column: 2,
269
+ last_name_column: 3,
270
+ gender_column: 4,
271
+ has_header_row: true,
272
+ return_url: nil # results callback url
273
+ # Zerobounce.validate_file_send(validate_file_path, email_address_column: 1, gender_column: 4)
274
+ ```
275
+
276
+ Check file
277
+ ```ruby
278
+ file_id = "75d854a6-565c-49f9-b4c8-b3344480ec4c"
279
+ => "75d854a6-565c-49f9-b4c8-b3344480ec4c"
280
+ Zerobounce.validate_file_check(file_id)
281
+ =>
282
+ {"success"=>true,
283
+ "file_id"=>"75d854a6-565c-49f9-b4c8-b3344480ec4c",
284
+ "file_name"=>"validation.csv",
285
+ "upload_date"=>"2023-04-28T15:25:41Z",
286
+ "file_status"=>"Greylisted",
287
+ "complete_percentage"=>"0%",
288
+ "error_reason"=>nil,
289
+ "return_url"=>nil}
290
+ ```
291
+
292
+ Get file
293
+ ```ruby
294
+ file_id = "75d854a6-565c-49f9-b4c8-b3344480ec4c"
295
+ => "75d854a6-565c-49f9-b4c8-b3344480ec4c"
296
+ Zerobounce.validate_file_get(file_id)
297
+ => "\"email\",\"first\",\"last\",\"gender\",\"ip\",\"ZB Status\",\"ZB Sub Status\",\"ZB Account\",\"ZB Domain\",\"ZB First Name\",\"ZB Last Name\",\"ZB Gender\",\"ZB Free Email\",\"ZB MX Found\",\"ZB MX Record\",\"ZB SMTP Provider\",\"ZB Did You Mean\"\n\"disposable@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"do_not_mail\",\"disposable\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"invalid@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"invalid\",\"mailbox_not_found\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"valid@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"valid\",\"\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"toxic@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"do_not_mail\",\"toxic\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"donotmail@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"do_not_mail\",\"role_based\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"spamtrap@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"spamtrap\",\"\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"abuse@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"abuse\",\"\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"unknown@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"unknown\",\"mail_server_temporary_error\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"catch_all@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"catch-all\",\"\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"antispam_system@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"unknown\",\"antispam_system\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"does_not_accept_mail@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"invalid\",\"does_not_accept_mail\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"exception_occurred@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"unknown\",\"exception_occurred\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"failed_smtp_connection@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"unknown\",\"failed_smtp_connection\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"failed_syntax_check@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"invalid\",\"failed_syntax_check\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"forcible_disconnect@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"unknown\",\"forcible_disconnect\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"global_suppression@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"do_not_mail\",\"global_suppression\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"greylisted@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"unknown\",\"greylisted\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"leading_period_removed@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"valid\",\"leading_period_removed\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"mail_server_did_not_respond@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"unknown\",\"mail_server_did_not_respond\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"mail_server_temporary_error@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"unknown\",\"mail_server_temporary_error\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"mailbox_quota_exceeded@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"invalid\",\"mailbox_quota_exceeded\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"mailbox_not_found@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"invalid\",\"mailbox_not_found\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"no_dns_entries@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"invalid\",\"no_dns_entries\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"possible_trap@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"do_not_mail\",\"possible_trap\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"possible_typo@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"invalid\",\"possible_typo\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"role_based@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"do_not_mail\",\"role_based\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"timeout_exceeded@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"unknown\",\"timeout_exceeded\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"unroutable_ip_address@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"invalid\",\"unroutable_ip_address\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"free_email@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"valid\",\"\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"True\",\"true\",\"mx.example.com\",\"example\",\"\"\n\"role_based_catch_all@example.com\",\"First\",\"Last\",\"male\",\"127.0.0.1\",\"do_not_mail\",\"role_based_catch_all\",\"\",\"\",\"zero\",\"bounce\",\"male\",\"False\",\"true\",\"mx.example.com\",\"example\",\"\"\n"
298
+ ```
299
+
300
+ Delete file
301
+ ```ruby
302
+ file_id = "75d854a6-565c-49f9-b4c8-b3344480ec4c"
303
+ => "75d854a6-565c-49f9-b4c8-b3344480ec4c"
304
+ Zerobounce.validate_file_delete(file_id)
305
+ =>
306
+ {"success"=>true,
307
+ "message"=>"File Deleted",
308
+ "file_name"=>"validation.csv",
309
+ "file_id"=>"75d854a6-565c-49f9-b4c8-b3344480ec4c"}
310
+ ```
311
+
312
+ ### AI Scoring
313
+
314
+ Send file
315
+ ```ruby
316
+ scoring_file_path = File.join(Dir.pwd, 'files', 'scoring.csv')
317
+ => "/home/odin/zb/wrappers/ruby-test/files/scoring.csv"
318
+ Zerobounce.scoring_file_send(scoring_file_path)
319
+ =>
320
+ {"success"=>true,
321
+ "message"=>"File Accepted",
322
+ "file_name"=>"scoring.csv",
323
+ "file_id"=>"89fb7262-b845-4fa1-aa25-e486347ec64e"}
324
+ # file_id will be required for the next steps
325
+ # optional named parameters
326
+ email_address_column: 1,
327
+ has_header_row: true,
328
+ return_url: nil # results callback url
329
+ # Zerobounce.scoring_file_send(scoring_file_path, email_address_column: 1)
330
+ ```
331
+
332
+ File check
333
+ ```ruby
334
+ file_id = "89fb7262-b845-4fa1-aa25-e486347ec64e"
335
+ => "89fb7262-b845-4fa1-aa25-e486347ec64e"
336
+ Zerobounce.scoring_file_check(file_id)
337
+ =>
338
+ {"success"=>true,
339
+ "file_id"=>"89fb7262-b845-4fa1-aa25-e486347ec64e",
340
+ "file_name"=>"scoring.csv",
341
+ "upload_date"=>"2023-04-28T16:57:18Z",
342
+ "file_status"=>"Complete",
343
+ "complete_percentage"=>"100% Complete.",
344
+ "return_url"=>nil}
345
+ ```
346
+
347
+ Get file
348
+ ```ruby
349
+ file_id = "89fb7262-b845-4fa1-aa25-e486347ec64e"
350
+ => "89fb7262-b845-4fa1-aa25-e486347ec64e"
351
+ Zerobounce.scoring_file_get(file_id)
352
+ => "\"email\",\"ZeroBounceQualityScore\"\r\n\"disposable@example.com\",\"0\"\r\n\"invalid@example.com\",\"10\"\r\n\"valid@example.com\",\"10\"\r\n\"toxic@example.com\",\"2\"\r\n\"donotmail@example.com\",\"0\"\r\n\"spamtrap@example.com\",\"0\"\r\n\"abuse@example.com\",\"10\"\r\n\"unknown@example.com\",\"10\"\r\n\"catch_all@example.com\",\"10\"\r\n\"antispam_system@example.com\",\"0\"\r\n\"does_not_accept_mail@example.com\",\"0\"\r\n\"exception_occurred@example.com\",\"0\"\r\n\"failed_smtp_connection@example.com\",\"0\"\r\n\"failed_syntax_check@example.com\",\"0\"\r\n\"forcible_disconnect@example.com\",\"0\"\r\n\"global_suppression@example.com\",\"0\"\r\n\"greylisted@example.com\",\"0\"\r\n\"leading_period_removed@example.com\",\"0\"\r\n\"mail_server_did_not_respond@example.com\",\"0\"\r\n\"mail_server_temporary_error@example.com\",\"0\"\r\n\"mailbox_quota_exceeded@example.com\",\"0\"\r\n\"mailbox_not_found@example.com\",\"0\"\r\n\"no_dns_entries@example.com\",\"0\"\r\n\"possible_trap@example.com\",\"0\"\r\n\"possible_typo@example.com\",\"0\"\r\n\"role_based@example.com\",\"0\"\r\n\"timeout_exceeded@example.com\",\"0\"\r\n\"unroutable_ip_address@example.com\",\"0\"\r\n\"free_email@example.com\",\"0\"\r\n\"role_based_catch_all@example.com\",\"0\""
353
+ ```
354
+
355
+ Delete file
356
+ ```ruby
357
+ file_id = "89fb7262-b845-4fa1-aa25-e486347ec64e"
358
+ => "89fb7262-b845-4fa1-aa25-e486347ec64e"
359
+ Zerobounce.validate_file_delete(file_id)
360
+ => {"success"=>false, "message"=>"File cannot be found."}
361
+ ```
362
+
363
+
364
+ ## Development
365
+
366
+ After checking out the repo run tests
367
+ ```bash
368
+ rspec --init # if needed
369
+ bundle exec rspec
370
+ ```
371
+
372
+ You should see an output like this
373
+ ```bash
374
+ Run options: include {:focus=>true}
375
+ running live tests
376
+ .....................................................
377
+
378
+ Finished in 6.81 seconds (files took 0.40587 seconds to load)
379
+ 53 examples, 0 failures
380
+ ```
381
+
382
+ ### Test parameters
383
+ The tests use the following environment parameters:
384
+ TEST {unit|live} influences whether mocked unit tests are run or the live server is used (credits may be used if you choose to do this)
385
+ ZEROBOUNCE_API_KEY {<zerobounce-api-key-value>} this key is used to make requests to the live server; it is also used in mock tests as a valid key sample (any value will work for mock tests)
386
+ INCORRECT_API_KEY {any non whitespace string value that is not a valid key} used for tests where the requests are meant to fail due to the API key value.
387
+
388
+
389
+ To set them
390
+ ```bash
391
+ export ZEROBOUNCE_API_KEY=99e7ef20ceea4480a173b07b1be75371
392
+ export INCORRECT_API_KEY=thiskeyisinvalidorotherwiseincorrect
393
+ export TEST=unit
394
+ ```
395
+
396
+ A .env.sample file is provided.
397
+
398
+ Mock tests were generated using webmock and vcr. This means that actual requests were made and recorded in the spec/cassettes with an (at the time) valid API key used for testing purposes. This key has been invalidated in the meantime, however it is provided in the .env.sample file for the mock tests to work. If you do not wish to use this key for mocks, you can replace it with any value in the .yml files under spec/cassettes or delete all of them and rerun the tests so that vcr records them with a new key.
399
+
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Zerobounce
4
4
  # The version of the gem.
5
- VERSION = '1.0.0'
5
+ VERSION = '1.0.1'
6
6
  end
data/lib/zerobounce.rb CHANGED
@@ -153,6 +153,20 @@ module Zerobounce
153
153
  @@request.get('getapiusage', params)
154
154
  end
155
155
 
156
+ # Get Activty for email
157
+ #
158
+ # @param [String] :email Email to get activity for
159
+ #
160
+ # @return [Hash]
161
+ # {
162
+ # "found": true,
163
+ # "active_in_days": "180"
164
+ # }
165
+ def activity(email)
166
+ params = {email: email}
167
+ @@request.get('activity', params)
168
+ end
169
+
156
170
  # Validate email batch
157
171
  #
158
172
  # @param [Array] :emails List of email addresses to validate.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zerobounceindia-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zero Bounce India
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-05-05 00:00:00.000000000 Z
11
+ date: 2023-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -231,6 +231,7 @@ files:
231
231
  - LICENSE
232
232
  - LICENSE.txt
233
233
  - README.md
234
+ - README_es.md
234
235
  - Rakefile
235
236
  - bin/bundle
236
237
  - bin/console