get("accounts", ["[>]authkeys" => ["accountid"]], ["publicid", "name", "username", "type", "verified", "bio"], ["key" => $VARS["key"]]); } else { if (!$database->has("accounts", ["publicid" => $VARS["id"]])) { if (!$database->has("merchant_transactions", ["txcode" => $VARS["id"]])) { sendJsonResp($Strings->get("Could not find a matching account.", false), "ERROR"); } else { $profile = $database->get("accounts", ["[>]merchant_transactions" => ["accountid" => "merchantid"]], ["publicid", "name", "username", "type", "verified", "bio"], ["txcode" => $VARS["id"]]); } } else { $profile = $database->get("accounts", ["publicid", "name", "username", "type", "verified", "bio"], ["publicid" => $VARS["id"]]); } } // Make sure the name field always has something useful if (empty($profile["name"])) { $profile["name"] = $profile["username"]; } if (empty($profile["bio"])) { $profile["bio"] = ""; } $profile["verified"] = $profile["verified"] == 1; exitWithJson([ "status" => "OK", "profile" => $profile ]);