Verify email domain
Reads the email domain from the e-mail provider of Aira and, unless the provider reports the domain and each of its DNS records verified, asks the provider to look for the DNS records again. Stores and returns the status and the DNS records that the provider reports. The provider reports the email domain pending while it checks, and Aira stores the final status when the provider reports it.
Requires the role dunning:write.
curl --request POST \
--url https://api.useaira.com/v1/email-domains/{id}/verify \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.useaira.com/v1/email-domains/{id}/verify"
headers = {"X-API-KEY": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.useaira.com/v1/email-domains/{id}/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.useaira.com/v1/email-domains/{id}/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.useaira.com/v1/email-domains/{id}/verify"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.useaira.com/v1/email-domains/{id}/verify")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useaira.com/v1/email-domains/{id}/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"domain": "acme.com",
"status": "not_started",
"dnsRecords": [
{
"record": "DKIM",
"type": "TXT",
"name": "mail._domainkey",
"value": "p=dkim-public-key",
"ttl": "Auto",
"priority": 123,
"status": "not_started"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Response
An email domain: a domain of the tenant, registered with the e-mail provider of Aira, that the invoice deliveries of the tenant go out from while the provider reports it verified or partially verified. A tenant has zero or one.
The verification status that the e-mail provider of Aira last reported. The invoice deliveries go out from the from e-mail of the tenant only while the email domain is verified or partially_verified.
not_started, pending, verified, failed, temporary_failure, partially_verified, partially_failed, unrecognized curl --request POST \
--url https://api.useaira.com/v1/email-domains/{id}/verify \
--header 'X-API-KEY: <api-key>'import requests
url = "https://api.useaira.com/v1/email-domains/{id}/verify"
headers = {"X-API-KEY": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'X-API-KEY': '<api-key>'}};
fetch('https://api.useaira.com/v1/email-domains/{id}/verify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.useaira.com/v1/email-domains/{id}/verify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.useaira.com/v1/email-domains/{id}/verify"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-API-KEY", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.useaira.com/v1/email-domains/{id}/verify")
.header("X-API-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.useaira.com/v1/email-domains/{id}/verify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"domain": "acme.com",
"status": "not_started",
"dnsRecords": [
{
"record": "DKIM",
"type": "TXT",
"name": "mail._domainkey",
"value": "p=dkim-public-key",
"ttl": "Auto",
"priority": 123,
"status": "not_started"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}