const response = await fetch('https://api.emailit.com/v2/email-verifications', {
method: 'POST',
headers: {
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'uzivatel@priklad.cz',
mode: 'full'
})
});
const result = await response.json();
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://api.emailit.com/v2/email-verifications',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode([
'email' => 'uzivatel@priklad.cz',
'mode' => 'full'
]),
CURLOPT_HTTPHEADER => [
'Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type: application/json'
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL chyba #:" . $err;
} else {
$result = json_decode($response, true);
print_r($result);
}
import requests
response = requests.post(
'https://api.emailit.com/v2/email-verifications',
headers={
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
},
json={
'email': 'uzivatel@priklad.cz',
'mode': 'full'
}
)
result = response.json()
print(result)
require 'net/http'
require 'json'
uri = URI('https://api.emailit.com/v2/email-verifications')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Authorization'] = 'Bearer em_test_51RxCWJ...vS00p61e0qRE'
request['Content-Type'] = 'application/json'
request.body = {
email: 'uzivatel@priklad.cz',
mode: 'full'
}.to_json
response = http.request(request)
result = JSON.parse(response.body)
puts result
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
url := "https://api.emailit.com/v2/email-verifications"
data := map[string]interface{}{
"email": "uzivatel@priklad.cz",
"mode": "full",
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println(result)
}
use reqwest;
use serde_json::{json, Value};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::new();
let response = client
.post("https://api.emailit.com/v2/email-verifications")
.header("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
.header("Content-Type", "application/json")
.json(&json!({
"email": "uzivatel@priklad.cz",
"mode": "full"
}))
.send()
.await?;
let result: Value = response.json().await?;
println!("{:?}", result);
Ok(())
}
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.net.http.HttpRequest.BodyPublishers;
public class VerifyEmail {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
String jsonBody = """
{
"email": "uzivatel@priklad.cz",
"mode": "full"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.emailit.com/v2/email-verifications"))
.header("Authorization", "Bearer em_test_51RxCWJ...vS00p61e0qRE")
.header("Content-Type", "application/json")
.POST(BodyPublishers.ofString(jsonBody))
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
public class VerifyEmail
{
public static async Task Main()
{
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Add("Authorization",
"Bearer em_test_51RxCWJ...vS00p61e0qRE");
var data = new {
email = "uzivatel@priklad.cz",
mode = "full"
};
var json = JsonConvert.SerializeObject(data);
var content = new StringContent(json, Encoding.UTF8, "application/json");
var response = await client.PostAsync(
"https://api.emailit.com/v2/email-verifications", content);
var result = await response.Content.ReadAsStringAsync();
Console.WriteLine(result);
}
}
}
curl -X POST https://api.emailit.com/v2/email-verifications \
-H "Authorization: Bearer em_test_51RxCWJ...vS00p61e0qRE" \
-H "Content-Type: application/json" \
-d '{
"email": "uzivatel@priklad.cz",
"mode": "full"
}'
Ověření jedné e-mailové adresy
const response = await fetch('https://api.emailit.com/v2/email-verifications', {
method: 'POST',
headers: {
'Authorization': 'Bearer em_test_51RxCWJ...vS00p61e0qRE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
email: 'uzivatel@priklad.cz',
mode: 'full'
})
});
const result = await response.json();
{
"id": "ev_abc123xyz",
"email": "uzivatel@priklad.cz",
"status": "completed",
"score": 100,
"risk": "low",
"result": "safe",
"mode": "full",
"checks": {
"valid_syntax": true,
"disposable": false,
"role_account": false,
"inbox_full": false,
"deliverable": true,
"disabled": false,
"free_email": false,
"gibberish": false,
"catch_all": false,
"smtp_connect": true,
"has_mx_records": true,
"domain_age": 5840
},
"address": {
"mailbox": "uzivatel",
"domain": "priklad.cz",
"suffix": null,
"root": "uzivatel@priklad.cz"
},
"did_you_mean": null,
"mx_records": [
{
"priority": 10,
"exchange": "mail.priklad.cz"
}
]
}
{
"statusCode": 400,
"error": "Bad Request",
"message": "Neplatný formát e-mailu"
}
{
"statusCode": 402,
"error": "Payment Required",
"message": "Nedostatek kreditů pro ověření e-mailu"
}
Odpovědi
{
"id": "ev_abc123xyz",
"email": "uzivatel@priklad.cz",
"status": "completed",
"score": 100,
"risk": "low",
"result": "safe",
"mode": "full",
"checks": {
"valid_syntax": true,
"disposable": false,
"role_account": false,
"inbox_full": false,
"deliverable": true,
"disabled": false,
"free_email": false,
"gibberish": false,
"catch_all": false,
"smtp_connect": true,
"has_mx_records": true,
"domain_age": 5840
},
"address": {
"mailbox": "uzivatel",
"domain": "priklad.cz",
"suffix": null,
"root": "uzivatel@priklad.cz"
},
"did_you_mean": null,
"mx_records": [
{
"priority": 10,
"exchange": "mail.priklad.cz"
}
]
}