domain/get-dns-records

In order to send emails, you have to confirm that you own the domain that you are going to send emails from and setup DKIM signature for the domain. This method allows you to register your domain in UniOne and generate verification record and DKIM key, or return previously generated ones if domain is already registered.

Test request

POST /en/transactional/api/v1/domain/get-dns-records.json
{
  "api_key": "apiKey",
  "domain": "qqq.com"
}

Success response example


{
  "status": "success",
  "domain": "qqq.com",
  "verification-record": "unione-validate-hash=483bb362ebdbeedd755cfb1d4d661",
  "dkim": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDo7"
}

Request parameters

Name Type Description
api_key Mandatory string User API key
domain Mandatory string Domain to confirm

 

Success response fields

Name Type Description
status Mandatory string Contains "success" value
domain Mandatory string Domain that has been verified
verification-record Mandatory string Record to verify ownership of this domain
dkim Mandatory string DKIM signature for this domain

 

You should add then DNS records like this to all of the domains you want to confirm:

qqq.com.               IN TXT "unione-validate-hash=483bb362ebdbeedd755cfb1d4d661"
us._domainkey.qqq.com. IN TXT "k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDo7"
qqq.com.               IN TXT  "v=spf1 include:spf.unione.io ~all"

Where:

  • First record value should contain "verification-record" field returned by get-dns-records method "as is".
  • Second record value should contain "dkim" field value after "p=". Mind the name of this record! "us._domainkey." prefix is important for DKIM selector of UniOne to work properly.
  • Third record contains optional, but very recommended SPF entry. Probably you already have one, then just add append include:spf.unione.io right after v=spf1.

 

Error response fields

status - "error" string

message - human readable error message in English

code - one of the generic error codes or error code from the table below:

Code Meaning How to fix
1100 Missing domain name Specify the domain to be verified
1101 Invalid domain value Please enter a valid domain value