• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Resolved API install SSL certificate for mailserver

Lexz

Basic Pleskian
Good afternoon everybody,

I hope someone can help us.
We are developing the API implementation into our customerpanel.

We would like to install a certificate (Sectigo) for the mailserver of a subscription but we couldn't find it in the API documentation.
(Mail Service Preferences)

We only succeeded to install the certificate for the webmail and webserver. This seems to work fine.

Can someone help us out? Or give some details how we can do this?
Thank you in advance!

Update:
This is what we would like to do with the API
plesk bin subscription_settings --update example.com -mail_certificate 'certificate_name'
 
Last edited:
You can use REST API, POST "/cli/{id}/call" method to execute domain_pref CLI command (domain_pref is previous name of subscription_settings command, but you can call it over API).
Your example over API:
Bash:
curl -X POST "https://YOUR_IP:8443/api/v2/cli/domain_pref/call" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"params\": [ \"--update\", \"example.com\", \"-mail_certificate\", \"certificate_name\" ]}"
Don't forget API about authorization: About REST API
 
Back
Top