DNSExit developer docs

SSL API for certificate renewal and download.

Query certificate status, renew Let's Encrypt SSL/TLS certificates, and download certificate files remotely with JSON requests.

Endpoint https://api.dnsexit.com/dns/lse.jsp
  • Query certificate status
  • Renew certificates remotely
  • Download cert, CA, CSR, or private key files

SSL API overview

The SSL API gives you tools to manage and renew Let's Encrypt SSL certificates remotely. Build a JSON request, post it to the API endpoint, and automate certificate tasks from your own systems.

Create an API key

Create an API key before using the SSL API. After logging in, open Settings, choose DNS API Key, and use the generated key with each remote SSL request.

How to use the API

Create a JSON file for the action you want, then post it to the API endpoint:

			
>> curl -H "Content-Type: application/json" --data @/path/jason-file https://api.dnsexit.com/dns/lse.jsp
			

Alternatively, define apikey and domain in the URL parameters:

>> curl -H "Content-Type: application/json" --data @/tmp/update.json  \
			 https://api.dnsexit.com/dns/lse.jsp?apikey=Your-API-KEY&domain=example.com	
			

Or send them in the request headers:

	
>> curl -H "Content-Type: application/json" -H "apikey: Your-API-KEY" -H "domain: example.com" \
		 --data @/tmp/update.json https://api.dnsexit.com/dns/lse.jsp	
			

Header values have the highest priority, followed by URL parameters, then values defined in the JSON body. For example, a header such as -H "domain: example.com" overrides the same value in the URL or JSON file.

Server replies

A successful request returns a JSON response like this:

		

A successful update always returns code 0. Other values indicate a problem:

    Reply Code Reply Message Note
    0 Success Actions got executed successfully
    1 Failed Indicates action failed. You should check the message for the reason
    2 API Key Authentication Error The API Key is missing or wrong
    3 Missing Required Definitions Your JSON file may missing some required definitions.
    4 JSON Data Syntax Error Your JSON file has syntax error.
    5 JSON Defined Record Type not Supported Your JSON may try to update some record type not supported by our system
    6 System Error Our system problem. May not be your problem. Contact our support if you got such error.
    7 Error getting post data Our server has problem to receive your JSON posting

SSL action examples

Query Domain SSL

1. Simple Query for the SSL of a Domain

Example JSON file to query SSL status:
{
   "apikey": "your-api-key",
   "domain":"example.com",
   "action": "query",
   "verbose": "false"
}

You may get back the following JSON reply:

{
   "code":"0",
   "message":"Success",
   "SSL":{
      "expiration date":"2021-05-28",
      "domain":"example.com",
      "type":"regular",
      "issue date":"2021-02-27",
      "status":"OK"
   }
}

2. Query and Display the SSL Certs for a Domain

Example JSON file to query SSL status and display certificate files:
{
   "apikey": "your-api-key",
   "domain":"example.com",
   "action": "query",
   "verbose": "true"      // values can be "true", "false", "certs"
}

You will get the above JSON reply when verbose is "false" Plus all the certs. Most time, you may only need the SSL Certificate and Intermediate CA, then you put the verbose value to be "certs"

-----SSL Certificate:-----
-----BEGIN CERTIFICATE-----
....
-----END CERTIFICATE-----

-----Intermediate CA-----
-----BEGIN CERTIFICATE-----
....
-----END CERTIFICATE-----

-----Private Key-----
-----BEGIN RSA PRIVATE KEY-----
....
-----END RSA PRIVATE KEY-----

-----Domain CSR-----
-----BEGIN CERTIFICATE REQUEST-----
.....
-----END CERTIFICATE REQUEST-----

{
   "code":"0",
   "message":"Success",
   "SSL":{
      "expiration date":"2021-05-28",
      "domain":"example.com",
      "type":"regular",
      "issue date":"2021-02-27",
      "status":"OK"
   }
}

Renew Domain SSL

Example JSON file to renew a Let's Encrypt SSL certificate for a domain:
{
   "apikey": "your-api-key",
   "domain": "example.com",
   "action": "renew",
   "verbose": "true"    // "false"  or "true", when "true", you will see the progress of renewing the SSL. The renew process may take a few minutes
}

After a successful renewal, the response includes code 0:

{
   "code":"0",
   "message":"Success",
   "details":["....."]
}

Download Domain SSL

Download an SSL certificate with the following JSON:
{
   "apikey": "your-api-key",
   "domain": "example.com",
   "action": "download",
   "file": "cert"				|| file can be "CSR", "cert", "CA", "privatekey"
}

Alternatively, you can put the value of file to be either "CA", "CSR", "privatekey" to download the Intermediate CA, CSR, or private key of the SSL certificate.

>> curl  -H "Content-Type: application/json" --data @/path/jason-file https://api.dnsexit.com/dns/lse.jsp
It will display the following output:
-----SSL Certificate:-----
-----BEGIN CERTIFICATE-----
....
-----END CERTIFICATE-----

Alternatively you can pipe the above command to your certificate file

>> curl  -H "Content-Type: application/json" --data @/path/jason-file https://api.dnsexit.com/dns/lse.jsp > /path-to-your-ssl/domain.cert