Simple Authentication

Read 2805 times
Hello,

I am new to Centova and want to make some API call.

I created in Staff an account with super user rights.

I use the following code and I get "Invalid username or password"

$url = "http://ip:2199/api.php";

$input_xml = '<?xml version="1.0" encoding="UTF-8"?>
<centovacast>
<request class="system" method="info">
 <username>userName</username>
 <password>passwd</password>
 </request>
 </centovacast>';

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
// curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml'));
curl_setopt($ch, CURLOPT_POSTFIELDS, $input_xml);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300);
$output = curl_exec($ch);
curl_close($ch);

I checked multiple times the password and name and all seems ok.

There must be something I am not aware of.. so please help me :)

Regards