@@ -86,6 +86,9 @@ ZeroBounceSDK.getInstance().initialize("<YOUR_API_KEY>");
8686` ` ` java
8787ZeroBounceSDK.getInstance ().initialize(" <YOUR_API_KEY>" , timeoutInMillis);
8888` ` `
89+ ` ` ` java
90+ ZeroBounceSDK.getInstance ().initialize(" <YOUR_API_KEY>" , " <YOUR_API_BASE_URL>" );
91+ ` ` `
8992
9093
9194# ## Controlling SDK logging
@@ -180,6 +183,88 @@ Then you can use any of the SDK methods, for example:
180183 );
181184 ```
182185
186+ * ##### Find the email formats based on a given first name and domain
187+ ```java
188+ ZeroBounceSDK.getInstance().findEmail(
189+ "<FIRST_NAME_TO_TEST>"
190+ "<DOMAIN_TO_TEST>",
191+ null,
192+ null,
193+ null,
194+ new ZeroBounceSDK.OnSuccessCallback<ZBFindEmailResponse>() {
195+ @Override
196+ public void onSuccess(ZBFindEmailResponse response) {
197+ System.out.println("findEmail response=" + response.toString());
198+ }
199+ }, new ZeroBounceSDK.OnErrorCallback() {
200+ @Override
201+ public void onError(String errorMessage) {
202+ System.out.println("findEmail error=" + errorMessage);
203+ }
204+ });
205+ );
206+ ```
207+
208+ * ##### Find the email formats based on a given first name and company name
209+ ```java
210+ ZeroBounceSDK.getInstance().findEmail(
211+ "<FIRST_NAME_TO_TEST>"
212+ null,
213+ "<COMPANY_NAME_TO_TEST>",
214+ null,
215+ null,
216+ new ZeroBounceSDK.OnSuccessCallback<ZBFindEmailResponse>() {
217+ @Override
218+ public void onSuccess(ZBFindEmailResponse response) {
219+ System.out.println("findEmail response=" + response.toString());
220+ }
221+ }, new ZeroBounceSDK.OnErrorCallback() {
222+ @Override
223+ public void onError(String errorMessage) {
224+ System.out.println("findEmail error=" + errorMessage);
225+ }
226+ });
227+ );
228+ ```
229+
230+ * ##### Find other domain formats based on a given domain
231+ ```java
232+ ZeroBounceSDK.getInstance().findDomain(
233+ "<DOMAIN_TO_TEST>",
234+ null,
235+ new ZeroBounceSDK.OnSuccessCallback<ZBFindDomainResponse>() {
236+ @Override
237+ public void onSuccess(ZBFindDomainResponse response) {
238+ System.out.println("findDomain response=" + response.toString());
239+ }
240+ }, new ZeroBounceSDK.OnErrorCallback() {
241+ @Override
242+ public void onError(String errorMessage) {
243+ System.out.println("findDomain error=" + errorMessage);
244+ }
245+ });
246+ );
247+ ```
248+
249+ * ##### Find other domain formats based on a given company name
250+ ```java
251+ ZeroBounceSDK.getInstance().findDomain(
252+ null,
253+ "COMPANY_NAME_TO_TEST",
254+ new ZeroBounceSDK.OnSuccessCallback<ZBFindDomainResponse>() {
255+ @Override
256+ public void onSuccess(ZBFindDomainResponse response) {
257+ System.out.println("findDomain response=" + response.toString());
258+ }
259+ }, new ZeroBounceSDK.OnErrorCallback() {
260+ @Override
261+ public void onError(String errorMessage) {
262+ System.out.println("findDomain error=" + errorMessage);
263+ }
264+ });
265+ );
266+ ```
267+
183268* ##### Check how many credits you have left on your account
184269 ```java
185270 ZeroBounceSDK.getInstance().getCredits(
@@ -399,6 +484,149 @@ Then you can use any of the SDK methods, for example:
399484 });
400485 ```
401486
487+ ## Breaking Changes:
488+ **`guessFormat`** has been deprecated. To continue using your existing code, you must migrate to **`findEmail`** or **`findDomain`** .
489+ The change is not a simple one-to-one replacement, as the functionality has been split:
490+ - **If you were finding a person' s email format** , use the new **`findEmail ()` ** method.
491+ - ** If you were only determining the domain' s general email pattern**, use the new **`findDomain()`** method.
492+ ### Migration Example:
493+ - #### Old (Deprecated)
494+ ```java
495+ ZeroBounceSDK.getInstance().guessFormat(
496+ "<DOMAIN_TO_TEST>",
497+ null,
498+ null,
499+ null,
500+ new ZeroBounceSDK.OnSuccessCallback<ZBEmailFinderResponse>() {
501+ @Override
502+ public void onSuccess(ZBEmailFinderResponse response) {
503+ System.out.println("guessFormat response=" + response.toString());
504+ }
505+ }, new ZeroBounceSDK.OnErrorCallback() {
506+ @Override
507+ public void onError(String errorMessage) {
508+ System.out.println("guessFormat error=" + errorMessage);
509+ }
510+ });
511+ );
512+
513+ - #### New Methods
514+ - ##### Find the email formats based on a given first name and domain
515+ ```java
516+ ZeroBounceSDK.getInstance().findEmail(
517+ "<FIRST_NAME_TO_TEST>"
518+ "<DOMAIN_TO_TEST>",
519+ null,
520+ null,
521+ null,
522+ new ZeroBounceSDK.OnSuccessCallback<ZBFindEmailResponse>() {
523+ @Override
524+ public void onSuccess(ZBFindEmailResponse response) {
525+ System.out.println("findEmail response=" + response.toString());
526+ }
527+ }, new ZeroBounceSDK.OnErrorCallback() {
528+ @Override
529+ public void onError(String errorMessage) {
530+ System.out.println("findEmail error=" + errorMessage);
531+ }
532+ });
533+ );
534+ ```
535+ - ##### Find the email formats based on a given first name and company name
536+ ```java
537+ ZeroBounceSDK.getInstance().findEmail(
538+ "<FIRST_NAME_TO_TEST>"
539+ null,
540+ "<COMPANY_NAME_TO_TEST>",
541+ null,
542+ null,
543+ new ZeroBounceSDK.OnSuccessCallback<ZBFindEmailResponse>() {
544+ @Override
545+ public void onSuccess(ZBFindEmailResponse response) {
546+ System.out.println("findEmail response=" + response.toString());
547+ }
548+ }, new ZeroBounceSDK.OnErrorCallback() {
549+ @Override
550+ public void onError(String errorMessage) {
551+ System.out.println("findEmail error=" + errorMessage);
552+ }
553+ });
554+ );
555+
556+ - ##### Find other domain formats based on a given domain
557+ ```java
558+ ZeroBounceSDK.getInstance().findDomain(
559+ "<DOMAIN_TO_TEST>",
560+ null,
561+ new ZeroBounceSDK.OnSuccessCallback<ZBFindDomainResponse>() {
562+ @Override
563+ public void onSuccess(ZBFindDomainResponse response) {
564+ System.out.println("findDomain response=" + response.toString());
565+ }
566+ }, new ZeroBounceSDK.OnErrorCallback() {
567+ @Override
568+ public void onError(String errorMessage) {
569+ System.out.println("findDomain error=" + errorMessage);
570+ }
571+ });
572+ );
573+ ```
574+ - ##### Find other domain formats based on a given company name
575+ ```java
576+ ZeroBounceSDK.getInstance().findDomain(
577+ null,
578+ "COMPANY_NAME_TO_TEST",
579+ new ZeroBounceSDK.OnSuccessCallback<ZBFindDomainResponse>() {
580+ @Override
581+ public void onSuccess(ZBFindDomainResponse response) {
582+ System.out.println("findDomain response=" + response.toString());
583+ }
584+ }, new ZeroBounceSDK.OnErrorCallback() {
585+ @Override
586+ public void onError(String errorMessage) {
587+ System.out.println("findDomain error=" + errorMessage);
588+ }
589+ });
590+ );
591+
592+ ## New Features and Enhancements
593+ ### Custom API URL Support
594+ The `ZeroBounceSDK.initialize()` method can now accepts an `apiBaseUrl` parameter.
595+ This allows you to specify a custom base URL for the ZeroBounce API.
596+
597+ #### Migration / Usage
598+ The existing way of initializing the SDK is still valid.
599+
600+ - Default Usage (No Change Required). If you don' t provide a URL, the SDK will continue to use the standard ZeroBounce API endpoint:
601+ ` ` ` java
602+ ZeroBounceSDK.getInstance ().initialize(" <YOUR_API_KEY>" );
603+ ` ` `
604+ ` ` ` java
605+ ZeroBounceSDK.getInstance ().initialize(" <YOUR_API_KEY>" , timeoutInMillis);
606+ ` ` `
607+ - Initialize the SDK with your API key and URL:
608+ ` ` ` java
609+ ZeroBounceSDK.getInstance ().initialize(" <YOUR_API_KEY>" , " <YOUR_API_BASE_URL>" );
610+ ` ` `
611+ The SDK now exposes a set of predefined constants for different geographical API endpoints,
612+ allowing for more precise network routing.
613+
614+ # ## Available API Endpoints
615+ You can specify a custom API base URL during initialization by using the new optional ` apiBaseUrl`
616+ parameter in ` initialize()` . For convenience, the following constants are available in the
617+ ** ` ZBConstants` ** class:
618+
619+ | Constant | URL Value | Description |
620+ | -------------------| ------------------------------------| --------------------------------------------------------------------|
621+ | ** ` API_DEFAULT_URL` ** | ` https://api.zerobounce.net/v2/` | The global default endpoint. |
622+ | ** ` API_USA_URL` ** | ` https://api-us.zerobounce.net/v2/` | The US-specific endpoint for lower latency in the Americas. |
623+ | ** ` API_EU_URL` ** | ` https://api-eu.zerobounce.net/v2/` | The EU-specific endpoint for compliance and lower latency in Europe. |
624+
625+ # ## Usage Example:
626+ To use the EU endpoint for initialization:
627+ ` ` ` java
628+ ZeroBounceSDK.getInstance ().initialize(" <YOUR_API_KEY>" , ZBConstants.getInstance ().API_EU_URL);
629+ ` ` `
402630
403631# # Documentation
404632You can generate the documentation using your desired IDE or using' s maven' s javadoc command.
0 commit comments