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.
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"
}
}
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