Remote User (API) SOAP Error: Forbidden

Discussion in 'General' started by backofficegeorgia, Feb 12, 2019.

  1. backofficegeorgia

    backofficegeorgia New Member

    I get SOAP Error: Forbidden on API request, Apache error log is empty, I am ruining script from the same machine as sever.

    $username = 'test';
    $password = '******';
    $soap_location = 'https://localhost:8080/remote/index.php';
    $soap_uri = 'https://localhost:8080/remote/';
    require 'soap_config.php';
    $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 {
        if($session_id = $client->login($username, $password)) {
            echo 'Logged successfull. Session ID:'.$session_id.'<br />';
        //* Set the function parameters.
        $client_id = 1;
        $params = array(
            'server_id' => 1,
            'database_user' => 'db_name2',
            'database_password' => 'db_name2'
        $database_user_id = $client->sites_database_user_add($session_id, $client_id, $params);
        echo "Database ID: ".$database_user_id."<br>";
        if($client->logout($session_id)) {
            echo 'Logged out.<br />';
    } catch (SoapFault $e) {
        echo $client->__getLastResponse();
        die('SOAP Error: '.$e->getMessage());
  2. Jesse Norell

    Jesse Norell ISPConfig Developer Staff Member ISPConfig Developer

    Do you get the "Logged successfull. [sic] ..." message, and a session id created? If so, you could try/catch the soap login separately from creating a database user (and maybe separate from the logout, too), to see which of the parts is throwing a fault.

    You created a 'test' user under 'Remote users' not 'CP Users' ? Do you have Remote Access enabled, probably allowing Do you have all the needed functions enabled for what your 'test' user needs to do?
  3. backofficegeorgia

    backofficegeorgia New Member

    Hello and than you for your kind response, only message i get is SOAP Error: Forbidden.

    user is created under remote users, i ticked remote access box in remote user settings, ips are empty which means any (i have tested under same result). all the functions are enabled
  4. backofficegeorgia

    backofficegeorgia New Member

    Found error in log

    [Sat Feb 16 00:21:06.431348 2019] [access_compat:error] [pid 28424] [client] AH01797: client denied by server configuration: /var/www/ispconfig/remote/index.php
    Last edited: Feb 16, 2019

Share This Page