title: SugarCRM REST api error
body: <p>I am trying to retrieve custom module data through the Sugarcrm REST api but I am not able to do so as I am not even able to login with the documentation code, I tried same thing as given in documentation</p>
  
  <pre><code>    &lt;?php
  
  // specify the REST web service to interact with
  $url = 'localhost/~jmertic/sugarcrm/service/v4_1/rest.php';
  
  // Open a curl session for making the call
  $curl = curl_init($url);
  
  // Tell curl to use HTTP POST
  curl_setopt($curl, CURLOPT_POST, true);
  
  // Tell curl not to return headers, but do return the response
  curl_setopt($curl, CURLOPT_HEADER, false);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
  
  // Set the POST arguments to pass to the Sugar server
  $parameters = array(
      'user_auth' =&gt; array(
          'user_name' =&gt; 'username',
          'password' =&gt; md5('password'),
          ),
      );
  $json = json_encode($parameters);
  $postArgs = array(
      'method' =&gt; 'login',
      'input_type' =&gt; 'JSON',
      'response_type' =&gt; 'JSON',
      'rest_data' =&gt; $json,
      );
  curl_setopt($curl, CURLOPT_POSTFIELDS, $postArgs);
  
  // Make the REST call, returning the result
  $response = curl_exec($curl);
  
  // Convert the result from JSON format to a PHP array
  $result = json_decode($response);
  if ( !is_object($result) ) {
      die("Error handling result.\n");
  }
  if ( !isset($result-&gt;id) ) {
      die("Error: {$result-&gt;name} - {$result-&gt;description}\n.");
  }
  
  // Get the session id
  $sessionId = $result-&gt;id;
  </code></pre>
  
  <p>changed the username,password and url to match my setup but i get an error stating </p>
  
  <pre><code>No direct script access allowed
  </code></pre>
  
  <p>I tried to search this on web but couldnt find any relevant solution.
   I am using sugarCRM 6.5.0RC2 version</p>
  
  <p>Regards,
  Anand Joshi</p>