Hi, Wonder if the API of ISPConfig is stable? Planning and creating a little simpler interface for creating pages mail and ftp to ispconfig. You recommend us and use it?
The API is stable since many years now, we use it e.g. in the migration tool and other tools like the WHMCS or Roundcube plugin use it as well.
I have created a remote user and this give "SOAP Error: Bad Request" PHP: <?php$username = 'admin';$password = 'mypassword';$soap_location = 'http://localhost:8080/remote/index.php';$soap_uri = 'http://localhost:8080/remote/';$client = new SoapClient(null, array('location' => $soap_location, 'uri' => $soap_uri, 'trace' => 1, 'exceptions' => 1));try { $session_id = $client->login($username, $password); echo 'Logged successfull. Session ID:'.$session_id.'<br />'; echo "Logging out: "; $client->logout($session_id); echo "Logged out.";}catch (SoapFault $e) { echo $client->__getLastResponse(); die('SOAP Error: '.$e->getMessage());}?>
OBS, this gives me : SOAP Error: Could not connect to host PHP: <?php$username = 'api';$password = 'PW';$soap_location = 'https://localhost:8080/remote/index.php';$soap_uri = 'https://localhost:8080/remote/';$client = new SoapClient(null, array('location' => $soap_location, 'uri' => $soap_uri, 'trace' => 1, 'exceptions' => 1));try { $session_id = $client->login($username, $password); echo 'Logged successfull. Session ID:'.$session_id.'<br />'; echo "Logging out: "; $client->logout($session_id); echo "Logged out.";}catch (SoapFault $e) { echo $client->__getLastResponse(); die('SOAP Error: '.$e->getMessage());}?>
now it works. PHP: <?php$username = 'test';$password = 'test';$soap_location = 'https://isp1:8080/remote/index.php';$soap_uri = 'https://isp1:8080/remote/';$client = new SoapClient(null, array('location' => $soap_location,'uri' => $soap_uri,'trace' => 1,'stream_context'=> stream_context_create(array('ssl'=> array('verify_peer'=>false,'verify_peer_name'=>false)))));try { $session_id = $client->login($username, $password); echo 'Logged successfull. Session ID:'.$session_id.'<br />'; echo "Logging out: "; $client->logout($session_id); echo "Logged out.";}catch (SoapFault $e) { echo $client->__getLastResponse(); die('SOAP Error: '.$e->getMessage());}?>
I'm using exactly the same script (with https), but the login example does not work and simply gives an error: Code: root@server ~/ispconfig3_install/remoting_client/examples # php login.php SOAP Error: Internal Server Error The username, password and the SOAP URLs are properly set up. System Info: - Ubuntu 16.10 - apache 2.4.18 - ISPConfig 3.1.1p1 I could not find any errror or warning about this internal server error in any of the webserver's logs (). ISPConfig loglevel is set to Debug, but I still can't find anything in any of the log files in /var/log/ (not even under /var/log/ispconfig/httpd/server.domain.com/). Only the access.log contains the entry with the 500 return code: Code: 212.183.121.55 - - [04/Dec/2016:22:39:19 +0100] "POST /remote/index.php HTTP/1.1" 500 4059 "-" "PHP-SOAP/7.0.8-0ubuntu0.16.04.3"