Validate email addresses

Resource

https://api.infobip.com/email/2/validation

parameters

Body Params

Property name Type Description
to string Destination email address to validate.

Request Example

					curl -X POST \
  https://api.infobip.com/email/2/validation \
  -H 'authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==' \
  -H 'content-type: application/json' \
  -d '{"to":"john.smith@somedomain.com"}'
					
				
					POST /email/2/validation HTTP/1.1
Host: api.infobip.com
Authorization:Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
Content-Type: application/json

{"to":"john.smith@somedomain.com" }
					
				
					<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.infobip.com/email/2/validation",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "{ \"to\":\"john.smith@somedomain.com\"}",
  CURLOPT_HTTPHEADER => array(
    "authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==",
    "content-type: application/json"
  ),
));

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

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
					
				
					var data = JSON.stringify({"to": "john.smith@somedomain.com"});

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

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

xhr.open("POST", "https://api.infobip.com/email/2/validation");
xhr.setRequestHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
xhr.setRequestHeader("content-type", "application/json");

xhr.send(data);
					
				
					HttpResponse<String> response = Unirest.post("https://api.infobip.com/email/2/validation")
  .header("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==")
  .header("content-type", "application/json")
  .body("{\"to\":\"john.smith@somedomain.com\"}")
  .asString();
					
				
					var client = new RestClient("https://api.infobip.com/email/2/validation");

var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/json");
request.AddHeader("authorization", "Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==");
request.AddParameter("application/json", "{ \"to\":\"john.smith@somedomain.com\"}", ParameterType.RequestBody);

IRestResponse response = client.Execute(request);
					
				

Response

					{
	 "to": "john.smith@somedomain.com",
   "validMailbox": "true",
   "validSyntax": true,
   "didYouMean": null,
   "disposable": false,
   "roleBased": false
}