API Error: No password specified
Posted: Fri May 01, 2015 6:03 pm
Hello,
I have problem with API.
Result=Error
Error=No password specified
If I have link http://[iphere]/api?Password=[passwordhere]&Command=AccountsAdd&Player=Test
I also have such problem
I have problem with API.
Result=Error
Error=No password specified
Code: Select all
$url = "http://185.49.14.200:8087/api";
$pw = "......................";
function Poker_API($params)
{
global $url, $pw;
$params['Password'] = $pw;
$params['JSON'] = 'Yes';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_VERBOSE, true);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$response = curl_exec($curl);
if (curl_errno($curl)) $obj = (object) array('Result' => 'Error', 'Error' => curl_error($curl));
else if (empty($response)) $obj = (object) array('Result' => 'Error', 'Error' => 'Connection failed');
else $obj = json_decode($response);
curl_close($curl);
return $obj;
}
$steamid = $auth->SteamID;
$stmt = $pdo->prepare("SELECT steamid, coins, personaname, avatarmedium FROM users WHERE steamid = :steamid");
$stmt -> bindValue(':steamid', $steamid, PDO::PARAM_INT);
$stmt -> execute();
while($row = $stmt -> fetch(PDO::FETCH_ASSOC)){
$coins = $row['coins'];
$avatar = $row['avatarmedium'];
$personaname = $row['personaname'];}
$params = array("Command" => "AccountsAdd",
"Player" => $personaname,
"RealName" => "",
"PW" => "",
"Location" => "",
"Email" => "",
"AvatarFile" => $avatar,
"Gender" => "Male",
"Chat" => "Yes",
"Note" => "");
$api = Poker_API($params);
if ($api -> Result == "Ok") echo "Account successfully created for $Player";
else echo "Error: " . $api -> Error;
}
I also have such problem