• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

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