• Hi, Pleskians! We are running a UX testing of our upcoming product intended for server management and monitoring.
    We would like to invite you to have a call with us and have some fun checking our prototype. The agenda is pretty simple - we bring new design and some scenarios that you need to walk through and succeed. We will be watching and taking insights for further development of the design.
    If you would like to participate, please use this link to book a meeting. We will sent the link to the clickable prototype at the meeting.
  • (Plesk for Windows):
    MySQL Connector/ODBC 3.51, 5.1, and 5.3 are no longer shipped with Plesk because they have reached end of life. MariaDB Connector/ODBC 64-bit 3.2.4 is now used instead.
  • 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.

Question I can't add a plan with the rest client api

TryLex

New Pleskian
Server operating system version
Version 18.0.49
Plesk version and microupdate number
Version 18.0.49
<?php session_start(); $data = [ "name" => $_SESSION['nom'], "login" => $_SESSION['username'], "status" => 0, "email" => $_SESSION['email'], "locale" => "fr-FR", "owner_login" => $_POST['login'], "external_id" => $_SESSION['id_client'], "password" => "changeme1Q**", "type" => "customer", "PlanReference" => [ "properties" => [ "name" => [ "type" => "string", "example" => "Unlimited" ] ] ] ]; $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://panel.nfytech.fr:8443/api/v2/clients", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "POST", CURLOPT_POSTFIELDS => json_encode($data), CURLOPT_HTTPHEADER => [ "Content-Type: application/json" ], CURLOPT_USERPWD => "Admin:*************************" ]); $response = curl_exec($curl); $err = curl_error($curl); if ($err) { echo "Erreur cURL : $err"; } else { // Vérifier le code de statut HTTP $http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE); if ($http_status >= 200 && $http_status < 300) { echo "Votre client à été creer avec succès !"; } elseif ($http_status = 409) { echo "Le compte client existe déjà"; } else { echo "Erreur lors de la création du client. Code d'erreur HTTP : $http_status"; } } curl_close($curl);
help me pls
 
Ok. The PlanReference does not belong in the body when creating a client. You assign a Service Plan to a domain (subscription), not to a client. So you have to make a two separate API calls:
  1. https://yourdomain:8443/api/v2/clients to add a client
  2. https://yourdomain:8443/api/v2/domain to add a domain (subscription) with a reference to the Service plan
 
Ok. The PlanReference does not belong in the body when creating a client. You assign a Service Plan to a domain (subscription), not to a client. So you have to make a two separate API calls:
  1. https://yourdomain:8443/api/v2/clients to add a client
  2. https://yourdomain:8443/api/v2/domain to add a domain (subscription) with a reference to the Service plan
can you write the code in php for me pls
 
Back
Top