After using OS Ticket for last few years I wanted to added some functionality that I could have basic SQL queries to do, but I decided to investigate the source and come with my own flavour of a Wallboard JSON feed. I use feed on an intranet server to keep up to date with the open ticket numbers.Please see GPL code below.. which I know could be written better, but I had only 2 hrs or so to review and build.I have stored this file in the api folder and named it wallboard.php<?php// Disable sessions for the API. API should be considered stateless and// shouldn't chew up database records to store sessionsif (!defined('DISABLE_SESSION')) define('DISABLE_SESSION', true);// Init OS Ticket Systemfile_exists('../main.inc.php') or die('System Error');require_once('../main.inc.php');//Validate API Tokenrequire_once(INCLUDE_DIR.'class.api.php');$id = ""; if (isset($_POST) && isset($_SERVER)) $id = API:($_POST, $_SERVER);if (!$id) { header("HTTP/1.1 401 Unauthorized"); echo "Valid API key required"; return;}//Create SQL$sql = "SELECT number, updated FROM " . TICKET_TABLE . " WHERE " . TICKET_TABLE . ".status_id in (1,2) AND " . TICKET_TABLE . ".isanswered = 0";//Execute SQL $res = db_query($sql,true); //Create temporary list and load db result$result = ;while ($data = db_fetch_array($res)) { $result = $data;}// Ouput JSON encode dataecho json_encode($result);// Free result setdb_free_result($res);