Batch Email Verification API

HTTP | C | cURL | C# | GO | JAVA | JavaScript | NodeJS | Objective-C

OCaml | PHP | Python | Ruby | Shell | Swift

Alternatively, you can find the sample code on our GitHub Account.

.

HTTP

POST /batch_process/ HTTP/1.1
Host: api.evasrv.com
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded

user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https%3A%2F%2Fwww.domain.com%2Fmy-mailing-list.csv

↑ Top

C

CURL *hnd = curl_easy_init();

curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://api.evasrv.com/batch_process/");

struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/x-www-form-urlencoded");
headers = curl_slist_append(headers, "cache-control: no-cache");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);

curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https%3A%2F%2Fwww.domain.com%2Fmy-mailing-list.csv");

CURLcode ret = curl_easy_perform(hnd);

↑ Top

cURL

curl -X POST -H "Cache-Control: no-cache" -H "Content-Type: application/x-www-form-urlencoded" -d 'user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https://www.domain.com/my-mailing-list.csv' "https://api.evasrv.com/batch_process/"

↑ Top

C#

var client = new RestClient("https://api.evasrv.com/batch_process/");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddHeader("cache-control", "no-cache");
request.AddParameter("application/x-www-form-urlencoded", "user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https%3A%2F%2Fwww.domain.com%2Fmy-mailing-list.csv", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

↑ Top

GO

package main

import (
 "fmt"
 "strings"
 "net/http"
 "io/ioutil"
)

func main() {

 url := "https://api.evasrv.com/batch_process/"

 payload := strings.NewReader("user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https%3A%2F%2Fwww.domain.com%2Fmy-mailing-list.csv")

 req, _ := http.NewRequest("POST", url, payload)

 req.Header.Add("cache-control", "no-cache")
 req.Header.Add("content-type", "application/x-www-form-urlencoded")

 res, _ := http.DefaultClient.Do(req)

 defer res.Body.Close()
 body, _ := ioutil.ReadAll(res.Body)

 fmt.Println(res)
 fmt.Println(string(body))

}

↑ Top

JAVA: OK HTTP

OkHttpClient client = new OkHttpClient();

MediaType mediaType = MediaType.parse("application/x-www-form-urlencoded");
RequestBody body = RequestBody.create(mediaType, "user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https%3A%2F%2Fwww.domain.com%2Fmy-mailing-list.csv");
Request request = new Request.Builder()
 .url("https://api.evasrv.com/batch_process/")
 .post(body)
 .addHeader("cache-control", "no-cache")
 .addHeader("content-type", "application/x-www-form-urlencoded")
 .build();

Response response = client.newCall(request).execute();

 JAVA: UniRest

HttpResponse<String> response = Unirest.post("https://api.evasrv.com/batch_process/")
 .header("cache-control", "no-cache")
 .header("content-type", "application/x-www-form-urlencoded")
 .body("user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https%3A%2F%2Fwww.domain.com%2Fmy-mailing-list.csv")
 .asString();

↑ Top

JavaScript: JQuery AJAX

var settings = {
 "async": true,
 "crossDomain": true,
 "url": "https://api.evasrv.com/batch_process/",
 "method": "POST",
 "headers": {
 "cache-control": "no-cache",
 "content-type": "application/x-www-form-urlencoded"
 },
 "data": {
 "user_API_token": "YOUR-EV-API-TOKEN",
 "role_address": "true",
 "bad_address": "true",
 "free_email": "true",
 "disposable": "true",
 "typo_suggest": "true",
 "source_file": "https://www.domain.com/my-mailing-list.csv"
 }
}

$.ajax(settings).done(function (response) {
 console.log(response);
});

↑ Top

 JavaScript: XHR

var data = "user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https%3A%2F%2Fwww.domain.com%2Fmy-mailing-list.csv";

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
 if (this.readyState === 4) {
 console.log(this.responseText);
 }
});

xhr.open("POST", "https://api.evasrv.com/batch_process/");
xhr.setRequestHeader("cache-control", "no-cache");
xhr.setRequestHeader("content-type", "application/x-www-form-urlencoded");

xhr.send(data);

↑ Top

NodeJS: Native

var qs = require("querystring");
var http = require("https");

var options = {
 "method": "POST",
 "hostname": "api.evasrv.com",
 "port": null,
 "path": "/batch_process/",
 "headers": {
 "cache-control": "no-cache",
 "content-type": "application/x-www-form-urlencoded"
 }
};

var req = http.request(options, function (res) {
 var chunks = [];

 res.on("data", function (chunk) {
 chunks.push(chunk);
 });

 res.on("end", function () {
 var body = Buffer.concat(chunks);
 console.log(body.toString());
 });
});

req.write(qs.stringify({ user_API_token: 'YOUR-EV-API-TOKEN',
 role_address: 'true',
 bad_address: 'true',
 free_email: 'true',
 disposable: 'true',
 typo_suggest: 'true',
 source_file: 'https://www.domain.com/my-mailing-list.csv' }));
req.end();

↑ Top

 NodeJS: Request

var request = require("request");

var options = { method: 'POST',
 url: 'https://api.evasrv.com/batch_process/',
 headers: 
 { 'content-type': 'application/x-www-form-urlencoded',
 'cache-control': 'no-cache' },
 form: 
 { user_API_token: 'YOUR-EV-API-TOKEN',
 role_address: 'true',
 bad_address: 'true',
 free_email: 'true',
 disposable: 'true',
 typo_suggest: 'true',
 source_file: 'https://www.domain.com/my-mailing-list.csv' } };

request(options, function (error, response, body) {
 if (error) throw new Error(error);

 console.log(body);
});

↑ Top

 NodeJS: UniRest

var unirest = require("unirest");

var req = unirest("POST", "https://api.evasrv.com/batch_process/");

req.headers({
 "content-type": "application/x-www-form-urlencoded",
 "cache-control": "no-cache"
});

req.form({
 "user_API_token": "YOUR-EV-API-TOKEN",
 "role_address": "true",
 "bad_address": "true",
 "free_email": "true",
 "disposable": "true",
 "typo_suggest": "true",
 "source_file": "https://www.domain.com/my-mailing-list.csv"
});

req.end(function (res) {
 if (res.error) throw new Error(res.error);

 console.log(res.body);
});

↑ Top

Objective-C: NSURL

#import <Foundation/Foundation.h>

NSDictionary *headers = @{ @"cache-control": @"no-cache",
 @"content-type": @"application/x-www-form-urlencoded" };

NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"user_API_token=YOUR-EV-API-TOKEN" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&role_address=true" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&bad_address=true" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&free_email=true" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&disposable=true" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&typo_suggest=true" dataUsingEncoding:NSUTF8StringEncoding]];
[postData appendData:[@"&source_file=https://www.domain.com/my-mailing-list.csv" dataUsingEncoding:NSUTF8StringEncoding]];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://api.evasrv.com/batch_process/"]
 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];

↑ Top

OCaml: CoHTTP

open Cohttp_lwt_unix
open Cohttp
open Lwt

let uri = Uri.of_string "https://api.evasrv.com/batch_process/" in
let headers = Header.init ()
 |> fun h -> Header.add h "cache-control" "no-cache"
 |> fun h -> Header.add h "content-type" "application/x-www-form-urlencoded"
in
let body = Cohttp_lwt_body.of_string "user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https%3A%2F%2Fwww.domain.com%2Fmy-mailing-list.csv" in

Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
 (* Do stuff with the result *)

↑ Top

PHP: HTTP v1

<?php

$request = new HttpRequest();
$request->setUrl('https://api.evasrv.com/batch_process/');
$request->setMethod(HTTP_METH_POST);

$request->setHeaders(array(
 'content-type' => 'application/x-www-form-urlencoded',
 'cache-control' => 'no-cache'
));

$request->setContentType('application/x-www-form-urlencoded');
$request->setPostFields(array(
 'user_API_token' => 'YOUR-EV-API-TOKEN',
 'role_address' => 'true',
 'bad_address' => 'true',
 'free_email' => 'true',
 'disposable' => 'true',
 'typo_suggest' => 'true',
 'source_file' => 'https://www.domain.com/my-mailing-list.csv'
));

try {
 $response = $request->send();

 echo $response->getBody();
} catch (HttpException $ex) {
 echo $ex;
}

 PHP: HTTP v2

<?php

$client = new http\Client;
$request = new http\Client\Request;

$body = new http\Message\Body;
$body->append(new http\QueryString(array(
 'user_API_token' => 'YOUR-EV-API-TOKEN',
 'role_address' => 'true',
 'bad_address' => 'true',
 'free_email' => 'true',
 'disposable' => 'true',
 'typo_suggest' => 'true',
 'source_file' => 'https://www.domain.com/my-mailing-list.csv'
)));

$request->setRequestUrl('https://api.evasrv.com/batch_process/');
$request->setRequestMethod('POST');
$request->setBody($body);

$request->setHeaders(array(
 'content-type' => 'application/x-www-form-urlencoded',
 'cache-control' => 'no-cache'
));

$client->enqueue($request)->send();
$response = $client->getResponse();

echo $response->getBody();

 PHP: CURL

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
 CURLOPT_URL => "https://api.evasrv.com/batch_process/",
 CURLOPT_RETURNTRANSFER => true,
 CURLOPT_ENCODING => "",
 CURLOPT_MAXREDIRS => 10,
 CURLOPT_TIMEOUT => 30,
 CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
 CURLOPT_CUSTOMREQUEST => "POST",
 CURLOPT_POSTFIELDS => "user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https%3A%2F%2Fwww.domain.com%2Fmy-mailing-list.csv",
 CURLOPT_HTTPHEADER => array(
 "cache-control: no-cache",
 "content-type: application/x-www-form-urlencoded"
 ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
 echo "cURL Error #:" . $err;
} else {
 echo $response;
}

↑ Top

Python: Python3

import http.client

conn = http.client.HTTPSConnection("api.evasrv.com")

payload = "user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https%3A%2F%2Fwww.domain.com%2Fmy-mailing-list.csv"

headers = {
 'cache-control': "no-cache",
 'content-type': "application/x-www-form-urlencoded"
 }

conn.request("POST", "/batch_process/", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))

 Python: Requests

import requests

url = "https://api.evasrv.com/batch_process/"

payload = "user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https%3A%2F%2Fwww.domain.com%2Fmy-mailing-list.csv"
headers = {
 'cache-control': "no-cache",
 'content-type': "application/x-www-form-urlencoded"
 }

response = requests.request("POST", url, data=payload, headers=headers)

print(response.text)

↑ Top

Ruby

require 'uri'
require 'net/http'

url = URI("https://api.evasrv.com/batch_process/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["cache-control"] = 'no-cache'
request["content-type"] = 'application/x-www-form-urlencoded'
request.body = "user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https%3A%2F%2Fwww.domain.com%2Fmy-mailing-list.csv"

response = http.request(request)
puts response.read_body

↑ Top

Shell: Wget

wget --quiet \
 --method POST \
 --header 'cache-control: no-cache' \
 --header 'content-type: application/x-www-form-urlencoded' \
 --body-data 'user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https%3A%2F%2Fwww.domain.com%2Fmy-mailing-list.csv' \
 --output-document \
 - https://api.evasrv.com/batch_process/

 Shell: HTTPie

http --form POST https://api.evasrv.com/batch_process/ \
 cache-control:no-cache \
 content-type:application/x-www-form-urlencoded \
 user_API_token=YOUR-EV-API-TOKEN \
 role_address=true \
 bad_address=true \
 free_email=true \
 disposable=true \
 typo_suggest=true \
 source_file=https://www.domain.com/my-mailing-list.csv

 Shell: CURL

curl --request POST \
 --url https://api.evasrv.com/batch_process/ \
 --header 'cache-control: no-cache' \
 --header 'content-type: application/x-www-form-urlencoded' \
 --data 'user_API_token=YOUR-EV-API-TOKEN&role_address=true&bad_address=true&free_email=true&disposable=true&typo_suggest=true&source_file=https%3A%2F%2Fwww.domain.com%2Fmy-mailing-list.csv'

↑ Top

Swift

import Foundation

let headers = [
 "cache-control": "no-cache",
 "content-type": "application/x-www-form-urlencoded"
]

let postData = NSMutableData(data: "user_API_token=YOUR-EV-API-TOKEN".data(using: String.Encoding.utf8)!)
postData.append("&role_address=true".data(using: String.Encoding.utf8)!)
postData.append("&bad_address=true".data(using: String.Encoding.utf8)!)
postData.append("&free_email=true".data(using: String.Encoding.utf8)!)
postData.append("&disposable=true".data(using: String.Encoding.utf8)!)
postData.append("&typo_suggest=true".data(using: String.Encoding.utf8)!)
postData.append("&source_file=https://www.domain.com/my-mailing-list.csv".data(using: String.Encoding.utf8)!)

let request = NSMutableURLRequest(url: NSURL(string: "https://api.evasrv.com/batch_process/")! as URL,
 cachePolicy: .useProtocolCachePolicy,
 timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
 if (error != nil) {
 print(error)
 } else {
 let httpResponse = response as? HTTPURLResponse
 print(httpResponse)
 }
})

dataTask.resume()

↑ Top

<< Back to Batch Email Verification API for Developers