api.php is a restful interface to the Schedule of Classes data. It caches content retrieved from REG/SIS’s SOAP service and presents it in a format suitable for inclusion in a CMS deployed schedule of classes site. Most resources can be retrieved in JSON formatted output.
JSON content can be easily turning to an associative array with the PHP 5 call to json_decode. e.g.
$myhash = json_decode($json_string,true);
eval("myhash = " + json_string + ";");
To acccess the JSON content you need to use the fetch the document via http. The URI is formulated in a REST style. api/[service]/[options].
This API is driven by pulling the general data from the Registrar’s office data and populating a cache of the data appropriately. This process is managed through our RESTful API. You can see the contents of the current cache by pointing your browser at http://web-app.usc.edu/ws/soc/api/cache. Periodically you may want to remove/expire contents in the cache go to http://web-app.usc.edu/ws/soc/manage. This isn’t something you usually need to do though as it is run automatically form a cron job.