General Guides to Use API
To use the API, you create your update at JSON file and post the update to our API site:
>> curl -H "Content-Type: application/json" --data @/path/jason-file https://api.dnsexit.com/dns/lse.jsp
Alternatively, you can skip definition of apikey and domain at JSon file and specify them at the URL parameter as:
>> 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 you can define them at the Headers as:
>> 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
Bear in mind the parameter passed at Headers has the highest priority, followed by HTTP URL parameters, last by definition at JSON file.
For examplie, if you define the domain at Header as
-H "domain: example.com"
, it will overwrite the domain definition at HTTP URL and JSON file.
Example JSON File to query the status of a SSL.
{
"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"
}
}
Example JSON File to query the status of a SSL and display the Certificates.
{
"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 the Let's Encrypt SSL 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
}
Upon successfully renew, you should get a JSon data at the end with code:0 to indicate the SSL has been renewed successfully.
{
"code":"0",
"message":"Success",
"details":["....."]
}
Download Domain SSL
You can download a 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