• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Resolved how to automate user creation in plesk using api?

hamza-24

Basic Pleskian
Server operating system version
centOS 7
Plesk version and microupdate number
18.0.50
hey hope you all are doing well
I want to automate plesk customer creation in a way that when new user comes to specific API he adds his credentials and submit in a result a user is created with specified plan.
guidance will be highly appreciated.
 
what i wanted to say is how can i access the specific API URL or where should i place my code file in server so that i can access it using the URL?
 
To communicate with the Plesk APIs (either Rest or XML-RPC) you should create your own app. It could be anything: a web app, a shell script, desktop software, etc.

In your case usually it is like this:
You have a front-end - a webpage with a sign-up form, which after submitting sends the data to your back-end.
Backend are scripts, which validate the data, maybe store it in your DB and communicate with Plesk API to create the user and the plan. Then your backend script should return the data (or errors) to front-end.
 
thankyou for your reply sans
this is what I understand
what I want to ask is where should I place the scripts on backend that validates and creates user or in simple words where will i place my script file so that plesk can execute it. i want to know the directory or location or path of that area from where plesk will work according to desired script.
 
Your Plesk already has API endpoints at https://<Plesk hostname or IP address>:8443/api/v2/<API endpoint> and your script should communicate with it.

Your script can be placed at any site. Probably you'll want to create a publicly accessible domain in Plesk and put your scripts there.
 
for example the default host name of my plesk is "ABC" and when I access it www.abc.plesk.page it opens up the main login page.
if I use /api/v2/client to add new client it shows me no connection page.
i am really confused regarding this issue
 
Your REST API overview should be accessible at all times at https://<Plesk hostname or IP address>:8443/api/v2/ - you can open it in browser to check. It has list of all the API methods.

But to communicate with API you'll have to follow the rules as written here. You'll need to form a correct request, having correct HTTP headers (Content-Type and Accept to be exact) - this cannot be done if you open API endpoint in browser. Also you'll have to authenticate to execute the request. You can refer to the "Examples" section to see how it can be achieved.
 
Back
Top