neverbounce / neverbounceapi-java Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
The example suggests that I use version 4.0.6 on Maven.
However, I can't find this version on repositories like these:
https://search.maven.org/search?q=g:com.neverbounce
https://mvnrepository.com/artifact/com.neverbounce/neverbounce-api-java
The last version published there is 4.0.5.
Can I follow the examples if I use this version? They will work?
Thanks.
Hi,
We have integrated your email validation service and it works correctly, but sometimes exceptions are generated.
I think it may be due to a different response model than expected.
Exceptions:
java.lang.IllegalArgumentException: expected primitive class, but got: class com.neverbounce.api.client.exception.NeverbounceApiException
at com.google.api.client.util.Data.parsePrimitiveValue(Data.java:456) ~[google-http-client-1.29.0.jar:?]
at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:871) ~[google-http-client-1.29.0.jar:?]
java.lang.IllegalArgumentException:
at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:902) ~[google-http-client-1.29.0.jar:?]
at com.google.api.client.json.JsonParser.parse(JsonParser.java:362) ~[google-http-client-1.29.0.jar:?]
at com.google.api.client.json.JsonParser.parse(JsonParser.java:320) ~[google-http-client-1.29.0.jar:?]
at com.google.api.client.json.JsonParser.parse(JsonParser.java:298) ~[google-http-client-1.29.0.jar:?]
at com.neverbounce.api.internal.HttpClientImpl.translateHttpResponseException(HttpClientImpl.java:178) ~[neverbounce-api-java-4.0.14.jar:?]
at com.neverbounce.api.internal.HttpClientImpl.execute(HttpClientImpl.java:133) ~[neverbounce-api-java-4.0.14.jar:?]
at com.neverbounce.api.internal.HttpClientImpl.getForObject(HttpClientImpl.java:95) ~[neverbounce-api-java-4.0.14.jar:?]
at com.neverbounce.api.model.SingleCheckRequest.execute(SingleCheckRequest.java:48) ~[neverbounce-api-java-4.0.14.jar:?]
Please, would it be possible to add an exception that retrieves the response body?
Testing with CURL, sometimes we got responses with the Result inconclusive
, not expected.
Thank you in advance
Response received through API contains the following json for 'flags' for some email ids
flags: ["free_email_host", "profanity", "has_dns", "has_dns_mx", "smtp_connectable"]
Hey Guys,
I've been integrating into your service using the rather simple SingleCheck operation, which has been great if not slow. But due to the volume of emails we scan i've further integrated into the JobRequest operation to perform validations in bulk and faster.
We consume the latest version of your Java API, specifically version 4.0.5. When polling for JobStatuses we get parsing errors for response attribute "percent_complete", with the following stack trace.
Caused by: java.lang.IllegalArgumentException: key percent_complete at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:889) at com.google.api.client.json.JsonParser.parse(JsonParser.java:382) at com.google.api.client.json.JsonParser.parse(JsonParser.java:355) at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:87) at com.google.api.client.json.JsonObjectParser.parseAndClose(JsonObjectParser.java:81) at com.google.api.client.http.HttpResponse.parseAs(HttpResponse.java:459) at com.neverbounce.api.internal.HttpClientImpl.execute(HttpClientImpl.java:109) at com.neverbounce.api.internal.HttpClientImpl.getForObject(HttpClientImpl.java:84) at com.neverbounce.api.model.JobsStatusRequest.execute(JobsStatusRequest.java:23) at com.skymode.integrations.NeverbounceEmailSanitizer.sanitizeEmails(NeverbounceEmailSanitizer.java:137) at com.skymode.asynctasks.handlers.CustomerUploadAsyncTaskHandler.performEmailsSanitization(CustomerUploadAsyncTaskHandler.java:184) at com.skymode.asynctasks.handlers.CustomerUploadAsyncTaskHandler.handleTask(CustomerUploadAsyncTaskHandler.java:151) at com.skymode.asynctasks.handlers.CustomerUploadAsyncTaskHandler.handleTask(CustomerUploadAsyncTaskHandler.java:53) at com.skymode.asynctasks.handlers.AsyncTaskProcessor.call(AsyncTaskProcessor.java:58) at com.skymode.asynctasks.handlers.AsyncTaskProcessor.call(AsyncTaskProcessor.java:17) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) at java.util.concurrent.FutureTask.run(FutureTask.java) at org.glassfish.enterprise.concurrent.internal.ManagedFutureTask.run(ManagedFutureTask.java:141) ... 4 more Caused by: java.lang.IllegalArgumentException: key percent_complete, field private int com.neverbounce.api.model.JobsStatusResponse.percentComplete at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:889) at com.google.api.client.json.JsonParser.parse(JsonParser.java:472) at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:781) ... 27 more Caused by: java.lang.NumberFormatException: For input string: "88.24" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang.Integer.valueOf(Integer.java:766) at com.google.api.client.json.gson.GsonParser.getIntValue(GsonParser.java:90) at com.google.api.client.json.JsonParser.parseValue(JsonParser.java:836) ... 29 more
It appears that the wrong datatype has been chosen in JobStatus to represent the percentage complete, which comes back as a float.
One thing which need refinement for sure is that /jobs/status
the actual status of the job as job_status
, whereas /jobs/search
returns seemingly the same structure, but job status is called status
.
The class I'm using to deserialize job's status has got a member called jobStatus
which is mapped to job_status
JSON field. When this piece of data gets returned as status
, the runtime tried to deserialize it as the request's status and it fails.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.