Improvement of the API
Several requests with the new Plesk V2 API:
- When creating a reseller customer, be able to assign a plan to him when creating.
- When creating or modifying a hosting, you can set an expiration date.
- To be able to perform actions on a client (Suspend, modify, etc...) via its login, and not only with the ID.
I don't know if these functions are already available or not, but I'm asking for all this here.
Thank you to you.
Plesk REST API has the ability to call CLI utilities using CLI gate. The full list of supported utilities can be found using following command via SSH:
ll /usr/local/psa/admin/plib/api-cli/
Thus, everything that you can do with the help of command line utilities, you can do with the help of REST API. For example, use CLI gate to check spamassassin status for the mailbox:
curl k -X POST -u admin:password “https://203.0.113.2:8443/api/v2/cli/spamassassin/call” -H “accept: application/json” -H “Content-Type: application/json” -d “{ \”params\“: [ \”-info\“, \”jdoe@example.com\" ]}"
More details of Plesk REST API can be found here https://app.swaggerhub.com/apis/plesk/api/v2
—
IG
-
Florian Leroy commented
I try this :
curl -X POST "https://moon.hebergnity.com:8443/api/v2/cli/subscription/call" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \"params\": [ \"--update\", \"test.com\", \"-expiration\", \"2020-10-10\" ]}"But there is no command for change expiration date.
Where i can found a liste of options for each commands ?