API Quickstart
Postman Collection
To test version 2 of the API in Postman, save the Postman Collection contents as a .json file or you can get the file from our GitHubrepository.
In Postman, on the top menu click on File, then choose Import. Then choose the JSON file you saved or downloaded from GitHub to import it.
Postman Collection JSON file:{"info":{"_postman_id":"948780e4-bf36-4c9c-bb29-2c32c9053091","name":"ZeroBounce API v2","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json"},"item":[{"name":"Validate Emails","request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.zerobounce.net/v2/validate?api_key=replacewithyours&email=replacewithyours&ip_address=","protocol":"https","host":["api","zerobounce","net"],"path":["v2","validate"],"query":[{"key":"api_key","value":"replacewithyours","description":"Your API Key, found in your account."},{"key":"email","value":"replacewithyours","description":"The email address you want to validate"},{"key":"ip_address","value":"","description":"The IP Address the email signed up from (Can be blank, but parameter required)"}]},"description":"API for single email address validation."},"response":[]},{"name":"Get Credit Balance","request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"https://api.zerobounce.net/v2/getcredits?api_key=replacewithyours","protocol":"https","host":["api","zerobounce","net"],"path":["v2","getcredits"],"query":[{"key":"api_key","value":"replacewithyours","description":"Your API Key, found in your account."}]},"description":"This API will tell you how many credits you have left on your account."},"response":[]},{"name":"Send File","request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"file","description":"csv or txt file","type":"file","src":""},{"key":"api_key","value":"replacewithyours","description":"Your API Key, found in your account. (Required)","type":"text"},{"key":"return_url","value":"","description":"The URL will be used to call back when the validation is completed. (Optional)","type":"text","disabled":true},{"key":"email_address_column","value":"replacewithyours","description":"The column index of the email address in your file. Index starts from 1. (Required, number)","type":"text"},{"key":"first_name_column","value":"","description":"The column index of the first name column. (Optional, number)","type":"text","disabled":true},{"key":"last_name_column","value":"","description":"The column index of the last name column. (Optional, number)","type":"text","disabled":true},{"key":"gender_column","value":"","description":"The column index of the gender column. (Optional, number)","type":"text","disabled":true},{"key":"ip_address_column","value":"","description":"The IP Address the email signed up from. (Optional, number)","type":"text","disabled":true},{"key":"has_header_row","value":"","description":"If the first row from the submitted file is a header row. (Optional, true/false)","type":"text","disabled":true}]},"url":"https://bulkapi.zerobounce.net/v2/sendfile","description":"This API allows user to send a file for bulk email validation."},"response":[]},{"name":"File Status","request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"https://bulkapi.zerobounce.net/v2/filestatus?api_key=replacewithyours&file_id=replacewithyours","protocol":"https","host":["bulkapi","zerobounce","net"],"path":["v2","filestatus"],"query":[{"key":"api_key","value":"replacewithyours","description":"Your API Key, found in your account."},{"key":"file_id","value":"replacewithyours","description":"The returned file ID when calling sendfile API."}]},"description":"The API returns the file processing status for the file been submitted using sendfile API."},"response":[]},{"name":"Get File","request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"https://bulkapi.zerobounce.net/v2/getfile?api_key=replacewithyours&file_id=replacewithyours","protocol":"https","host":["bulkapi","zerobounce","net"],"path":["v2","getfile"],"query":[{"key":"api_key","value":"replacewithyours","description":"Your API Key, found in your account."},{"key":"file_id","value":"replacewithyours","description":"The returned file ID when calling sendfile API."}]},"description":"The API allows users to get the validation results file for the file been submitted using sendfile API."},"response":[]},{"name":"Delete File","request":{"method":"GET","header":[],"body":{"mode":"raw","raw":""},"url":{"raw":"https://bulkapi.zerobounce.net/v2/deletefile?api_key=replacewithyours&file_id=replacewithyours","protocol":"https","host":["bulkapi","zerobounce","net"],"path":["v2","deletefile"],"query":[{"key":"api_key","value":"replacewithyours","description":"Your API Key, found in your account."},{"key":"file_id","value":"replacewithyours","description":"The returned file ID when calling sendfile API."}]},"description":"The API returns the file processing status for the file been submitted using sendfile API."},"response":[]}]}
This API will tell you how many credits you have left on your account. It's simple, fast and easy to use.
Here are a few scenarios that businesses will use this API for.
- You use our API to validate emails and you need to check within a certain time-frame when your credit balance is too low, so you can make a payment.
- You want to track how many email validation credits you're using per your defined time-frame to generate useful statistical information.
- You want to automate and integrate information into your application dashboard that shows you your currently remaining credit balance.
Below, you will find the instructions on how to use our API. It's very easy to use and it requires SSL.
GET /v2/getcredits
API URL: https://api.zerobounce.net/v2/getcredits
Below you will find the instructions on how to use our API, it's very easy to use and requires SSL. The API requires that you have an active credit balance and will never consume a credit for any unknown result.
URL Parameters
- ParameterDescription
- api_keyYour API Key, found in your account.
Get Credit Balance Code Samples
' Complete API Libraries and Wrappers can be found here: ' https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_netTryDimapiKey ="Your Secret Key"DimapiURL ="https://api.zerobounce.net/v2/getcredits?api_key="&apiKey Dimrequest AsHttpWebRequest =DirectCast(WebRequest.Create(apiURL),HttpWebRequest)request.Timeout=150000request.Method ="GET"Usingresponse AsWebResponse =request.GetResponse()response.GetResponseStream().ReadTimeout =20000Usingostream AsNewStreamReader(response.GetResponseStream())responseString =ostream.ReadToEnd()EndUsingEndUsingCatchex asexception 'Catch Exception - All errors will be shown here - if there are issues with the APIEndTry
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_net// https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__c-sharptry{stringapiKey ="Your Secret Key";stringapiURL ="https://api.zerobounce.net/v2/getcredits?api_key="+apiKey;HttpWebRequestrequest =(HttpWebRequest)WebRequest.Create(apiURL);request.Timeout =150000;request.Method ="GET";using(WebResponseresponse =request.GetResponse()){response.GetResponseStream().ReadTimeout =20000;using(StreamReaderostream =newStreamReader(response.GetResponseStream())){responseString =ostream.ReadToEnd();}}}catch(exception ex){//Catch Exception - All errors will be shown here - if there are issues with the API}
<?php// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__php// set the api key and email to be validated$apiKey='Your Secret Key';// use curl to make the request$url='https://api.zerobounce.net/v2/getcredits?api_key='.$apiKey;$ch=curl_init($url);curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,15);curl_setopt($ch,CURLOPT_TIMEOUT,150);$response=curl_exec($ch);curl_close($ch);//decode the json response$json=json_decode($response,true);?>
//Complete API Libraries and Wrappers can be found here: //https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__javaimportjava.io.BufferedReader;importjava.io.InputStreamReader;importjava.net.HttpURLConnection;importjava.net.URL;publicclassMyClass{publicstaticvoidmain(String[]args){Stringkey ="Your Secret Key";StringtargetURL ="https://api.zerobounce.net/v2/getcredits?api_key="+key;HttpURLConnectionconnection =null;finalStringUSER_AGENT ="Mozilla/5.0";try{URLurl =newURL(targetURL);connection =(HttpURLConnection)url.openConnection();connection.setRequestMethod("GET");connection.addRequestProperty("User-Agent",USER_AGENT);connection.setUseCaches(false);connection.setDoOutput(true);BufferedReaderin =newBufferedReader(newInputStreamReader(connection.getInputStream()));StringinputLine;StringBufferresponse =newStringBuffer();while((inputLine =in.readLine())!=null){response.append(inputLine);}in.close();//print resultSystem.out.println(response.toString());}catch(Exceptione){e.printStackTrace();}finally{if(connection !=null){connection.disconnect();}}}}
# Complete API Libraries and Wrappers can be found here: # https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__pythonimportrequests
importjson target_url ="https://api.zerobounce.net/v2/getcredits?api_key="secret_key ="Your Secret Key"api_response =requests.get("%s%s"%(target_url,secret_key))data =json.loads(api_response.content)# prints the number of creditsprintdata["Credits"]
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__IOSletkey ="Your Secret Key"leturl =URL(string:String(format:"https://api.zerobounce.net/v2/getcredits?api_key=%@",key))lettask =URLSession.shared.dataTask(with:url!){(data,response,error)iniferror !=nil{NSLog("Error (String(describing: error))")}else{do{letparsedData =tryJSONSerialization.jsonObject(with:data!)as![String:Any]for(key,value)inparsedData {NSLog("(key)=(value) ")}}catch{print("Error deserializing JSON: (error)")}}}task.resume()
NSString *key =@"Your Secret Key";NSString *urlString =[NSString stringWithFormat:@"https://api.zerobounce.net/v2/getcredits?api_key=%@",key];__block NSURL *url =[NSURL URLWithString:urlString];dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0),^{NSData *response =[NSData dataWithContentsOfURL:url];NSDictionary *arrResponse =nil;if(response!=nil){arrResponse =[NSJSONSerialization JSONObjectWithData:response options:kNilOptions error:nil];}dispatch_async(dispatch_get_main_queue(),^(void){for(NSString *key in[arrResponse allKeys]){NSLog(@"%@: %@",key,[arrResponse objectForKey:key]);}// callback(nil, arr);});});
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__android//Add to build.gradle (App) in the "android" bracket:useLibrary 'org.apache.http.legacy'Example:android {compileSdkVersion 25useLibrary 'org.apache.http.legacy'}//------------------------------------------//Filename: JsonParser.javaimportandroid.os.AsyncTask;importorg.json.JSONObject;importjava.util.Iterator;publicclassMainActivityextendsAppCompatActivity{@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);newAsyncTaskParseJson().execute();}}publicclassAsyncTaskParseJsonextendsAsyncTask<String,String,String>{Stringkey ="Your Secret Key";Stringurl ="https://api.zerobounce.net/v2/getcredits?api_key="+key;@OverrideprotectedvoidonPreExecute(){}@OverrideprotectedStringdoInBackground(String...arg0){JsonParserjParser =newJsonParser();JSONObjectjson =jParser.getJSONFromUrl(url);Iteratorkeys =json.keys();while(keys.hasNext()){Stringkey =(String)keys.next();try{System.out.println("ZeroBounce: "+key+"="+json.get(key).toString());}catch(Exceptione){}}returnnull;}@OverrideprotectedvoidonPostExecute(StringstrFromDoInBg){}}//---------------------------------------------------//Filename: MainActivity.javapackagecom.zerobounce.zbapiandroid;importjava.io.BufferedReader;importjava.io.IOException;importjava.io.InputStream;importjava.io.InputStreamReader;importjava.io.UnsupportedEncodingException;importorg.apache.http.HttpEntity;importorg.apache.http.HttpResponse;importorg.apache.http.client.ClientProtocolException;importorg.apache.http.client.methods.HttpGet;importorg.apache.http.impl.client.DefaultHttpClient;importorg.json.JSONException;importorg.json.JSONObject;importandroid.util.Log;publicclassJsonParser{finalStringTAG ="JsonParser.java";staticInputStreamis =null;staticJSONObjectjObj =null;staticStringjson ="";publicJSONObjectgetJSONFromUrl(Stringurl){try{DefaultHttpClienthttpClient =newDefaultHttpClient();HttpGethttpGet =newHttpGet(url);HttpResponsehttpResponse =httpClient.execute(httpGet);HttpEntityhttpEntity =httpResponse.getEntity();is =httpEntity.getContent();}catch(UnsupportedEncodingExceptione){e.printStackTrace();}catch(ClientProtocolExceptione){e.printStackTrace();}catch(IOExceptione){e.printStackTrace();}try{BufferedReaderreader =newBufferedReader(newInputStreamReader(is,"iso-8859-1"),8);StringBuildersb =newStringBuilder();Stringline =null;while((line =reader.readLine())!=null){sb.append(line +"
");}is.close();json =sb.toString();}catch(Exceptione){Log.e(TAG,"Error converting result "+e.toString());}try{jObj =newJSONObject(json);}catch(JSONExceptione){Log.e(TAG,"Error parsing data "+e.toString());}returnjObj;}}
This API will tell you how many credits you have left on your account. It's simple, fast and easy to use.
If you want to call the API from your browser to test it, all you have to do is to replace the API KEY with your key:
https://api.zerobounce.net/v2/getcredits?api_key=[replacewithyours]
This API will tell you how many credits you have left on your account.
The API will return these results in a JSON format using the "getcredits" method. credits - The amount of credits you have left in your account for email validations. If a -1 is returned, that means your API Key is invalid.
Endpoint Response
This API will tell you how many credits you have left on your account. It's simple, fast and easy to use.
Successful Response
{"Credits":2375323}
Error Response
{"Credits":-1}
GET /v2/getapiusage
API URL: https://api.zerobounce.net/v2/getapiusage
URL Parameters
- ParameterDescription
- api_keyYour API Key, found in your account.
- start_dateThe start date of when you want to view API usage. (format: yyyy/mm/dd)
- end_dateThe end date of when you want to view API usage. (format: yyyy/mm/dd)
- https://api.zerobounce.net/v2/getapiusage?api_key=your-api-key&start_date=2018-01-01&end_date=2019-12-12
The API will return these results in a JSON format using the "getapiusage" method.
The API will return these results in a JSON format using the "getapiusage" method.
- ParameterDescription
- totalTotal number of times the API has been called
- status_validTotal valid email addresses returned by the API
- status_invalidTotal invalid email addresses returned by the API
- status_catch_allTotal catch-all email addresses returned by the API
- status_do_not_mailTotal do not mail email addresses returned by the API
- status_spamtrapTotal spamtrap email addresses returned by the API
- status_unknownTotal unknown email addresses returned by the API
- sub_status_toxicTotal number of times the API has a sub status of "toxic"
- sub_status_disposableTotal number of times the API has a sub status of "disposable"
- sub_status_role_basedTotal number of times the API has a sub status of "role_based"
- sub_status_possible_trapTotal number of times the API has a sub status of "possible_trap"
- sub_status_global_suppressionTotal number of times the API has a sub status of "global_suppression"
- sub_status_timeout_exceededTotal number of times the API has a sub status of "timeout_exceeded"
- sub_status_mail_server_temporary_errorTotal number of times the API has a sub status of "mail_server_temporary_error"
- sub_status_mail_server_did_not_respondTotal number of times the API has a sub status of "mail_server_did_not_respond"
- sub_status_greylistedTotal number of times the API has a sub status of "greylisted"
- sub_status_antispam_systemTotal number of times the API has a sub status of "antispam_system"
- sub_status_does_not_accept_mailTotal number of times the API has a sub status of "does_not_accept_mail"
- sub_status_exception_occurredTotal number of times the API has a sub status of "exception_occurred"
- sub_status_failed_syntax_checkTotal number of times the API has a sub status of "failed_syntax_check"
- sub_status_mailbox_not_foundTotal number of times the API has a sub status of "mailbox_not_found"
- sub_status_unroutable_ip_addressTotal number of times the API has a sub status of "unroutable_ip_address"
- sub_status_possible_typoTotal number of times the API has a sub status of "possible_typo"
- sub_status_no_dns_entriesTotal number of times the API has a sub status of "no_dns_entries"
- sub_status_role_based_catch_allTotal role based catch alls the API has a sub status of "role_based_catch_all"
- sub_status_mailbox_quota_exceededTotal number of times the API has a sub status of "mailbox_quota_exceeded"
- sub_status_forcible_disconnectTotal forcible disconnects the API has a sub status of "forcible_disconnect"
- sub_status_failed_smtp_connectionTotal failed SMTP connections the API has a sub status of "failed_smtp_connection"
- start_dateStart date of query. (format: yyyy/mm/dd)
- end_dateEnd date of query. (format: yyyy/mm/dd)
Get API Usage Code Samples
' Complete API Libraries and Wrappers can be found here: ' https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_netTryDimapi_key asstring="Your Secret Key"Dimstart_date asstring="2018-01-01"Dimend_date asstring="2019-12-12"DimresponseString asstring=""DimapiURL asstring="https://api.zerobounce.net/v2/getapiusage?api_key="&api_key &"&start_date="&start_date &"&end_date="&end_date Dimrequest AsHttpWebRequest =DirectCast(WebRequest.Create(apiURL),HttpWebRequest)request.Timeout=150000request.Method ="GET"Usingresponse AsWebResponse =request.GetResponse()response.GetResponseStream().ReadTimeout =20000Usingostream AsNewStreamReader(response.GetResponseStream())responseString =ostream.ReadToEnd()EndUsingEndUsingCatchex asexception
'Catch Exception - All errors will be shown here - if there are issues with the APIEndTry
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_net// https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__c-sharptry{stringapi_key ="Your Secret Key";stringstart_date ="2018-01-01";stringend_date ="2019-12-12";stringresponseString ="";stringapiURL ="https://api.zerobounce.net/v2/getapiusage?api_key="+api_key +"&start_date="+start_date +"&end_date="+end_date;HttpWebRequestrequest =(HttpWebRequest)WebRequest.Create(apiURL);request.Timeout =150000;request.Method ="GET";using(WebResponseresponse =request.GetResponse()){response.GetResponseStream().ReadTimeout =20000;using(StreamReaderostream =newStreamReader(response.GetResponseStream())){responseString =ostream.ReadToEnd();}}}catch(exception ex){//Catch Exception - All errors will be shown here - if there are issues with the API}
<?php// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__php//set the api key and email to be validated$api_key='Your Secret Key';$start_date='2018-01-01';$end_date='2019-12-12';// use curl to make the request$url='https://api.zerobounce.net/v2/getapiusage?api_key='.$api_key.'&start_date='.$start_date.'&end_date='.$end_date;$ch=curl_init($url);//PHP 5.5.19 and higher has support for TLS 1.2curl_setopt($ch,CURLOPT_SSLVERSION,6);curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,15);curl_setopt($ch,CURLOPT_TIMEOUT,150);$response=curl_exec($ch);curl_close($ch);//decode the json response$json=json_decode($response,true);?>
//Complete API Libraries and Wrappers can be found here: //https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__javaimportjava.io.BufferedReader;importjava.io.InputStreamReader;importjava.net.HttpURLConnection;importjava.net.URL;publicclassMyClass{publicstaticvoidmain(String[]args){Stringkey ="Your Secret Key";Stringstart_date ="2018-01-01";Stringend_date ="2019-12-12";StringtargetURL ="https://api.zerobounce.net/v2/getapiusage?api_key="+key+"&start_date="+start_date+"&end_date="+end_date;HttpURLConnectionconnection =null;finalStringUSER_AGENT ="Mozilla/5.0";try{URLurl =newURL(targetURL);connection =(HttpURLConnection)url.openConnection();connection.setRequestMethod("GET");connection.addRequestProperty("User-Agent",USER_AGENT);connection.setUseCaches(false);connection.setDoOutput(true);BufferedReaderin =newBufferedReader(newInputStreamReader(connection.getInputStream()));StringinputLine;StringBufferresponse =newStringBuffer();while((inputLine =in.readLine())!=null){response.append(inputLine);}in.close();//print resultSystem.out.println(response.toString());}catch(Exceptione){e.printStackTrace();}finally{if(connection !=null){connection.disconnect();}}}}
# Complete API Libraries and Wrappers can be found here: # https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__pythonurl ="https://api.zerobounce.net/v2/getapiusage"api_key ="Your Secret Key"start_date ="2018-01-01"end_date ="2019-12-12"params ={"api_key":api_key,"start_date":start_date,"end_date":end_date}response =requests.get(url,params=params)# Print the returned jsonprintjson.loads(response.content)
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__IOSletkey ="Your Secret Key"letstart_date ="2018-01-01"letend_date ="2019-12-12"//ip address can be blankleturl =URL(string:String(format:"https://api.zerobounce.net/v2/getapiusage?api_key=%@&start_date=%@&end_date=%@",key,start_date,end_date))lettask =URLSession.shared.dataTask(with:url!){(data,response,error)iniferror !=nil{NSLog("Error (String(describing: error))")}else{do{letparsedData =tryJSONSerialization.jsonObject(with:data!)as![String:Any]for(key,value)inparsedData {NSLog("(key)=(value) ")}}catch{print("Error deserializing JSON: (error)")}}}task.resume()
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__IOSNSString *key =@"Your Secret Key";NSString *start_date =@"2018-01-01";NSString *end_date =@"2019-12-12";NSString *urlString =[NSString stringWithFormat:@"https://api.zerobounce.net/v2/getapiusage?api_key=%@&start_date=%@&end_date=%@",key,start_date,end_date];__block NSURL *url =[NSURL URLWithString:urlString];dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0),^{NSData *response =[NSData dataWithContentsOfURL:url];NSDictionary *arrResponse =nil;if(response!=nil){arrResponse =[NSJSONSerialization JSONObjectWithData:response options:kNilOptions error:nil];}dispatch_async(dispatch_get_main_queue(),^(void){for(NSString *key in[arrResponse allKeys]){NSLog(@"%@: %@",key,[arrResponse objectForKey:key]);}// callback(nil, arr);});});
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__android//Add to build.gradle (App) in the "android" bracket:useLibrary 'org.apache.http.legacy'Example:android {compileSdkVersion 25useLibrary 'org.apache.http.legacy'}//-----------------------------------//Filename: JsonParser.javaimportandroid.os.AsyncTask;importorg.json.JSONObject;importjava.util.Iterator;publicclassMainActivityextendsAppCompatActivity{@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);newAsyncTaskParseJson().execute();}}publicclassAsyncTaskParseJsonextendsAsyncTask<String,String,String>{Stringkey ="Your Secret Key";Stringstart_date ="2018-01-01";Stringend_date ="2019-12-12";Stringurl ="https://api.zerobounce.net/v2/getapiusage?api_key="+key+"&start_date="+start_date+"&end_date="+end_date;@OverrideprotectedvoidonPreExecute(){}@OverrideprotectedStringdoInBackground(String...arg0){JsonParserjParser =newJsonParser();JSONObjectjson =jParser.getJSONFromUrl(url);Iteratorkeys =json.keys();while(keys.hasNext()){Stringkey =(String)keys.next();try{System.out.println("ZeroBounce: "+key+"="+json.get(key).toString());}catch(Exceptione){}}returnnull;}@OverrideprotectedvoidonPostExecute(StringstrFromDoInBg){}}//----------------------------------//Filename: MainActivity.javapackagecom.zerobounce.zbapiandroid;importjava.io.BufferedReader;importjava.io.IOException;importjava.io.InputStream;importjava.io.InputStreamReader;importjava.io.UnsupportedEncodingException;importorg.apache.http.HttpEntity;importorg.apache.http.HttpResponse;importorg.apache.http.client.ClientProtocolException;importorg.apache.http.client.methods.HttpGet;importorg.apache.http.impl.client.DefaultHttpClient;importorg.json.JSONException;importorg.json.JSONObject;importandroid.util.Log;publicclassJsonParser{finalStringTAG ="JsonParser.java";staticInputStreamis =null;staticJSONObjectjObj =null;staticStringjson ="";publicJSONObjectgetJSONFromUrl(Stringurl){try{DefaultHttpClienthttpClient =newDefaultHttpClient();HttpGethttpGet =newHttpGet(url);HttpResponsehttpResponse =httpClient.execute(httpGet);HttpEntityhttpEntity =httpResponse.getEntity();is =httpEntity.getContent();}catch(UnsupportedEncodingExceptione){e.printStackTrace();}catch(ClientProtocolExceptione){e.printStackTrace();}catch(IOExceptione){e.printStackTrace();}try{BufferedReaderreader =newBufferedReader(newInputStreamReader(is,"iso-8859-1"),8);StringBuildersb =newStringBuilder();Stringline =null;while((line =reader.readLine())!=null){sb.append(line +"
");}is.close();json =sb.toString();}catch(Exceptione){Log.e(TAG,"Error converting result "+e.toString());}try{jObj =newJSONObject(json);}catch(JSONExceptione){Log.e(TAG,"Error parsing data "+e.toString());}returnjObj;}}
Endpoint Response
Successful Response
{"total":3,"status_valid":1,"status_invalid":2,"status_catch_all":0,"status_do_not_mail":0,"status_spamtrap":0,"status_unknown":0,"sub_status_toxic":0,"sub_status_disposable":0,"sub_status_role_based":0,"sub_status_possible_trap":0,"sub_status_global_suppression":0,"sub_status_timeout_exceeded":0,"sub_status_mail_server_temporary_error":0,"sub_status_mail_server_did_not_respond":0,"sub_status_greylisted":0,"sub_status_antispam_system":0,"sub_status_does_not_accept_mail":0,"sub_status_exception_occurred":0,"sub_status_failed_syntax_check":0,"sub_status_mailbox_not_found":2,"sub_status_unroutable_ip_address":0,"sub_status_possible_typo":0,"sub_status_no_dns_entries":0,"sub_status_role_based_catch_all":0,"sub_status_mailbox_quota_exceeded":0,"sub_status_forcible_disconnect":0,"sub_status_failed_smtp_connection":0,"start_date":"1/1/2018","end_date":"12/12/2019"}
Error Response - API Key
{"error":"Invalid API Key"}
Error Response - Date
{"error":"Invalid Date"}
Below you will find the instructions on how to use our API, it's very easy to use and requires SSL. The API requires that you have an active credit balance and will never consume a credit for any unknown result. This endpoint can be called asynchronously and is currently not rate limited.
To test out or API without using credits - Please use the emails provided in our Sandbox Mode (v2)
The response time for our API is between one second and 70 seconds. Since API's are meant to be fast by nature, we limit the amount of time we spend validating an email address. So if we encounter a slow mail server or a mail server with a greylisting algorithm you will get an unknown result. You can always re-validate those conditions, uploading a file to the bulk email validator.
On average 96-98% of all domains will return in 1 to 5 seconds, there are a handful of domains that run off Postfix/Dovecot that have a 20 second connection time for real-time validations and a very small fractional percentage of other domains that are very slow to respond to SMTP inquiries. All the major ISP will return in 1 to 3 seconds, which is usually the majority of most email distribution.
- GET /v2/validate
API URL: https://api.zerobounce.net/v2/validate
Below you will find the instructions on how to use our API, it's very easy to use and requires SSL. The API requires that you have an active credit balance and will never consume a credit for any unknown result. This endpoint can be called asynchronously and is currently not rate limited.
URL Parameters
- ParameterDescription
- emailThe email address you want to validate
- ip_addressThe IP Address the email signed up from (Can be blank, but parameter required)
- api_keyYour API Key, found in your account.
If you want to call the API from your browser to test it, all you need to do is to replace the API KEY with your key:
- https://api.zerobounce.net/v2/validate?api_key=replacewithyours&email=valid@example.com&ip_address=156.124.12.145
To verify an email address, use the following codes for the following languages:
' Complete API Libraries and Wrappers can be found here: ' https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_netTryDimapi_key asstring="Your Secret Key"DimemailToValidate asstring="example@example.com" Dimip_address =""'Can be blank, but parameter required on the API CallDimresponseString asstring=""DimapiURL asstring="https://api.zerobounce.net/v2/validate?api_key="&api_key &"&email="&HttpUtility.UrlEncode(emailToValidate)&"&ip_address="&System.Net.WebUtility.UrlEncode(ip_address)Dimrequest AsHttpWebRequest =DirectCast(WebRequest.Create(apiURL),HttpWebRequest)request.Timeout=150000request.Method ="GET"Usingresponse AsWebResponse =request.GetResponse()response.GetResponseStream().ReadTimeout =20000Usingostream AsNewStreamReader(response.GetResponseStream())responseString =ostream.ReadToEnd()EndUsingEndUsingCatchex asexception 'Catch Exception - All errors will be shown here - if there are issues with the APIEndTry
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_net// https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__c-sharptry{stringapi_key ="Your Secret Key";stringemailToValidate ="example@example.com";stringip_address =""//Can be blank, but parameter required on the API CallstringresponseString ="";stringapiURL ="https://api.zerobounce.net/v2/validate?api_key="+api_key +"&email="+HttpUtility.UrlEncode(emailToValidate)+"&ip_address="+HttpUtility.UrlEncode(ip_address);HttpWebRequestrequest =(HttpWebRequest)WebRequest.Create(apiURL);request.Timeout =150000;request.Method ="GET";using(WebResponseresponse =request.GetResponse()){response.GetResponseStream().ReadTimeout =20000;using(StreamReaderostream =newStreamReader(response.GetResponseStream())){responseString =ostream.ReadToEnd();}}}catch(exception ex){//Catch Exception - All errors will be shown here - if there are issues with the API}
<?php// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__php//set the api key and email to be validated$api_key='Your Secret Key';$emailToValidate='example@example.com';$IPToValidate='99.123.12.122';// use curl to make the request$url='https://api.zerobounce.net/v2/validate?api_key='.$api_key.'&email='.urlencode($emailToValidate).'&ip_address='.urlencode($IPToValidate);$ch=curl_init($url);//PHP 5.5.19 and higher has support for TLS 1.2curl_setopt($ch,CURLOPT_SSLVERSION,6);curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,15);curl_setopt($ch,CURLOPT_TIMEOUT,150);$response=curl_exec($ch);curl_close($ch);//decode the json response$json=json_decode($response,true);?>
//Complete API Libraries and Wrappers can be found here: //https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__javaimportjava.io.BufferedReader;importjava.io.InputStreamReader;importjava.net.HttpURLConnection;importjava.net.URL;publicclassMyClass{publicstaticvoidmain(String[]args){Stringkey ="Your Secret Key";Stringemail ="example@example.com";Stringip ="99.123.12.122";//ip address can be blankStringtargetURL ="https://api.zerobounce.net/v2/validate?api_key="+key+"&email="+email+"&ip_address="+ip;HttpURLConnectionconnection =null;finalStringUSER_AGENT ="Mozilla/5.0";try{URLurl =newURL(targetURL);connection =(HttpURLConnection)url.openConnection();connection.setRequestMethod("GET");connection.addRequestProperty("User-Agent",USER_AGENT);connection.setUseCaches(false);connection.setDoOutput(true);BufferedReaderin =newBufferedReader(newInputStreamReader(connection.getInputStream()));StringinputLine;StringBufferresponse =newStringBuffer();while((inputLine =in.readLine())!=null){response.append(inputLine);}in.close();//print resultSystem.out.println(response.toString());}catch(Exceptione){e.printStackTrace();}finally{if(connection !=null){connection.disconnect();}}}}
# Complete API Libraries and Wrappers can be found here: # https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__pythonurl ="https://api.zerobounce.net/v2/validate"api_key ="Your Secret Key"email ="example@example.com"ip_address ="99.123.12.122"#ip_address can be blankparams ={"email":email,"api_key":api_key,"ip_address":ip_address}response =requests.get(url,params=params)# Print the returned jsonprintjson.loads(response.content)
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__IOSletkey ="Your Secret Key"letemail ="example@example.com"letip ="99.123.12.122"//ip address can be blankleturl =URL(string:String(format:"https://api.zerobounce.net/v2/validate?api_key=%@&email=%@&ip_address=%@",key,email,ip))lettask =URLSession.shared.dataTask(with:url!){(data,response,error)iniferror !=nil{NSLog("Error (String(describing: error))")}else{do{letparsedData =tryJSONSerialization.jsonObject(with:data!)as![String:Any]for(key,value)inparsedData {NSLog("(key)=(value) ")}}catch{print("Error deserializing JSON: (error)")}}}task.resume()
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__IOSNSString *key =@"Your Secret Key";NSString *email =@"example@example.com";NSString *ip =@"99.123.12.122";//ip address can be blankNSString *urlString =[NSString stringWithFormat:@"https://api.zerobounce.net/v2/validate?api_key=%@&email=%@&ip_address=%@",key,email,ip];__block NSURL *url =[NSURL URLWithString:urlString];dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,0),^{NSData *response =[NSData dataWithContentsOfURL:url];NSDictionary *arrResponse =nil;if(response!=nil){arrResponse =[NSJSONSerialization JSONObjectWithData:response options:kNilOptions error:nil];}dispatch_async(dispatch_get_main_queue(),^(void){for(NSString *key in[arrResponse allKeys]){NSLog(@"%@: %@",key,[arrResponse objectForKey:key]);}// callback(nil, arr);});});
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__android//Add to build.gradle (App) in the "android" bracket:useLibrary 'org.apache.http.legacy'Example:android {compileSdkVersion 25useLibrary 'org.apache.http.legacy'}//-----------------------------------//Filename: JsonParser.javaimportandroid.os.AsyncTask;importorg.json.JSONObject;importjava.util.Iterator;publicclassMainActivityextendsAppCompatActivity{@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.onCreate(savedInstanceState);newAsyncTaskParseJson().execute();}}publicclassAsyncTaskParseJsonextendsAsyncTask<String,String,String>{Stringkey ="Your Secret Key";Stringemail ="example@example.com";Stringip ="99.123.12.122";//ip address can be blankStringurl ="https://api.zerobounce.net/v2/validate?api_key="+key+"&email="+email+"&ip_address="+ip;@OverrideprotectedvoidonPreExecute(){}@OverrideprotectedStringdoInBackground(String...arg0){JsonParserjParser =newJsonParser();JSONObjectjson =jParser.getJSONFromUrl(url);Iteratorkeys =json.keys();while(keys.hasNext()){Stringkey =(String)keys.next();try{System.out.println("ZeroBounce: "+key+"="+json.get(key).toString());}catch(Exceptione){}}returnnull;}@OverrideprotectedvoidonPostExecute(StringstrFromDoInBg){}}//----------------------------------//Filename: MainActivity.javapackagecom.zerobounce.zbapiandroid;importjava.io.BufferedReader;importjava.io.IOException;importjava.io.InputStream;importjava.io.InputStreamReader;importjava.io.UnsupportedEncodingException;importorg.apache.http.HttpEntity;importorg.apache.http.HttpResponse;importorg.apache.http.client.ClientProtocolException;importorg.apache.http.client.methods.HttpGet;importorg.apache.http.impl.client.DefaultHttpClient;importorg.json.JSONException;importorg.json.JSONObject;importandroid.util.Log;publicclassJsonParser{finalStringTAG ="JsonParser.java";staticInputStreamis =null;staticJSONObjectjObj =null;staticStringjson ="";publicJSONObjectgetJSONFromUrl(Stringurl){try{DefaultHttpClienthttpClient =newDefaultHttpClient();HttpGethttpGet =newHttpGet(url);HttpResponsehttpResponse =httpClient.execute(httpGet);HttpEntityhttpEntity =httpResponse.getEntity();is =httpEntity.getContent();}catch(UnsupportedEncodingExceptione){e.printStackTrace();}catch(ClientProtocolExceptione){e.printStackTrace();}catch(IOExceptione){e.printStackTrace();}try{BufferedReaderreader =newBufferedReader(newInputStreamReader(is,"iso-8859-1"),8);StringBuildersb =newStringBuilder();Stringline =null;while((line =reader.readLine())!=null){sb.append(line +"
");}is.close();json =sb.toString();}catch(Exceptione){Log.e(TAG,"Error converting result "+e.toString());}try{jObj =newJSONObject(json);}catch(JSONExceptione){Log.e(TAG,"Error parsing data "+e.toString());}returnjObj;}}
Successful Response
{"address":"flowerjill@aol.com","status":"valid","sub_status":"","free_email":true,"did_you_mean":null,"account":"flowerjill","domain":"aol.com","domain_age_days":"8426","smtp_provider":"yahoo","mx_record":"mx-aol.mail.gm0.yahoodns.net","mx_found":true,"firstname":"Jill","lastname":"Stein","gender":"female","country":"United States","region":"Florida","city":"West Palm Beach","zipcode":"33401","processed_at":"2017-04-01 02:48:02.592"}
Error Response
{"error":"Invalid API Key or your account ran out of credits"}// Failure response sample using the API with either method Get
The API will return these results in a JSON format using the "Validate" method.
JSON Properties
- PropertiesDescription
- addressThe email address you are validating.
- status[valid, invalid, catch-all, unknown, spamtrap, abuse, do_not_mail]
- sub_status[antispam_system,greylisted, mail_server_temporary_error, forcible_disconnect, mail_server_did_not_respond, timeout_exceeded, failed_smtp_connection, mailbox_quota_exceeded, exception_occurred, possible_traps, role_based, global_suppression, mailbox_not_found, no_dns_entries, failed_syntax_check, possible_typo, unroutable_ip_address, leading_period_removed, does_not_accept_mail, alias_address, role_based_catch_all, disposable, toxic]
- accountThe portion of the email address before the "@" symbol.
- domainThe portion of the email address after the "@" symbol.
- did_you_meanSuggestive Fix for an email typo
- domain_age_daysAge of the email domain in days or [null].
- free_email[true/false] If the email comes from a free provider.
- mx_found[true/false] Does the domain have an MX record.
- mx_recordThe preferred MX record of the domain
- smtp_providerThe SMTP Provider of the email or [null] [BETA].
- firstnameThe first name of the owner of the email when available or [null].
- lastnameThe last name of the owner of the email when available or [null].
- genderThe gender of the owner of the email when available or [null].
- cityThe city of the IP passed in or [null]
- regionThe region/state of the IP passed in or [null]
- zipcodeThe zipcode of the IP passed in or [null]
- countryThe country of the IP passed in or [null]
- processed_atThe UTC time the email was validated.
This endpoint allows you to send us batches up to 100 emails at a time. It is rate limited to 5 uses per minute, if you exceed the rate limit, you will be blocked for 10 minutes. If you're looking to do single email validations, please use our single email validatorendpoint.
If you're looking to upload files with emails greater than 100 at a time without any rate limiting restrictions, please use our Bulk File Management Endpointswhich also includes anti-greylistingas an added benefit.
This endpoint can take up to 70 seconds to return the results of the entire batch. We currently don't have an SDK for this endpoint, but SDK's are available for our other endpoints.
- POST /v2/validatebatch
API URL: https://bulkapi.zerobounce.net/v2/validatebatch
Below you will find the instructions on how to use our API, it's very easy to use and requires SSL. The API requires that you have an active credit balance and will never consume a credit for any unknown result.
URL Parameters
- ParameterDescription
- emailThe email address you want to validate
- email_batch[Array of Objects], Format:{"email_address": "valid@example.com","ip_address": "1.1.1.1"}
Example Post Request
{"api_key":"Your API Key","email_batch":[{"email_address":"valid@example.com","ip_address":"1.1.1.1"},{"email_address":"invalid@example.com","ip_address":"1.1.1.1"},{"email_address":"disposable@example.com","ip_address":null}]}
To use this endpoint, use the code examples below for the desired language:
DimapiURL ="https://bulkapi.zerobounce.net/v2/validatebatch"DimapiKey ="Your API Key"DimformData ="{""api_key"":""" & apiKey & """," & vbCrLf & "" & """email_batch"":[" &vbCrLf &"{""email_address"":""valid@example.com"",""ip_address"":""1.1.1.1""}," &vbCrLf &"{""email_address"":""invalid@example.com"",""ip_address"":""1.1.1.1""}," &vbCrLf &"{""email_address"":""disposable@example.com"",""ip_address"":null}" & vbCrLf & "]" & vbCrLf & "}" Dimrequest AsHttpWebRequest =CType(WebRequest.Create(apiURL),HttpWebRequest)request.Method ="POST"request.ContentType ="application/json"request.ContentLength =formData.LengthDimformLookupDataBytes AsByte()=Encoding.UTF8.GetBytes(formData)UsingpostStream AsStream=request.GetRequestStream()postStream.Write(formLookupDataBytes,0,formLookupDataBytes.Length)EndUsingUsingresponse =CType(request.GetResponse(),HttpWebResponse)Usingsr =NewStreamReader(response.GetResponseStream())DimresponseString =sr.ReadToEnd()EndUsingEndUsing
varapiURL ="https://bulkapi.zerobounce.net/v2/validatebatch";varapiKey ="Your API Key";varformData ="{"api_key":"" + apiKey + "", "+""email_batch":["+"{"email_address": "valid@example.com","ip_address": "1.1.1.1"},"+"{"email_address": "invalid@example.com","ip_address": "1.1.1.1"},"+"{"email_address": "disposable@example.com","ip_address": null}]}";HttpWebRequestrequest =(HttpWebRequest)WebRequest.Create(apiURL);request.Method ="POST";request.ContentType ="application/json";request.ContentLength =formData.Length;byte[]formLookupDataBytes =UTF8Encoding.UTF8.GetBytes(formData);using(StreampostStream =request.GetRequestStream()){postStream.Write(formLookupDataBytes,0,formLookupDataBytes.Length);}using(varresponse =(HttpWebResponse)request.GetResponse()){using(varsr =newStreamReader(response.GetResponseStream())){varresponseString =sr.ReadToEnd();}}
<?php$curl=curl_init();curl_setopt_array($curl,array(CURLOPT_URL=>"https://bulkapi.zerobounce.net/v2/validatebatch",CURLOPT_RETURNTRANSFER=>true,CURLOPT_ENCODING=>"",CURLOPT_MAXREDIRS=>10,CURLOPT_TIMEOUT=>0,CURLOPT_FOLLOWLOCATION=>true,CURLOPT_HTTP_VERSION=>CURL_HTTP_VERSION_1_1,CURLOPT_CUSTOMREQUEST=>"POST",CURLOPT_POSTFIELDS=>"{"api_key":"Your APIKEY", "email_batch":[{"email_address": "valid@example.com","ip_address": "1.1.1.1"},{"email_address": "invalid@example.com","ip_address": "1.1.1.1"},{"email_address": "disposable@example.com","ip_address": null}]}",CURLOPT_HTTPHEADER=>array("x-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImhlbnJ5QHplcm9ib3VuY2UubmV0IiwiZXhwIjoxNTk1NzEzNTI1fQ.nzOT-bJ8_tvnrNy3t1DeIDNMXxS-YEvlCbZye-9vpr4","Content-Type: application/json","Cookie: __cfduid=db977bdba3d06a8c9c19b45a92d6221b41572452483"),));$response=curl_exec($curl);curl_close($curl);echo$response;?>
importhttp.client importmimetypes conn =http.client.HTTPSConnection("bulkapi.zerobounce.net")payload ='{"api_key":"Your API KEY","email_batch":[{"email_address":"valid@example.com","ip_address":"1.1.1.1"},{"email_address":"invalid@example.com","ip_address":"1.1.1.1"},{"email_address":"disposable@example.com","ip_address":null }]}' headers ={'x-token':'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImhlbnJ5QHplcm9ib3VuY2UubmV0IiwiZXhwIjoxNTk1NzEzNTI1fQ.nzOT-bJ8_tvnrNy3t1DeIDNMXxS-YEvlCbZye-9vpr4','Content-Type':'application/json','Cookie':'__cfduid=db977bdba3d06a8c9c19b45a92d6221b41572452483'}conn.request("POST","/v2/validatebatch",payload,headers)res =conn.getresponse()data =res.read()print(data.decode("utf-8"))
importFoundationvarsemaphore =DispatchSemaphore(value:0)letparameters ="{"api_key":"YourAPIKEY", "email_batch":[{"email_address": "valid@example.com","ip_address": "1.1.1.1"},{"email_address": "invalid@example.com","ip_address": "1.1.1.1"},{"email_address": "disposable@example.com","ip_address": null}]}"letpostData =parameters.data(using:.utf8)varrequest =URLRequest(url:URL(string:"https://bulkapi.zerobounce.net/v2/validatebatch")!,timeoutInterval:Double.infinity)request.addValue("eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImhlbnJ5QHplcm9ib3VuY2UubmV0IiwiZXhwIjoxNTk1NzEzNTI1fQ.nzOT-bJ8_tvnrNy3t1DeIDNMXxS-YEvlCbZye-9vpr4",forHTTPHeaderField:"x-token")request.addValue("application/json",forHTTPHeaderField:"Content-Type")request.addValue("__cfduid=db977bdba3d06a8c9c19b45a92d6221b41572452483",forHTTPHeaderField:"Cookie")request.httpMethod ="POST"request.httpBody =postData lettask =URLSession.shared.dataTask(with:request){data,response,error inguardletdata =data else{print(String(describing:error))return}print(String(data:data,encoding:.utf8)!)semaphore.signal()}task.resume()semaphore.wait()
curl --location --request POST 'https://bulkapi.zerobounce.net/v2/validatebatch' --header 'x-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VybmFtZSI6ImhlbnJ5QHplcm9ib3VuY2UubmV0IiwiZXhwIjoxNTk1NzEzNTI1fQ.nzOT-bJ8_tvnrNy3t1DeIDNMXxS-YEvlCbZye-9vpr4' --header 'Content-Type: application/json' --header 'Cookie: __cfduid=db977bdba3d06a8c9c19b45a92d6221b41572452483' --data-raw '{"api_key":"Your API KEY", "email_batch":[
{"email_address": "valid@example.com","ip_address": "1.1.1.1"},
{"email_address": "invalid@example.com","ip_address": "1.1.1.1"},
{"email_address": "disposable@example.com","ip_address": null}
]}'
Successful Response
{"email_batch":[{"address":"valid@example.com","status":"valid","sub_status":"","free_email":false,"did_you_mean":null,"account":null,"domain":null,"domain_age_days":"9692","smtp_provider":"example","mx_found":"true","mx_record":"mx.example.com","firstname":"zero","lastname":"bounce","gender":"male","country":null,"region":null,"city":null,"zipcode":null,"processed_at":"2020-09-17 17:43:11.829"},{"address":"invalid@example.com","status":"invalid","sub_status":"mailbox_not_found","free_email":false,"did_you_mean":null,"account":null,"domain":null,"domain_age_days":"9692","smtp_provider":"example","mx_found":"true","mx_record":"mx.example.com","firstname":"zero","lastname":"bounce","gender":"male","country":null,"region":null,"city":null,"zipcode":null,"processed_at":"2020-09-17 17:43:11.830"},{"address":"disposable@example.com","status":"do_not_mail","sub_status":"disposable","free_email":false,"did_you_mean":null,"account":null,"domain":null,"domain_age_days":"9692","smtp_provider":"example","mx_found":"true","mx_record":"mx.example.com","firstname":"zero","lastname":"bounce","gender":"male","country":null,"region":null,"city":null,"zipcode":null,"processed_at":"2020-09-17 17:43:11.830"}],"errors":[]}
Error Response
{"email_batch":[],"errors":[{"error":"Invalid API Key or your account ran out of credits","email_address":"all"}]}
The API will return a JSON onject with 2 array values, "email_batch" and "errors" using the "BatchValidate" method.
The email_batch property will be an array of validated results and the errors array will be an array of errors encountered during batch vaidation, if any.
JSON Properties
- PropertiesDescription
- email_batch[Array] An Array of validated emails
- errors[Array] An Array of errors encuontered, if any
email_batch Properties
- PropertiesDescription
- addressThe email address you are validating.
- status[valid, invalid, catch-all, unknown, spamtrap, abuse, do_not_mail]
- sub_status[antispam_system,greylisted, mail_server_temporary_error, forcible_disconnect, mail_server_did_not_respond, timeout_exceeded, failed_smtp_connection, mailbox_quota_exceeded, exception_occurred, possible_traps, role_based, global_suppression, mailbox_not_found, no_dns_entries, failed_syntax_check, possible_typo, unroutable_ip_address, leading_period_removed, does_not_accept_mail, alias_address, role_based_catch_all, disposable, toxic]
- accountThe portion of the email address before the "@" symbol.
- domainThe portion of the email address after the "@" symbol.
- did_you_meanSuggestive Fix for an email typo
- domain_age_daysAge of the email domain in days or [null].
- free_email[true/false] If the email comes from a free provider.
- mx_found[true/false] Does the domain have an MX record.
- mx_recordThe preferred MX record of the domain
- smtp_providerThe SMTP Provider of the email or [null] [BETA].
- firstnameThe first name of the owner of the email when available or [null].
- lastnameThe last name of the owner of the email when available or [null].
- genderThe gender of the owner of the email when available or [null].
- cityThe city of the IP passed in or [null]
- regionThe region/state of the IP passed in or [null]
- zipcodeThe zipcode of the IP passed in or [null]
- countryThe country of the IP passed in or [null]
- processed_atThe UTC time the email was validated.
To help you test every scenario of status and sub_status codes with the API, we put together a list of emails that will return specific results when used with the API for testing purposes. Testing with these emails will not use any of your credits.
In addition, we also provide an IP address to test with to get GEO-Location results.
You will still need to use your API KEY with these test email addresses.
disposable@example.com
invalid@example.com
valid@example.com
toxic@example.com
donotmail@example.com
spamtrap@example.com
abuse@example.com
unknown@example.com
catch_all@example.com
antispam_system@example.com
does_not_accept_mail@example.com
exception_occurred@example.com
failed_smtp_connection@example.com
failed_syntax_check@example.com
forcible_disconnect@example.com
global_suppression@example.com
greylisted@example.com
leading_period_removed@example.com
mail_server_did_not_respond@example.com
mail_server_temporary_error@example.com
mailbox_quota_exceeded@example.com
mailbox_not_found@example.com
no_dns_entries@example.com
possible_trap@example.com
possible_typo@example.com
role_based@example.com
timeout_exceeded@example.com
unroutable_ip_address@example.com
free_email@example.com
role_based_catch_all@example.com
You can use this IP to test the GEO Location in the API.
99.110.204.1
Deliverability Status Explanation
- valid- These are emails that we determined to be valid and safe to email to, they will have a very low bounce rate of under 2%. If you receive bounces it can be because your IP might be blacklisted where our IP was not. Sometimes the email accounts exist, but they are only accepting mail from people in their contact lists. Sometimes you will get throttle on number of emails you can send to a specific domain per hour. It's important to look at the SMTP Bounce codes to determine why.
- invalid- These are emails that we determined to be invalid, please delete them from your mailing list. The results are 99.999% accurate.
- catch-all - These emails are impossible to validate without sending a real email and waiting for a bounce. The term Catch-all means that the email server tells you that the email is valid, whether it's valid or invalid. If you want to email these addresses, I suggest you segment them into a catch-all group and know that some of these will most likely bounce.
- spamtrap- These emails are believed to be spamtrapsand should not be mailed. We have technology in place to determine if certain emails should be classified as spamtrap. We don't know all the spamtrap email addresses, but we do know a lot of them. Read our Guide to Spam Traps to learn more.
- abuse- These emails are of people who are known to click the abuse links in emails, hence abusers or complainers. We recommend not emailing these addresses.
- do_not_mail- These emails are of companies, role-based, or people you just want to avoid emailing to. They are broken down into 6 sub-categories "disposable","toxic", "role_based", "role_based_catch_all", "global_suppression" and "possible_trap". Examine this file and determine if you want to email these address. They are valid email addresses, but shouldn't be mailed in most cases.
- unknown- These emails we weren't able to validate for one reason or another. Typical cases are "Their mail server was down" or "the anti-spam system is blocking us". In most cases, 80% unknowns are invalid/bad email addresses. We have the lowest "unknowns" of any email validator, and we don't make this statement lightly. We paid and tested email lists at over 50 different validation companies to compare results. If you do encounter a large number of unknowns, please submit those for re-validation. Remember you are not charged for unknown results, credits will be credited back. If you still have a large number, contact us and we will take a look and verify.
We also provide a sub_status code to help explain some of the unknown and invalid results, not all unknowns and invalids will have sub_status codes.
Sub Status Explanation
- alias_address- (valid) These emails addresses act as forwarders/aliases and are not real inboxes, for example if you send an email to forward@example.com and then the email is forwarded to realinbox@example.com. It's a valid email address and you can send to them, it's just a little more information about the email address. We can sometimes detect alias email addresses and when we do we let you know.
- antispam_system- (unknown) These emails have anti-spam systems deployed that are preventing us from validating these emails. You can submit these to us through the contact us screen to look into.
- does_not_accept_mail- (invalid) These domains only send mail and don't accept it.
- exception_occurred- (unknown) These emails caused an exception when validating. If this happens repeatedly, please let us know.
- failed_smtp_connection- (unknown) These emails belong to a mail server that won't allow an SMTP connection. Most of the time, these emails will end up being invalid.
- failed_syntax_check- (Invalid) Emails that fail RFC syntax protocols
- forcible_disconnect- (Unknown) These emails belong to a mail server that disconnects immediately upon connecting. Most of the time, these emails will end up being invalid.
- global_suppression- (do_not_mail) These emails are found in many popular global suppression lists (GSL), they consist of known ISP complainers, direct complainers, purchased addresses, domains that don't send mail, and known litigators.
- greylisted- (Unknown) Emails where we are temporarily unable to validate them. A lot of times if you resubmit these emails they will validate on a second pass.
- leading_period_removed- (valid) If a valid gmail.com email address starts with a period '.' we will remove it, so the email address is compatible with all mailing systems.
- mail_server_did_not_respond- (unknown) These emails belong to a mail server that is not responding to mail commands. Most of the time, these emails will end up being invalid.
- mail_server_temporary_error- (unknown) These emails belong to a mail server that is returning a temporary error. Most of the time, these emails will end up being invalid.
- mailbox_quota_exceeded- (invalid) These emails exceeded their space quota and are not accepting emails. These emails are marked invalid.
- mailbox_not_found- (invalid) These emails addresses are valid in syntax, but do not exist. These emails are marked invalid.
- no_dns_entries- (invalid) These emails are valid in syntax, but the domain doesn't have any records in DNS or have incomplete DNS Records. Therefore, mail programs will be unable to or have difficulty sending to them. These emails are marked invalid.
- possible_trap- (do_not_mail) These emails contain keywords that might correlate to possible spam traps like spam@ or @spamtrap.com. Examine these before deciding to send emails to them or not.
- possible_typo- (invalid) These are emails of commonly misspelled popular domains. These emails are marked invalid.
- role_based- (do_not_mail) These emails belong to a position or a group of people, like sales@ info@ and contact@. Role-based emails have a strong correlation to people reporting mails sent to them as spam and abuse.
- role_based_catch_all- (do_not_mail) These emails are role-based and also belong to a catch_all domain.
- timeout_exceeded- (unknown) These emails belong to a mail server that is responding extremely slow. Most of the time, these emails will end up being invalid.
- unroutable_ip_address- (invalid) These emails domains point to an un-routable IP address, these are marked invalid.
- disposable- (do_not_mail) These are temporary emails created for the sole purpose to sign up to websites without giving their real email address. These emails are short lived from 15 minutes to around 6 months. There is only 2 values (True and False). If you have valid emails with this flag set to TRUE, you shouldn't email them.
- toxic- (do_not_mail) These email addresses are known to be abuse, spam, or bot created emails. If you have valid emails with this flag set to TRUE, you shouldn't email them.
We also provide other additional fields that you should take into consideration before emailing. If any of your valid emails have the disposable or toxic flag set to true, we recommend that you don't email them.
Other Fields
- free_email- [true/false] If the email comes from a free provider.
- mx_found- [true/false] Does the domain have an MX record.
- mx_record- The preferred MX record of the domain.
- smtp_provider- The SMTP Provider of the email or [null] (BETA).
These are the items that changed between v1 and v2.
Disposable and Toxic emails have been moved under the do_not_mail status with the appropriate sub_status (toxic, disposable)
The "DoNotMail" status was changed to "do_not_mail"
All statuses are now lowercase, instead of mixed case.
We added a free_email property to indicate if the email domain is a free email provider can be used for [fraud prevention].
We added a domain_age_days property, to let you know how old the domain is [fraud prevention].
We added the smtp_provider property for the email domain, this feature is in beta.
We added the mx_found property, to let you know if the domain has an MX record
We added the mx_record property, to tell you the preferred MX record of the domain.
We added the did_you_mean property, which will be populated if a typo is detected with a suggested correction.
apiKey property was changed to api_key
IPAddress property was changed to ip_address
The validatewithip method was removed, it's now part of the validate method
The location property was removed (wasn't being used)
The creation_date property was removed (wasn't being used)
processedat property is now processed_at
We added a new sub_status called "role_based_catch_all"
We added three new API, sendfile, filestatus, and getfile for bulk email validation.
Recommended API Usage
The sendfile API allows user to send a file for bulk email validation. The content type needs to be multipart/form-data. Please refer to the C# example for details.
There is no restriction on file size, number of emails, or number of files you can submit using this endpoint, as long as you have the credits in your account to cover the number of emails in submitted in the file, it will be accepted.
POST /v2/sendfile
API URL: https://bulkapi.zerobounce.net/v2/sendfile
URL Parameters
- ParameterDescription
- filecsv or txt file. Byte array contents for the submitted file. The content's header is type of "text/csv".
- api_keyYour API Key, found in your account. (Required)
- return_urlThe URL will be used to call back when the validation is completed. (Optional)
- email_address_columnThe column index of the email address in the file. Index starts from 1. (Required)
- first_name_columnThe column index of the first name column. (Optional)
- last_name_columnThe column index of the last name column. (Optional)
- gender_columnThe column index of the gender column. (Optional)
- ip_address_columnThe IP Address the email signed up from. (Optional)
- has_header_rowIf the first row from the submitted file is a header row. true or false (Optional)
If a return_url was specified in the Multipart Form Data during the send file request, we will POST the following data to the URL when the validation process is complete.
{file_id": "aaaaaaaa-zzzz-xxxx-yyyy-5003727fffff","file_name":"Your file name.csv","upload_date":"10/20/2018 4:35:58 PM"}
Send File Code Samples
' Complete API Libraries and Wrappers can be found here: ' https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_net' Send File Sample in VB.netPublicClassSendFileStatus PublicPropertysuccess AsBooleanPublicPropertymessage AsStringPublicPropertyfile_name AsStringPublicPropertyfile_id AsStringEndClassPrivateSharedSubSendFileAPITest()DimfileFullPath AsString=$"full file path of a csv or txt file"' requiredDimapiKey AsString="replace with your api key here"' requiredDimemailAddressColumn AsInteger=2' requiredDimfirstNameColumn AsInteger? =5' optionalDimlastNameColumn AsInteger? =6' optionalDimgenderColumn AsInteger? =Nothing' optionalDimipAddressColumn AsInteger? =11' optionalDimhasHeaderRow AsBoolean? =True' optionalDimreturnUrl AsString=Nothing' optionalTryDimsendFileStatus AsSendFileStatus =SendFile(fileFullPath,apiKey,emailAddressColumn,firstNameColumn,lastNameColumn,genderColumn,ipAddressColumn,hasHeaderRow,returnUrl).Result Console.Write(JsonConvert.SerializeObject(sendFileStatus,Formatting.Indented))Catchex AsException Console.Write(ex.InnerException.Message)EndTryConsole.ReadKey()EndSubPublicSharedAsync FunctionSendFile(ByValfileFullPath AsString,ByValapiKey AsString,ByValemailAddressColumn AsInteger,ByValOptionalfirstNameColumn AsInteger? =Nothing,ByValOptionallastNameColumn AsInteger? =Nothing,ByValOptionalgenderColumn AsInteger? =Nothing,ByValOptionalipAddressColumn AsInteger? =Nothing,ByValOptionalhasHeaderRow AsBoolean? =Nothing,ByValOptionalreturnUrl AsString=Nothing)AsTask(OfSendFileStatus)IfString.IsNullOrEmpty(fileFullPath)ThenThrowNewException("Error: fileFullPath is required")IfString.IsNullOrEmpty(apiKey)ThenThrowNewException("Error: apiKey is required")Dimfi =NewFileInfo(fileFullPath)DimfileContents =File.ReadAllBytes(fi.FullName)DimfileName =fi.NameDimuri AsUri =NewUri("https://bulkapi.zerobounce.net/v2/sendfile")Usingclient =NewHttpClient()Usingrequest =NewHttpRequestMessage(HttpMethod.Post,uri)DimmultiPartContent AsMultipartFormDataContent =NewMultipartFormDataContent()DimbyteArrayContent AsByteArrayContent =NewByteArrayContent(fileContents)byteArrayContent.Headers.Add("Content-Type","text/csv")multiPartContent.Add(byteArrayContent,"file",fileName)multiPartContent.Add(NewStringContent(apiKey),"api_key")multiPartContent.Add(NewStringContent(emailAddressColumn.ToString()),"email_address_column")IffirstNameColumn IsNotNothingThenmultiPartContent.Add(NewStringContent(firstNameColumn.ToString()),"first_name_column")IflastNameColumn IsNotNothingThenmultiPartContent.Add(NewStringContent(lastNameColumn.ToString()),"last_name_column")IfgenderColumn IsNotNothingThenmultiPartContent.Add(NewStringContent(genderColumn.ToString()),"gender_column")IfipAddressColumn IsNotNothingThenmultiPartContent.Add(NewStringContent(ipAddressColumn.ToString()),"ip_address_column")IfhasHeaderRow IsNotNothingThenmultiPartContent.Add(NewStringContent(If((hasHeaderRow =True),"true","false")),"has_header_row")IfreturnUrl IsNotNothingThenmultiPartContent.Add(NewStringContent(returnUrl.ToString()),"return_url")request.Content =multiPartContent Usingresponse =Await client.SendAsync(request,HttpCompletionOption.ResponseContentRead,CancellationToken.None).ConfigureAwait(False)Dimcontent =Await response.Content.ReadAsStringAsync()Ifresponse.IsSuccessStatusCode =FalseThenDimerrorAsString=$"StatusCode ={CInt(response.StatusCode)},Content ={content}" ThrowNewException(error)EndIfReturnJsonConvert.DeserializeObject(OfSendFileStatus)(content)EndUsingEndUsingEndUsingEndFunction
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_net// https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__c-sharp// Send File Sample in C#publicclassSendFileStatus{publicboolsuccess {get;set;}publicstringmessage {get;set;}publicstringfile_name {get;set;}publicstringfile_id {get;set;}}privatestaticvoidSendFileAPITest(){stringfileFullPath =$"full file path of a csv or txt file";//requiredstringapiKey ="replace with your api key here";//required intemailAddressColumn =2;//requiredint?firstNameColumn =5;//optionalint?lastNameColumn =6;//optionalint?genderColumn =null;//optionalint?ipAddressColumn =11;//optionalbool?hasHeaderRow =true;//optionalstringreturnUrl =null;//optionaltry{SendFileStatussendFileStatus =SendFile(fileFullPath,apiKey,emailAddressColumn,firstNameColumn,lastNameColumn,genderColumn,ipAddressColumn,hasHeaderRow,returnUrl).Result;Console.Write(JsonConvert.SerializeObject(sendFileStatus,Formatting.Indented));}catch(Exceptionex){Console.Write(ex.InnerException.Message);}Console.ReadKey();}publicstaticasyncTask<SendFileStatus>SendFile(stringfileFullPath,stringapiKey,intemailAddressColumn,int?firstNameColumn =null,int?lastNameColumn =null,int?genderColumn =null,int?ipAddressColumn =null,bool?hasHeaderRow =null,stringreturnUrl =null){if(string.IsNullOrEmpty(fileFullPath))thrownewException("Error: fileFullPath is required");if(string.IsNullOrEmpty(apiKey))thrownewException("Error: apiKey is required");varfi =newFileInfo(fileFullPath);varfileContents =File.ReadAllBytes(fi.FullName);varfileName =fi.Name;Uriuri =newUri(@"https://bulkapi.zerobounce.net/v2/sendfile");using(varclient =newHttpClient())using(varrequest =newHttpRequestMessage(HttpMethod.Post,uri)){MultipartFormDataContentmultiPartContent =newMultipartFormDataContent();ByteArrayContentbyteArrayContent =newByteArrayContent(fileContents);byteArrayContent.Headers.Add("Content-Type","text/csv");multiPartContent.Add(byteArrayContent,"file",fileName);multiPartContent.Add(newStringContent(apiKey),"api_key");multiPartContent.Add(newStringContent(emailAddressColumn.ToString()),"email_address_column");if(firstNameColumn !=null)multiPartContent.Add(newStringContent(firstNameColumn.ToString()),"first_name_column");if(lastNameColumn !=null)multiPartContent.Add(newStringContent(lastNameColumn.ToString()),"last_name_column");if(genderColumn !=null)multiPartContent.Add(newStringContent(genderColumn.ToString()),"gender_column");if(ipAddressColumn !=null)multiPartContent.Add(newStringContent(ipAddressColumn.ToString()),"ip_address_column");if(hasHeaderRow !=null)multiPartContent.Add(newStringContent((hasHeaderRow ==true)?"true":"false"),"has_header_row");if(returnUrl !=null)multiPartContent.Add(newStringContent(returnUrl.ToString()),"return_url");request.Content =multiPartContent;using(varresponse =awaitclient.SendAsync(request,HttpCompletionOption.ResponseContentRead,CancellationToken.None).ConfigureAwait(false)){varcontent =awaitresponse.Content.ReadAsStringAsync();if(response.IsSuccessStatusCode ==false){varerror =$"StatusCode={(int)response.StatusCode}, Content={content}";thrownewException(error);}returnJsonConvert.DeserializeObject<SendFileStatus>(content);}}}
<?php// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__php$curl=curl_init();curl_setopt_array($curl,array(CURLOPT_URL=>"https://bulkapi.zerobounce.net/v2/sendfile",CURLOPT_RETURNTRANSFER=>true,CURLOPT_ENCODING=>"",CURLOPT_MAXREDIRS=>10,CURLOPT_TIMEOUT=>30,CURLOPT_HTTP_VERSION=>CURL_HTTP_VERSION_1_1,CURLOPT_CUSTOMREQUEST=>"POST",CURLOPT_POSTFIELDS=>"------WebKitFormBoundary7MA4YWxkTrZu0gWContent-Disposition: form-data; name="api_key"replacewithyours------WebKitFormBoundary7MA4YWxkTrZu0gWContent-Disposition: form-data; name="email_address_column"replacewithyours------WebKitFormBoundary7MA4YWxkTrZu0gW--",CURLOPT_HTTPHEADER=>array("Postman-Token: fae6714d-dc09-4e08-b50d-c97030603b61","cache-control: no-cache","content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"),));$response=curl_exec($curl);$err=curl_error($curl);curl_close($curl);if($err){echo"cURL Error #:".$err;}else{echo$response;}?>
//Complete API Libraries and Wrappers can be found here: //https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__javaOkHttpClientclient =newOkHttpClient();MediaTypemediaType =MediaType.parse("multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW");RequestBodybody =RequestBody.create(mediaType,"------WebKitFormBoundary7MA4YWxkTrZu0gWContent-Disposition: form-data; name="api_key"replacewithyours------WebKitFormBoundary7MA4YWxkTrZu0gWContent-Disposition: form-data; name="email_address_column"replacewithyours------WebKitFormBoundary7MA4YWxkTrZu0gW--");Requestrequest =newRequest.Builder().url("https://bulkapi.zerobounce.net/v2/sendfile").post(body).addHeader("content-type","multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW").addHeader("cache-control","no-cache").addHeader("Postman-Token","25d608ba-6cb5-4c8c-88d7-d47276c67d8e").build();Responseresponse =client.newCall(request).execute();
# Complete API Libraries and Wrappers can be found here: # https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__pythonimporthttp.client conn =http.client.HTTPConnection("bulkapi,zerobounce,net")payload ="------WebKitFormBoundary7MA4YWxkTrZu0gWContent-Disposition: form-data; name="api_key"replacewithyours------WebKitFormBoundary7MA4YWxkTrZu0gWContent-Disposition: form-data; name="email_address_column"replacewithyours------WebKitFormBoundary7MA4YWxkTrZu0gW--"headers ={'content-type':"multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",'cache-control':"no-cache",'Postman-Token':"bc455eda-9884-417e-b16f-3a5fef3f7540"}conn.request("POST","v2,sendfile",payload,headers)res =conn.getresponse()data =res.read()print(data.decode("utf-8"))
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__IOSimportFoundationletheaders =["content-type":"multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW","cache-control":"no-cache","Postman-Token":"2f68fcc3-d9b6-458b-b613-56f6a03e6617"]letparameters =[["name":"api_key","value":"replacewithyours"],["name":"email_address_column","value":"replacewithyours"]]letboundary ="----WebKitFormBoundary7MA4YWxkTrZu0gW"varbody =""varerror:NSError?=nilforparam inparameters {letparamName =param["name"]!body +="--(boundary)"body +="Content-Disposition:form-data; name="(paramName)""ifletfilename =param["fileName"]{letcontentType =param["content-type"]!letfileContent =String(contentsOfFile:filename,encoding:String.Encoding.utf8)if(error !=nil){print(error)}body +="; filename="(filename)""body +="Content-Type: (contentType)"body +=fileContent }elseifletparamValue =param["value"]{body +="(paramValue)"}}letrequest =NSMutableURLRequest(url:NSURL(string:"https://bulkapi.zerobounce.net/v2/sendfile")!asURL,cachePolicy:.useProtocolCachePolicy,timeoutInterval:10.0)request.httpMethod ="POST"request.allHTTPHeaderFields =headers request.httpBody =postData asDataletsession =URLSession.shared letdataTask =session.dataTask(with:request asURLRequest,completionHandler:{(data,response,error)->Voidinif(error !=nil){print(error)}else{lethttpResponse =response as?HTTPURLResponseprint(httpResponse)}})dataTask.resume()
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__IOS// Please select VB or C# language for Send File Sample#import <Foundation/Foundation.h>NSDictionary *headers =@{@"content-type":@"multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",@"cache-control":@"no-cache",@"Postman-Token":@"92c5b06e-624f-44e5-bd86-f537bc6cef67"};NSArray *parameters =@[@{@"name":@"api_key",@"value":@"replacewithyours"},@{@"name":@"email_address_column",@"value":@"replacewithyours"}];NSString *boundary =@"----WebKitFormBoundary7MA4YWxkTrZu0gW";NSError *error;NSMutableString *body =[NSMutableString string];for(NSDictionary *param inparameters){[body appendFormat:@"--%@",boundary];if(param[@"fileName"]){[body appendFormat:@"Content-Disposition:form-data; name="%@"; filename="%@"",param[@"name"],param[@"fileName"]];[body appendFormat:@"Content-Type: %@",param[@"contentType"]];[body appendFormat:@"%@",[NSString stringWithContentsOfFile:param[@"fileName"]encoding:NSUTF8StringEncoding error:&error]];if(error){NSLog(@"%@",error);}}else{[body appendFormat:@"Content-Disposition:form-data; name="%@"",param[@"name"]];[body appendFormat:@"%@",param[@"value"]];}}[body appendFormat:@"--%@--",boundary];NSData *postData =[body dataUsingEncoding:NSUTF8StringEncoding];NSMutableURLRequest *request =[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://bulkapi.zerobounce.net/v2/sendfile"]cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0];[request setHTTPMethod:@"POST"];[request setAllHTTPHeaderFields:headers];[request setHTTPBody:postData];NSURLSession *session =[NSURLSession sharedSession];NSURLSessionDataTask *dataTask =[session dataTaskWithRequest:request completionHandler:^(NSData *data,NSURLResponse *response,NSError *error){if(error){NSLog(@"%@",error);}else{NSHTTPURLResponse *httpResponse =(NSHTTPURLResponse *)response;NSLog(@"%@",httpResponse);}}];[dataTask resume];
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__android//N/A
Endpoint Response
Successful Response
{"success":true,"message":"File Accepted","file_name":"Your file name.csv","file_id":"aaaaaaaa-zzzz-xxxx-yyyy-5003727fffff"}
Error Response
{"success":false,"message":["Error messages"]}
The filestatus API returns the file processing status for the file been submitted using sendfile API. Please refer to the C# example for details.
GET /v2/filestatus
API URL: https://bulkapi.zerobounce.net/v2/filestatus
URL Parameters
- ParameterDescription
- api_keyYour API Key, found in your account.
- file_idThe returned file ID when calling sendfile API.
If you want to call the API from your browser to test it, all you have to do is to replace the API KEY with your key and the FILE ID with the returned file ID from sendfile API:
https://bulkapi.zerobounce.net/v2/filestatus?api_key=[replacewithyours]&file_id=[replacewithyours]
File Status Code Samples
' Complete API Libraries and Wrappers can be found here: ' https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_net' File Status Sample in VB.netPublicClassFileStatus PublicPropertysuccess AsBooleanPublicPropertyfile_id AsStringPublicPropertyfile_name AsStringPublicPropertyupload_date AsStringPublicPropertyfile_status AsStringPublicPropertycomplete_percentage AsStringPublicPropertyreturn_url AsStringEndClassPrivateSharedSubFileStatusAPITest()DimapiKey AsString="replace with your api key here"DimfileID AsString="replace with the returned file ID when calling sendfile API"TryDimfileStatus AsFileStatus =FileStatusAsync(apiKey,fileID).Result Console.Write(JsonConvert.SerializeObject(fileStatus,Formatting.Indented))Catchex AsException Console.Write(ex.InnerException.Message)EndTryConsole.ReadKey()EndSubPublicSharedAsync FunctionFileStatusAsync(ByValapiKey AsString,ByValfileID AsString)AsTask(OfFileStatus)IfString.IsNullOrEmpty(apiKey)ThenThrowNewException("Error: apiKey is required")IfString.IsNullOrEmpty(fileID)ThenThrowNewException("Error: fileID is required")Dimuri AsUri =NewUri($"https://bulkapi.zerobounce.net/v2/filestatus?api_key={apiKey}&file_id={fileID}")Usingclient =NewHttpClient()Usingrequest =NewHttpRequestMessage(HttpMethod.Get,uri)Usingresponse =Await client.SendAsync(request).ConfigureAwait(False)Dimcontent =Await response.Content.ReadAsStringAsync()Ifresponse.IsSuccessStatusCode =FalseThenDimerrorAsString=$"StatusCode ={CInt(response.StatusCode)},Content ={content}" ThrowNewException(error)EndIfReturnJsonConvert.DeserializeObject(OfFileStatus)(content)EndUsingEndUsingEndUsingEndFunction
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_net// https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__c-sharp// File Status Sample in C#publicclassFileStatus{publicboolsuccess {get;set;}publicstringfile_id {get;set;}publicstringfile_name {get;set;}publicstringupload_date {get;set;}publicstringfile_status {get;set;}publicstringcomplete_percentage {get;set;}publicstringreturn_url {get;set;}}privatestaticvoidFileStatusAPITest(){stringapiKey ="replace with your api key here";stringfileID ="replace with the returned file ID when calling sendfile API";try{FileStatusfileStatus =FileStatusAsync(apiKey,fileID).Result;Console.Write(JsonConvert.SerializeObject(fileStatus,Formatting.Indented));}catch(Exceptionex){Console.Write(ex.InnerException.Message);}Console.ReadKey();}publicstaticasyncTask<FileStatus>FileStatusAsync(stringapiKey,stringfileID){if(string.IsNullOrEmpty(apiKey))thrownewException("Error: apiKey is required");if(string.IsNullOrEmpty(fileID))thrownewException("Error: fileID is required");Uriuri =newUri($"https://bulkapi.zerobounce.net/v2/filestatus?api_key={apiKey}&file_id={fileID}");using(varclient =newHttpClient())using(varrequest =newHttpRequestMessage(HttpMethod.Get,uri))using(varresponse =awaitclient.SendAsync(request).ConfigureAwait(false)){varcontent =awaitresponse.Content.ReadAsStringAsync();if(response.IsSuccessStatusCode ==false){varerror =$"StatusCode={(int)response.StatusCode}, Content={content}";thrownewException(error);}returnJsonConvert.DeserializeObject<FileStatus>(content);}}
<?php// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__php$curl=curl_init();curl_setopt_array($curl,array(CURLOPT_URL=>"https://bulkapi.zerobounce.net/v2/filestatus?api_key=replacewithyours&file_id=replacewithyours",CURLOPT_RETURNTRANSFER=>true,CURLOPT_ENCODING=>"",CURLOPT_MAXREDIRS=>10,CURLOPT_TIMEOUT=>30,CURLOPT_HTTP_VERSION=>CURL_HTTP_VERSION_1_1,CURLOPT_CUSTOMREQUEST=>"GET",CURLOPT_POSTFIELDS=>"",CURLOPT_HTTPHEADER=>array("Postman-Token: 91504cea-f92f-46b0-97a4-338167072887","cache-control: no-cache"),));$response=curl_exec($curl);$err=curl_error($curl);curl_close($curl);if($err){echo"cURL Error #:".$err;}else{echo$response;}?>
//Complete API Libraries and Wrappers can be found here: //https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__javaOkHttpClientclient =newOkHttpClient();Requestrequest =newRequest.Builder().url("https://bulkapi.zerobounce.net/v2/filestatus?api_key=replacewithyours&file_id=replacewithyours").get().addHeader("cache-control","no-cache").addHeader("Postman-Token","7fffd7a4-b2fd-4e8b-ac85-4099411f27ce").build();Responseresponse =client.newCall(request).execute();
# Complete API Libraries and Wrappers can be found here: # https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__pythonimporthttp.client conn =http.client.HTTPConnection("bulkapi,zerobounce,net")payload =""headers ={'cache-control':"no-cache",'Postman-Token':"caa917fe-45ce-45ae-9456-2b039b999dcb"}conn.request("GET","v2,filestatus",payload,headers)res =conn.getresponse()data =res.read()print(data.decode("utf-8"))
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__IOS// Please select VB or C# language for File Status Sampleimport Foundationletheaders =["cache-control":"no-cache","Postman-Token":"4f1b92e2-034f-4fa0-94d9-b097d768668a"]letrequest =NSMutableURLRequest(url:NSURL(string:"https://bulkapi.zerobounce.net/v2/filestatus?api_key=replacewithyours&file_id=replacewithyours")!asURL,cachePolicy:.useProtocolCachePolicy,timeoutInterval:10.0)request.httpMethod ="GET"request.allHTTPHeaderFields =headers letsession =URLSession.shared letdataTask =session.dataTask(with:request asURLRequest,completionHandler:{(data,response,error)->Voidinif(error !=nil){print(error)}else{lethttpResponse =response as?HTTPURLResponseprint(httpResponse)}})dataTask.resume()
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__IOS#import<Foundation/Foundation.h>NSDictionary *headers =@{@"cache-control":@"no-cache",@"Postman-Token":@"5e9c24ae-b577-4e33-8748-83f14e151ae9"};NSMutableURLRequest *request =[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://bulkapi.zerobounce.net/v2/filestatus?api_key=replacewithyours&file_id=replacewithyours"]cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0];[request setHTTPMethod:@"GET"];[request setAllHTTPHeaderFields:headers];NSURLSession *session =[NSURLSession sharedSession];NSURLSessionDataTask *dataTask =[session dataTaskWithRequest:request completionHandler:^(NSData *data,NSURLResponse *response,NSError *error){if(error){NSLog(@"%@",error);}else{NSHTTPURLResponse *httpResponse =(NSHTTPURLResponse *)response;NSLog(@"%@",httpResponse);}}];[dataTask resume];
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__android// N/A
Endpoint Response
Successful Response
{"success":true,"file_id":"aaaaaaaa-zzzz-xxxx-yyyy-5003727fffff","file_name":"Your file name.csv","upload_date":"10/20/2018 4:35:58 PM","file_status":"Complete","complete_percentage":"100%","return_url":"Your return URL if provided when calling sendfile API"}
Error Response
{"success":false,"message":"Error messages"}
The getfile API allows users to get the validation results file for the file been submitted using sendfile API. Please refer to the C# example for details.
GET /v2/getfile
API URL: https://bulkapi.zerobounce.net/v2/getfile
URL Parameters
- ParameterDescription
- api_keyYour API Key, found in your account.
- file_idThe returned file ID when calling sendfile API.
If you want to call the API from your browser to test it, all you have to do is to replace the API KEY with your key and the FILE ID with the returned file ID from sendfileAPI:
https://bulkapi.zerobounce.net/v2/getfile?api_key=replacewithyours&file_id=[replacewithyours]
GetFile Code Samples
' Complete API Libraries and Wrappers can be found here: ' https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_net' Get File Sample in VB.netPrivateSharedSubGetFileAPITest()DimapiKey AsString="replace with your api key here"DimfileID AsString="replace with the returned file ID when calling sendfile API"Dimdir AsString="C:emp" TryDimfilePath =GetFileAsync(apiKey,fileID,dir).Result Console.Write($"File{filePath} retrieved successfully.")Catchex AsException Console.Write(ex.InnerException.Message)EndTryConsole.ReadKey()EndSubPublicSharedAsync FunctionGetFileAsync(ByValapiKey AsString,ByValfileID AsString,ByValdir AsString)AsTask(OfString)IfString.IsNullOrEmpty(apiKey)ThenThrowNewException("Error: apiKey is required")IfString.IsNullOrEmpty(fileID)ThenThrowNewException("Error: fileID is required")Dimuri AsUri =NewUri($"https://bulkapi.zerobounce.net/v2/getfile?api_key={apiKey}&file_id={fileID}")Usingclient =NewHttpClient()Usingrequest =NewHttpRequestMessage(HttpMethod.Get,uri)Usingresponse =Await client.SendAsync(request,HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(False)UsingstreamToReadFrom AsStream=Await response.Content.ReadAsStreamAsync()Ifresponse.IsSuccessStatusCode =FalseThenDim[error] =$"StatusCode ={CInt(response.StatusCode)},Content ={response.Content.ReadAsStringAsync().Result}" ThrowNewException([error])EndIfDimfilePath =Path.Combine(dir,response.Content.Headers.ContentDisposition.FileName)UsingstreamToWriteTo AsStream=File.Open(filePath,FileMode.Create)Await streamToReadFrom.CopyToAsync(streamToWriteTo)EndUsingReturnfilePath EndUsingEndUsingEndUsingEndUsingEndFunction
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_net// https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__c-sharp// Get File Sample in C#privatestaticvoidGetFileAPITest(){stringapiKey ="replace with your api key here";stringfileID ="replace with the returned file ID when calling sendfile API";stringdir =@"C:emp";// specify the directory where you want to save the results filetry{varfilePath =GetFileAsync(apiKey,fileID,dir).Result;Console.Write($"File{filePath} retrieved successfully.");}catch(Exceptionex){Console.Write(ex.InnerException.Message);}Console.ReadKey();}publicstaticasyncTask<string>GetFileAsync(stringapiKey,stringfileID,stringdir){if(string.IsNullOrEmpty(apiKey))thrownewException("Error: apiKey is required");if(string.IsNullOrEmpty(fileID))thrownewException("Error: fileID is required");Uriuri =newUri($"https://bulkapi.zerobounce.net/v2/getfile?api_key={apiKey}&file_id={fileID}");using(varclient =newHttpClient())using(varrequest =newHttpRequestMessage(HttpMethod.Get,uri))using(varresponse =awaitclient.SendAsync(request,HttpCompletionOption.ResponseHeadersRead).ConfigureAwait(false))using(StreamstreamToReadFrom =awaitresponse.Content.ReadAsStreamAsync()){if(response.IsSuccessStatusCode ==false){varerror =$"StatusCode={(int)response.StatusCode}, Content={response.Content.ReadAsStringAsync().Result}";thrownewException(error);}varfilePath =Path.Combine(dir,response.Content.Headers.ContentDisposition.FileName);using(StreamstreamToWriteTo =File.Open(filePath,FileMode.Create)){awaitstreamToReadFrom.CopyToAsync(streamToWriteTo);}returnfilePath;}}
<?php// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__php$request=newHttpRequest();$request->setUrl('https://bulkapi.zerobounce.net/v2/getfile');$request->setMethod(HTTP_METH_GET);$request->setQueryData(array('api_key'=>'replacewithyours','file_id'=>'replacewithyours'));$request->setHeaders(array('Postman-Token'=>'0a6c40b8-0cd4-4dbb-a57e-422558e7ab6a','cache-control'=>'no-cache'));try{$response=$request->send();echo$response->getBody();}catch(HttpException $ex){echo$ex;}?>
//Complete API Libraries and Wrappers can be found here: //https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__javaOkHttpClientclient =newOkHttpClient();Requestrequest =newRequest.Builder().url("https://bulkapi.zerobounce.net/v2/getfile?api_key=replacewithyours&file_id=replacewithyours").get().addHeader("cache-control","no-cache").addHeader("Postman-Token","d0b7d318-f3f6-47fb-842d-5622b26592c1").build();Responseresponse =client.newCall(request).execute();
# Complete API Libraries and Wrappers can be found here: # https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__pythonimporthttp.client conn =http.client.HTTPConnection("bulkapi,zerobounce,net")payload =""headers ={'cache-control':"no-cache",'Postman-Token':"9f615d7e-60af-4746-9bcc-317b1f80a6bb"}conn.request("GET","v2,getfile",payload,headers)res =conn.getresponse()data =res.read()print(data.decode("utf-8"))
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__IOSimportFoundationletheaders =["cache-control":"no-cache","Postman-Token":"6c8cb1cb-25ed-4e56-b4cb-65e949b8bdd1"]letrequest =NSMutableURLRequest(url:NSURL(string:"https://bulkapi.zerobounce.net/v2/getfile?api_key=replacewithyours&file_id=replacewithyours")!asURL,cachePolicy:.useProtocolCachePolicy,timeoutInterval:10.0)request.httpMethod ="GET"request.allHTTPHeaderFields =headers letsession =URLSession.shared
letdataTask =session.dataTask(with:request asURLRequest,completionHandler:{(data,response,error)->Voidinif(error !=nil){print(error)}else{lethttpResponse =response as?HTTPURLResponseprint(httpResponse)}})dataTask.resume()
Endpoint Response
Successful Response
//N/A
The getfile API returns the validation results file. The returned content type is "application/octet-stream". You can get the file name from response.Content.Headers.ContentDisposition.FileName. If you are calling the API directly from the browser, you can either save or open the results file from the browser.
Error Response
{"success":false,"message":"Error messages"}
The deletefile API deletes the file that was submitted using sendfileAPI. File can be deleted only when its status is Complete.
POST /v2/deletefile
API URL: https://bulkapi.zerobounce.net/v2/deletefile
URL Parameters
- ParameterDescription
- api_keyYour API Key, found in your account.
- file_idThe returned file ID when calling sendfile API.
Delete File Code Samples
' Complete API Libraries and Wrappers can be found here: ' https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_net' Delete File Sample in VB.netPublicClassResponseResult PublicPropertysuccess AsBooleanPublicPropertymessage AsStringPublicPropertyfile_id AsStringPublicPropertyfile_name AsStringEndClassPrivateSharedSubDeleteFileAPITest()DimapiKey AsString="replace with your api key here"DimfileID AsString="replace with the returned file ID when calling sendfile API"TryDimresponseResult AsResponseResult =DeleteFileAsync(apiKey,fileID).Result Console.Write(JsonConvert.SerializeObject(responseResult,Formatting.Indented))Catchex AsException Console.Write(ex.InnerException.Message)EndTryConsole.ReadKey()EndSubPublicSharedAsync FunctionDeleteFileAsync(ByValapiKey AsString,ByValfileID AsString)AsTask(OfResponseResult)IfString.IsNullOrEmpty(apiKey)ThenThrowNewException("Error: apiKey is required")IfString.IsNullOrEmpty(fileID)ThenThrowNewException("Error: fileID is required")Dimuri AsUri =NewUri($"https://bulkapi.zerobounce.net/v2/deletefile?api_key={apiKey}&file_id={fileID}")Usingclient =NewHttpClient()Usingrequest =NewHttpRequestMessage(HttpMethod.[Get],uri)Usingresponse =Await client.SendAsync(request).ConfigureAwait(False)Dimcontent =Await response.Content.ReadAsStringAsync()Ifresponse.IsSuccessStatusCode =FalseThenDim[error] =$"StatusCode ={CInt(response.StatusCode)},Content ={content}" ThrowNewException([error])EndIfReturnJsonConvert.DeserializeObject(OfResponseResult)(content)EndUsingEndUsingEndUsingEndFunction
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__dot_net// https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__c-sharp// Delete File Sample in C#publicclassResponseResult{publicboolsuccess {get;set;}publicstringmessage {get;set;}publicstringfile_id {get;set;}publicstringfile_name {get;set;}}privatestaticvoidDeleteFileAPITest(){stringapiKey ="replace with your api key here";stringfileID ="replace with the returned file ID when calling sendfile API";try{ResponseResultresponseResult =DeleteFileAsync(apiKey,fileID).Result;Console.Write(JsonConvert.SerializeObject(responseResult,Formatting.Indented));}catch(Exceptionex){Console.Write(ex.InnerException.Message);}Console.ReadKey();}publicstaticasyncTask<ResponseResult>DeleteFileAsync(stringapiKey,stringfileID){if(string.IsNullOrEmpty(apiKey))thrownewException("Error: apiKey is required");if(string.IsNullOrEmpty(fileID))thrownewException("Error: fileID is required");Uriuri =newUri($"https://bulkapi.zerobounce.net/v2/deletefile?api_key={apiKey}&file_id={fileID}");using(varclient =newHttpClient())using(varrequest =newHttpRequestMessage(HttpMethod.Get,uri))using(varresponse =awaitclient.SendAsync(request).ConfigureAwait(false)){varcontent =awaitresponse.Content.ReadAsStringAsync();if(response.IsSuccessStatusCode ==false){varerror =$"StatusCode={(int)response.StatusCode}, Content={content}";thrownewException(error);}returnJsonConvert.DeserializeObject<ResponseResult>(content);}}
<?php// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__php$curl=curl_init();curl_setopt_array($curl,array(CURLOPT_URL=>"https://bulkapi.zerobounce.net/v2/deletefile?api_key=replacewithyours&file_id=replacewithyours",CURLOPT_RETURNTRANSFER=>true,CURLOPT_ENCODING=>"",CURLOPT_MAXREDIRS=>10,CURLOPT_TIMEOUT=>30,CURLOPT_HTTP_VERSION=>CURL_HTTP_VERSION_1_1,CURLOPT_CUSTOMREQUEST=>"GET",CURLOPT_POSTFIELDS=>"",CURLOPT_HTTPHEADER=>array("Postman-Token: 91504cea-f92f-46b0-97a4-338167072887","cache-control: no-cache"),));$response=curl_exec($curl);$err=curl_error($curl);curl_close($curl);if($err){echo"cURL Error #:".$err;}else{echo$response;}?>
//Complete API Libraries and Wrappers can be found here: //https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__javaOkHttpClientclient =newOkHttpClient();Requestrequest =newRequest.Builder().url("https://bulkapi.zerobounce.net/v2/deletefile?api_key=replacewithyours&file_id=replacewithyours").get().addHeader("cache-control","no-cache").addHeader("Postman-Token","7fffd7a4-b2fd-4e8b-ac85-4099411f27ce").build();Responseresponse =client.newCall(request).execute();
# Complete API Libraries and Wrappers can be found here: # https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__pythonimporthttp.client conn =http.client.HTTPConnection("bulkapi,zerobounce,net")payload =""headers ={'cache-control':"no-cache",'Postman-Token':"caa917fe-45ce-45ae-9456-2b039b999dcb"}conn.request("GET","v2,deletefile",payload,headers)res =conn.getresponse()data =res.read()print(data.decode("utf-8"))
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__IOS// Please select VB or C# language for File Status Sampleimport Foundationletheaders =["cache-control":"no-cache","Postman-Token":"4f1b92e2-034f-4fa0-94d9-b097d768668a"]letrequest =NSMutableURLRequest(url:NSURL(string:"https://bulkapi.zerobounce.net/v2/deletefile?api_key=replacewithyours&file_id=replacewithyours")!asURL,cachePolicy:.useProtocolCachePolicy,timeoutInterval:10.0)request.httpMethod ="GET"request.allHTTPHeaderFields =headers letsession =URLSession.shared
letdataTask =session.dataTask(with:request asURLRequest,completionHandler:{(data,response,error)->Voidinif(error !=nil){print(error)}else{lethttpResponse =response as?HTTPURLResponseprint(httpResponse)}})dataTask.resume()
// Complete API Libraries and Wrappers can be found here: // https://www.zerobounce.net/docs/zerobounce-api-wrappers/#api_wrappers__v2__IOS#import<Foundation/Foundation.h>NSDictionary *headers =@{@"cache-control":@"no-cache",@"Postman-Token":@"5e9c24ae-b577-4e33-8748-83f14e151ae9"};NSMutableURLRequest *request =[NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://bulkapi.zerobounce.net/v2/deletefile?api_key=replacewithyours&file_id=replacewithyours"]cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:10.0];[request setHTTPMethod:@"GET"];[request setAllHTTPHeaderFields:headers];NSURLSession *session =[NSURLSession sharedSession];NSURLSessionDataTask *dataTask =[session dataTaskWithRequest:request completionHandler:^(NSData *data,NSURLResponse *response,NSError *error){if(error){NSLog(@"%@",error);}else{NSHTTPURLResponse *httpResponse =(NSHTTPURLResponse *)response;NSLog(@"%@",httpResponse);}}];[dataTask resume];
Endpoint Response
Successful Response
{"success":true,"message":"File Deleted","file_name":"test2","file_id":"b222a0fd-90d5-416c-8f1a-9cc3851fc823"}
Error Response
{"success":false,"message":"File cannot be found."}