• The new Python extension is now available. It allows customers to deploy and manage WSGI-based Python applications on their websites directly from Plesk.
  • Debian 11 has reached its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.81 is the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

API RPC authentification error

albans

Regular Pleskian
Hi,

I'm trying to use the Plesk RPC API, and I can't log-in correctly.

I use the following PHP code, taken from several example I found:
define ('HOST', 'myserver.com');
define ('PORT', 8443);
define ('PATH', 'enterprise/control/agent.php');

$url = 'https://' . HOST . ':' . PORT . '/' . PATH;

echo $url;

$headers = array(
'HTTP_AUTH_LOGIN: admin',
'HTTP_AUTH_PASSWD: xxxx',
'Content-Type: text/xml'
);


// initialize the curl engine
$ch = curl_init();

// set the curl options:
// do not check the name of SSL certificate of the remote server
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);

// do not check up the remote server certificate
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);

// pass in the header elements
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

// pass in the url of the target server
curl_setopt($ch, CURLOPT_URL, $url);

// tell CURL to return the result rather than to load it to the browser
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_POST, true);

I always get the following error, when I try with the admin login.

error 1001 Authentication failed - wrong password.

Should I use another login? I tried with the login of the client level user and it didn't work either.

Thanks!
 
Okay, fantastic: I SOLVED THE PROBLEM!!!
It was linked to the length of my password (> 15 caracters)...
I simply modified it to a shorter one, and everything's running smoothly!
So, I guess it's good to know not to lose days tryin' ;o)
 
Back
Top