<?php require_once "../php/main.php"; $id = argreq("id"); $team = argreq("team"); //0 or 1 $action = argopt("action", null); $player_number = argreq("player_number"); $player_name = argreq("player_name"); $info = argopt("info", null); $code = argreq("code"); if (is_null(post_ticker_event($id, $team, $action, $player_number, $player_name, $info, $code))) { api_error(); } else { api_done(array("ticker" => get_ticker($id))); }
<?php require_once "../php/main.php"; $team_a = argreq("team_a"); $team_b = argreq("team_b"); $duration = argreq("duration"); $name = argreq("name"); $location = argreq("location"); $players = argopt("players", "[]"); //is a json-encoded array $code = argreq("code"); $players = json_decode($players, true); $id = create_ticker($team_a, $team_b, $duration, $name, $location, $players, $code); if (is_null($id)) { api_error(); } api_done(array("ticker" => get_ticker($id)));