2.4.2 Domain Reselling: EMAIL API

Automated domain management using the EMAIL API within the framework of the domain reseller program is carried out using the exchange of emails in a special format. Each email sent by the reseller must contain a detailed description of the required action with domain names. Within a few minutes, the reseller receives a response with the status of completing the task.

Technical requirements for correct operation of the EMAIL API:

  • EMAIL API is available only to clients who have received domain name reseller status
  • Reseller emails must be sent in text mode without HTML formatting
  • Email commands are accepted and processed exclusively when received from the mailbox associated with the reseller account in personal account.
  • The EMAIL API mail gateway is the mailbox autoreg@thehost.net.ua. This is where the reseller’s email commands should be sent.

List of main variables:

  • $CLID - Client code received in the personal account section Client -> Personal account information.
  • $ACID - Account code in the TheHost Domains Reselling project, obtained in the personal account section Client -> Personal account information.

Response codes:

  • OK - Command executed successfully
  • ERROR: Domain status doesn’t allow requested operation - The current status of the domain name in the domain name registry does not allow the requested operation.
  • ERROR: Insufficient funds - There are not enough funds to complete the requested operation.
  • ERROR: Incorrect transfer code - Invalid domain name transfer code.
  • ERROR: Incorrect CLID/ACID - Incorrect CLID/ACID data.
  • ERROR: Premium or reserved domain - The requested domain is premium or reserved by the domain zone administration.
  • ERROR: Incorrect data - An error was detected in the letter sent to perform an operation with a domain name.

Changing domain nameservers (NS)

Request Example:

EMAIL Heading:

%NSUPDATE DOMAIN%

EMAIL BODY:

DOMAIN=$DOMAIN_NAME
NS0=$NS0
NS1=$NS1
NS2=$NS2
NS3=$NS3
CLID=$CLID
ACID=$ACID

Query variables:

  • $DOMAIN_NAME - Contact name.
  • $NS0 - DNS server of domain No. 1.
  • $NS1 - DNS server of domain No. 2.
  • $NS2- DNS server of domain No. 3 (optional).
  • $NS3 - DNS server of domain No. 4 (optional).

Register a domain with a new contact

Request Example:

EMAIL Header:

%CREATE DOMAIN%

EMAIL BODY:

DOMAIN=$DOMAIN_NAME 
PERIOD=$REGISTRATION_PERIOD
NS0=$NS0
NS1=$NS1 
NS2=$NS2
NS3=$NS3
CONTACT_NAME=$CONTACT_NAME 
CONTACT_FIRSTNAME=$FIRSTNAME
CONTACT_LASTNAME=$LASTNAME
CONTACT_COMPANY=$COMPANY
CONTACT_EMAIL=$EMAIL
CONTACT_PHONE=$PHONE
CONTACT_FAX=  
CONTACT_COUNTRY=$LA_COUNTRY
CONTACT_STATE=$LA_STATE
CONTACT_POSTCODE=$LA_POSTCODE
CONTACT_CITY=$LA_POSTCODE
CONTACT_ADDRESS=$LA_ADDRESS
CLID=$CLID  
ACID=$ACID  

Query variables:

  • $DOMAIN_NAME - Name of the registered domain name with domain zone (example thehost.com.ua).
  • $REGISTRATION_PERIOD - The number of years for which the domain is registered (example 1). The minimum value is 1, the maximum is 10.
  • $NS0 - DNS server of domain No. 1.
  • $NS1 - DNS server of domain No. 2.
  • $NS2 - DNS server of domain No. 3 (optional).
  • $NS3 - DNS server of domain No. 4 (optional).
  • $CONTACT_NAME - Contact name (example Test domain contact).
  • $COMPANY - Contact company name. For individuals, you must indicate Private Person.
  • $FIRSTNAME- Name of the contact person in Latin (example Ivan).
  • $LASTNAME - Last name of the contact person in Latin (example Ivanov).
  • $EMAIL - Contact email (example test@test.com).
  • $PHONE- Phone number of the contact person in the required format - the number must contain + and 2 spaces (example +380 67 1234567).
  • $LA_COUNTRY - Country name in Latin (example Ukraine).
  • $LA_STATE- Name of the region in Latin (example Kyiv region).
  • $LA_POSTCODE - Postal code (example 01001).
  • $LA_CITY - City name in Latin (example Kyiv).
  • $LA_ADDRESS - Address in Latin (example Kreschatik 1).

Register a domain with an existing contact

Request Example:

EMAIL Header:

%CREATE DOMAIN%

EMAIL BODY:

DOMAIN=$DOMAIN_NAME 
PERIOD=$REGISTRATION_PERIOD
NS0=$NS0
NS1=$NS1
NS2=$NS2
NS3=$NS3 
CONTACT_ID=$CONTACT_ID
CONTACT_NAME=$CONTACT_NAME
 CLID=$CLID  
ACID=$ACID  

Query variables:

  • $DOMAIN_NAME - Name of the registered domain name with domain zone (example thehost.com.ua).
  • $REGISTRATION_PERIOD - The number of years for which the domain is registered (example 1). The minimum value is 1, the maximum is 10.
  • $NS0 - DNS server of domain No. 1.
  • $NS1 - DNS server of domain No. 2.
  • $NS2 - DNS server of domain No. 3 (optional).
  • $NS3 - DNS server of domain No. 4 (optional).
  • $CONTACT_ID - Contact code (updated in the Client -> Domain Contacts section.
  • $CONTACT_NAME - Contact name (updated in the Client -> Domain Contacts section.

Domain name renewal

Request Example:

EMAIL Header:

%RENEW DOMAIN%

EMAIL BODY:

DOMAIN=$DOMAIN_NAME
EXPIRE=$EXPIRE_DATE
PERIOD=$RENEW_PERIOD
CLID=$CLID  
ACID=$ACID  

Query variables:

  • $DOMAIN_NAME - Name of the registered domain name with domain zone (example thehost.com.ua).
  • $EXPIRE_DATE - Current domain expiration date (example 2034-01-14).
  • $RENEW_PERIOD - The number of years for which the domain is renewed (example 1). The minimum value is 1, the maximum is 10.

Transfer a domain name with a new contact

Request Example:

EMAIL Header:

%TRANSFER DOMAIN%

EMAIL BODY:

DOMAIN=$DOMAIN_NAME
TRANSFER_CODE=$TRANSFER_CODE
NS0=$NS0
NS1=$NS1
NS2=$NS2 
NS3=$NS3 
CONTACT_NAME=$CONTACT_NAME
CONTACT_FIRSTNAME=$FIRSTNAME
CONTACT_LASTNAME=$LASTNAME
CONTACT_COMPANY=$COMPANY
CONTACT_EMAIL=$EMAIL
CONTACT_PHONE=$PHONE
CONTACT_FAX=  
CONTACT_COUNTRY=<$LA_COUNTRY
CONTACT_STATE=$LA_STATE
CONTACT_POSTCODE=$LA_POSTCODE
CONTACT_CITY=$LA_POSTCODE
CONTACT_ADDRESS=$LA_ADDRESS
CLID=$CLID  
ACID=$ACID  

Query variables:

  • $DOMAIN_NAME - Name of the registered domain name with domain zone (example thehost.com.ua).
  • $TRANSFER_CODE - Number-letter code of domain name transfer (transfer).
  • $NS0 - DNS server of domain No. 1.
  • $NS1 - DNS server of domain No. 2.
  • $NS2 - DNS server of domain No. 3 (optional).
  • $NS3 - DNS server of domain No. 4 (optional).
  • $CONTACT_NAME - Contact name (example Test domain contact).
  • $COMPANY - Contact company name. For individuals, you must indicate Private Person.
  • $FIRSTNAME - Name of the contact person in Latin (example Ivan).
  • $LASTNAME - Last name of the contact person in Latin (example Ivanov).
  • $EMAIL - Contact email (example test@test.com).
  • $PHONE - Phone number of the contact person in the required format - the number must contain + and 2 spaces (example +380 67 1234567).
  • $LA_COUNTRY - Country name in Latin (example Ukraine).
  • $LA_STATE- Name of the region in Latin (example Kyiv region).
  • $LA_POSTCODE - Postal code (example 01001).
  • $LA_CITY - City name in Latin (example Kyiv).
  • $LA_ADDRESS - Address in Latin (example Kreschatik 1).

Transfer a domain name with an existing contact

Request Example:

EMAIL Header:

%TRANSFER DOMAIN%

EMAIL BODY:

DOMAIN=$DOMAIN_NAME
TRANSFER_CODE=$TRANSFER_CODE
NS0=$NS0
NS1=$NS1
NS2=$NS2
NS3=$NS3
CONTACT_ID=$CONTACT_ID  
CONTACT_NAME=$CONTACT_NAME
CLID=$CLID  
ACID=$ACID  

Query variables:

  • $DOMAIN_NAME - Name of the registered domain name with domain zone (example thehost.com.ua).
  • $TRANSFER_CODE - Number-letter code of domain name transfer (transfer).
  • $NS0 - DNS server of domain No. 1.
  • $NS1 - DNS server of domain No. 2.
  • $NS2 - DNS server of domain No. 3 (optional).
  • $NS3 - DNS server of domain No. 4 (optional).
  • $CONTACT_ID - Contact code (updated in the Client -> Domain Contacts section).
  • $CONTACT_NAME - Contact name (updated in the Client -> Domain Contacts section).