• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question API-RPC and Let's Encrypt?

selliott

New Pleskian
Is there a way to install a Let's Encrypt certificate using API-RPC? I've found that if I set a subscription to install it, and choose that subscription as the plan name during the webspace setup, it does eventually install the certificate, but not by the time the API has setup the website. I'd like to be able to complete the Let's Encrypt install within this script, so I can receive a response and know the site is secure at the end of the process.
 
As you may know, LE certificate can be installed with the help of following CLI command, for instance:

# plesk bin extension --exec letsencrypt cli.php -d domain.com -d www.domain.com

And you may know, that you can run Plesk CLI utilities with help of Plesk REST API. Here are some examples - How to manage Plesk via REST API? and REST API documentation - About REST API

Try to create your own REST API call for using the command above.
 
Is it possible to do this with packets? I developed my app using packets for all the rest of the calls and they were pretty easy to use, but I couldn't find any good examples of how to perform this on the v2 REST API with C#.
 
I need this, too. We are resellers with access to the XML RPC API, without access to the command line interface or the REST API.
Can it be done with the XML RPC API? How?
 
@IgorG thank you for this info. i wonder where you can find an overview for the plesk bin extension of all possible cli commands that are possible.
do you have a documentation about this? the xml api aswell the rest api are lacking of some other features that may be possible with the plesk cli
 
if anyone wonders how to do it:

curl --location --request POST 'yourserver.de:8443/api/v2/cli/extension/call' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic YOURAPIKEY' \
--data-raw '{
"params": [
"--exec",
"letsencrypt",
"cli.php",
"-d",
"domain.com",
"-m",
"[email protected]"
]
}'
 
Back
Top