<?php $__env->startSection('page_title'); ?>
    OSAA - API Documentation
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_sub_title'); ?>    
   OSAA Application Programming Interface
<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    @parent

    <style type="text/css">
        h2 {
            margin: 1.75em 0 0.75em 0 !important;
        }

        dl {
            margin-left: 50px !important;
        }

        dt {
            width: 100% !important;
            margin-bottom: 0.25em !important;
            padding-left: 10px !important;            
        }

        dd {
            margin-left: 50px !important;
            margin-bottom: 1em;
        }

        dd table td {
            vertical-align: top;
        }

        dd table td:first-of-type {
            font-family: monospace;
            padding-right: 20px;
        }

        dd table td:nth-of-type(2) {
            font-family: monospace;
            color: #1c43a6;
            padding-right: 20px;
        }

        dd table td:nth-of-type(3) {
            font-style: italic;
        }

        .example {
            font-family: monospace;
            background-color: #f2f2f2;
            border: 1px solid #d9e1e0;
            padding: 0.25em 0.5em;
        }

        .filter_list {
            float: right;
            width: 150px;
            background-color: #FFF8E7;
            padding: 0.5em 0.5em 1em 0.5em;
            border: 1px solid #FFEFB0;
        }


    </style>

    

<?php $__env->stopSection(); ?>

<?php $__env->startSection('jquery_init'); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_functions'); ?>
    
<?php $__env->stopSection(); ?>


<?php $__env->startSection('main_content'); ?>    
   
    <h1>Documentation</h1>    
    
    <h2>Introduction</h2>
    <p>
        <img src="http://icons.iconarchive.com/icons/custom-icon-design/pretty-office-3/64/search-database-icon.png" alt="" title="" style="float: left; margin: 0 1em 0.25em 0;" />
        The OSAA provides an <a href="http://en.wikipedia.org/wiki/Application_programming_interface" target="_blank">application programming interface (API)</a> to access database information.  The basic premise is that data should be shared.  The OSAA collects a vast amount of information from member schools that third parties find interesting.  This data include schedules, scores, teams, rankings, and other information.  This API provides a programmatic approach to accessing raw data.
    </p>

    <h2>Terms of Service</h2>
    <p>
        This service is provided "as is" and the OSAA disclaims all warranties with regard to this service including all implied warranties of
        merchantability and fitness.  In no event shall the OSAA be liable for any special, direct, indirect, or consequential damages or any damages whatsoever resulting from loss of use, data or profits, whether in an action of contract, negligence or other tortuous action, arising out of or in connection with the use or performance of this service.
    </p>
    <p>    
        The OSAA reserves the right to create, remove, update, and delete any component or module of this service at any time without prior notice.
    </p>
    <p>
        Access is restricted to registered IP addresses.  To acquire access, please contact Gibby Reynolds, OSAA IT Systems Administrator, (503) 682.6722 x228, <?php echo Helpers::obfuscateEmailLink ("gibbyr@osaa.org"); ?>.
    </p>

    <h2>Support</h2>
    <p>
        All documentation relating to using the API can be found on this page.  This page includes detailed instructions as well as examples for use.  Technical support and questions can be directed toward Gibby Reynolds, OSAA IT Systems Administrator, (503) 682.6722 x228, <?php echo Helpers::obfuscateEmailLink ("gibbyr@osaa.org"); ?>.
    </p>
    <p>
        Questions regarding integration or data usage are not supported by the OSAA.  Comments regarding inaccurate schedules or contest scores or requests to change or update information relating to schedules and scores will be referred to the schools' athletic directors.
    </p>

    <h2>Availability &amp; Data Formatting</h2>
    <p>        
        This API can only be used to access information via HTTP GET method requests.  All other HTTP methods are denied.  The OSAA intends to protect its database and vet individuals entering information by restricting editing privilege to authenticated users.  This API cannot be used to insert records or modify data contained within the OSAA database; the API only allows data reads.
    </p>
    <p>
        Data regarding schedules, scores, and teams only pertain to team sports (football, volleyball, soccer, basketball, baseball, and softball.)  Individual sports and activities are not supported through this API.
    </p>
    <p>
        <img src="<?php echo asset('images/logos/json_logo_555px.png'); ?>" alt="" title="" style="float: left; margin: 0 1em 0.25em 0; width: 100px;" />
        This API returns all data in <a href="http://www.json.org/" target="_blank">JSON format</a>.  JSON data can be viewed in a browser or in most HTTP response capturing programs.  Regardless of the existence of an HTTP accept header, data will only be returned as "application/json".  Some data fields <a href="http://en.wikipedia.org/wiki/Comma-separated_values" target="_blank">contain comma separated lists (CSL)</a> in a string data-type.
    </p>
    <p>
        All responses will be returned as a JSON array, even API requests for single data elements (as an array with one item).  A custom HTTP response header is added to each return, named <code>Content-Count</code>, that contains the number of returned items in the array.  In the event of an error, the value will be zero.
    </p>
    <p>
        Data specifications for a particular node are included in the "Nodes" section.  In the node list, the conceptual data element is explained with URL accessors for requesting related node information.  Underneath the URL access handles, the item's return variables are listed with the name of the field, its data-type, and a brief explanation of that field.  An example of accessing that node's handle is contained in the gray box showing the handle, returned JSON data, and the HTTP response headers.
    </p>       
    <p>
        The accuracy of information from the database is not guaranteed.  Schools are responsible for inputing schedules before the first allowable contest date, updating their schedules, and inputting scores in a timely fashion.  Data may also be cached for a period of time to help reduce server load and database hits.
    </p>

    <h2>Definitions</h2>
    <p>
        The following terms are used in throughout this API documentation.  This vocabulary is used by the OSAA and is provided for reference.
        <dl>
            <dt><b>Boolean</b></dt>
            <dd>A boolean data type can have three values: true, false, or null.  If a value's data type is described as a boolean, you can expect one of those three values.  Null boolean values represent an unknown or uninitiated state and should not be misinterpreted as false.</dd>

            <dt><b>Classification</b></dt>
            <dd>A group designator for schools based on annual enrollment.  The OSAA currently groups schools into six classifications.  Classifications include 6A, 5A, 4A, 3A, 2A, and 1A.</dd>

            <dt><b>Date/Time</b></dt>
            <dd>Dates and times are stored as strings with "YYYY-MM-DD HH:MM:SS" formating (ISO 8601).  This data is saved as a DATETIME format, not a TIMESTAMP which means values can range from "1000-01-01 00:00:00" to "9999-12-31 23:59:59".  All times are stored relative to Pacific Time (PT).  Contests can return a <code>time_zones</code> value by slug.  Time zones do not factor in daylight savings time.  In such cases, those different time zones should be calculated with their respective offset relative to Pacific Time.  For example, a contest with a <code>start_at</code> value of "2014-05-15 13:00:00" and a <code>time_zone</code> of "MT", then the contest starts at 2:00pm Mountain Time, but is saved in the database as 1:00pm Pacific Time.  Contest times that are at midnight ("00:00:00") should be handled as TBD.</dd>
            
            <dt><b>Division</b></dt>
            <dd>A division is a group of one or more classifications that are combined in order to allow for fair competition.  Some sports are not offered by every school.  In such cases, some classifications are combined to form one division.  Divisions with combined classifications list both classifications with a forward slash.  For example, the "3A/2A/1A" division is sanctioned for competitions between schools in the 3A, 2A, or 1A classification.</dd>

            <dt><b>League</b></dt>
            <dd>Schools are assigned a regular league based on geographical area with other schools in the same classification.  This assignment is made for a four-year block.  Within each activity's division, teams are placed into leagues, usually coinciding with their regularly assigned league.  In some instances (i.e. combined activity divisions that span more than one classification or in other special cases) special districts are created for grouping teams across regular districts.  The term "Special District" is another word for a league with teams spanning regular leagues.<br /><br />Leagues are commonly referred to by name.  However, names change and take up unnecessary space.  The database references leagues by slug.  League slugs are composed of the division, followed by a hyphen, followed by the league's number within that division.  For example, 1A-7 is the slug for the 7th league in the 1A division, currently named "Old Oregon League".  Special district league slugs include "SD" after the hyphen; i.e., 2A/1A-SD3 is "Special District 3" in the 2A/1A division.</dd>

            <dt><b>Level</b></dt>
            <dd>There are two levels of competition, listed in order: varsity (V) and sub-varsity.  Sub-varsity levels are subdivided into four levels: Junior Varsity (JV), Junior Varsity #2 (JV2), Freshman (FR), and Freshman #2 (FR2).</dd>
            
            <dt><b>ID</b></dt>
            <dd>Any id field is guaranteed to be a unique, auto-incremented, positive whole number of the integer data-type.  All nodes have an id.</dd>

            <dt><b>School Year</b></dt>
            <dd>A school year is the academic school year for high schools in Oregon that starts in August and ends in June.  If a school year is represented with only 4 digits, then it references the school year starting in that year.  For example, 2014 refers to the 2014-2015 school year which starts in August, 2014 and ends in June 2015.</dd>
            
            <dt><b>Slug</b></dt>
            <dd>A slug is a unique identifier, usually of the string data-type and acts must like an id.</dd>
        </dl>
    </p>

    <h2>Common Filter Parameters</h2>
    <p>
        Some API requests requires access to past information or a specific subset of a node's collection.  Common filter parameters can be appended to the end of a node's handle as a <a href="http://en.wikipedia.org/wiki/Query_string" target="_blank">query string</a>.
        <dl>
            <?php /* 
            <dt><b>Date</b></dt>
            <dd>
                <code>date=[YYYY-MM-DD]</code><br /><br />
                To limit collections containing items with a date, you can specify the date parameter.  Specify the desired date in YYYY-MM-DD format.
            </dd>
             */ ?>

            <dt><b>Level</b></dt>            
            <dd>
                <code>level=[V|JV|JV2|FR|FR2]</code><br /><br />
                By default, this optional parameter's value is automatically set to V (varsity).  To get a different level, specify the level parameter as defined in the Definitions section. 
            </dd>

            <dt><b>School Year</b></dt>            
            <dd>
                <code>year=[YYYY]</code><br /><br />
                By default, this optional parameter's value is automatically set to the current school year.  To request data pertaining to a different school year, use this parameter with a four digit integer value of the school year.  (School years are defined in the Definitions section.)
            </dd>            
            
            
            
        </dl>
    </p>

    <h2>Nodes</h2>
    <p>
        The API allows access to data relating to the nodes including <b>Activities</b>, <b>Schools</b>, <b>Teams</b>, <b>Contests</b>, and <b>Leagues</b>.  Details on accessing the API handles for each available node is described below. (Note: all information returned will be in a JSON array.)
        <dl style="border-left: 4px solid #E1BBFF;">
            <dt><b>Activities</b> - An activity is a team sport sanctioned by the OSAA.  To get a list of all activities or a specific activity with a given slug:<br /><br /></dt>            
            <dd>
                <div class="filter_list">
                    <b>Optional Parameters</b><br />
                    <code>year</code><br />                    
                </div>

                <code>http://www.osaa.org/api/activities</code><br />
                <code>http://www.osaa.org/api/activities/{slug}</code><br /><br />
                
                <table>
                    <tr>
                        <td>id</td>
                        <td>integer</td>
                        <td>Unique identification number</td>
                    </tr>
                    <tr>
                        <td>slug</td>
                        <td>string</td>
                        <td>A unique, three character abbreviation</td>
                    </tr>
                    <tr>
                        <td>name</td>
                        <td>string</td>
                        <td>Name of the activity</td>
                    </tr>
                    <tr>
                        <td>divisions</td>
                        <td>array</td>
                        <td>JSON array of strings of the sanctioned divisions</td>
                    </tr>
                    <tr>
                        <td>year</td>
                        <td>integer</td>
                        <td>The school year for which this information applies</td>
                    </tr>

                </table>
                
                <br />

                <div class="example">                
                    http://www.osaa.org/api/activities/fbl?year=2014<br /><br />                    
                    [{"id":101,"slug":"FBL","name":"Football","divisions":["6A","5A","4A","3A","2A","1A"],"year":2014}]<br /><br />
                    HTTP/1.1 200 OK<br />
                    Connection: Close<br />
                    Content-Type: application/json<br />
                    Content-Length: 99<br />
                    Content-Count: 1
                </div>

            </dd> 
        </dl>
    </p>

    <br />

    <p>
        <dl style="border-left: 4px solid #FFBBBB;">
            <dt><b>Schools</b> - A school is an OSAA full member school that hosts at least one activity.  To get a list of all schools or a specific school with a given short name (slug) or id number:<br /><br /></dt>
            <dd>
                <div class="filter_list">
                    <b>Optional Parameters</b><br />
                    <code>year</code><br />                    
                </div>

                <code>http://www.osaa.org/api/schools</code><br />                
                <code>http://www.osaa.org/api/schools/{slug}</code><br />
                <code>http://www.osaa.org/api/schools/{id}</code><br /><br />
                
                <table>
                    <tr>
                        <td>id</td>
                        <td>integer</td>
                        <td>Unique identification number</td>
                    </tr>
                    <tr>
                        <td>name</td>
                        <td>string</td>
                        <td>Full name of the school</td>
                    </tr>
                    <tr>
                        <td>short_name</td>
                        <td>string</td>
                        <td>Shortened name of the school with common words removed or abbreviated</td>
                    </tr>
                    <tr>
                        <td>classification</td>
                        <td>string</td>
                        <td>School's classification</td>
                    </tr>
                    <tr>
                        <td>league</td>
                        <td>string</td>
                        <td>School's regularly assigned league</td>
                    </tr>
                    <tr>
                        <td>mascot</td>
                        <td>object</td>
                        <td>JSON object of school's mascot(s) containing (<code>main</code>, <code>alternate</code>, <code>url</code>) strings</td>
                    </tr>
                    <tr>
                        <td>colors</td>
                        <td>array</td>
                        <td>JSON array of the school's colors (up to three) containing JSON objects with (<code>name</code>, <code>hex</code>) strings</td>
                    </tr>
                    <tr>
                        <td>year</td>
                        <td>integer</td>
                        <td>The school year for which this information applies</td>
                    </tr>

                </table>
                
                <br />

                <div class="example">                
                    http://www.osaa.org/api/schools/Corvallis<br /><br />                    
                    [{"id":12,<br />&nbsp;
                      "name":"Corvallis High School",<br />&nbsp;
                      "short_name":"Corvallis",<br />&nbsp;
                      "classification":"5A",<br />&nbsp;
                      "league":"5A-2",<br />&nbsp;
                      "mascot":{"main":"Spartans",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "alternate":null,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "url":"http://www.osaa.org/images/logo?school=12"},<br />&nbsp;
                      "colors":[{"name":"Columbia Blue","hex":"#75B2DD"},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      {"name":"Navy","hex":"#000080"},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      {"name":"White","hex":"#FFFFFF"}],<br />&nbsp;
                      "year":2013]}<br /><br />
                    HTTP/1.1 200 OK<br />
                    Connection: Close<br />
                    Content-Type: application/json<br />
                    Content-Length: 348<br />
                    Content-Count: 1
                </div>

            </dd> 
        </dl> 
    </p>

    <br />

    <p>
        <dl style="border-left: 4px solid #BBE9FF;">
            <dt><b>Teams</b> - A team is an instance of an activity program for a school competing at a specific level.  To get a list of all teams, a specific team by id number, all teams pertaining to an activity slug, all teams for a specific school, or a specific team with a school/activity slug combination:<br /><br /></dt>
            <dd>
                <div class="filter_list">
                    <b>Optional Parameters</b><br />
                    <code>level</code>, <code>year</code><br />
                </div>

                <code>http://www.osaa.org/api/teams</code><br />
                <code>http://www.osaa.org/api/teams/{id}</code><br />
                <code>http://www.osaa.org/api/teams/{activity}</code><br />
                <code>http://www.osaa.org/api/teams/{school}</code><br />
                <code>http://www.osaa.org/api/teams/{school}/{activity}</code><br /><br />
                
                <table>
                    <tr>
                        <td>id</td>
                        <td>integer</td>
                        <td>Unique identification number</td>
                    </tr>
                    <tr>
                        <td>name</td>
                        <td>string</td>
                        <td>Name (school or coop name)</td>
                    </tr>                    
                    <tr>
                        <td>level</td>
                        <td>string</td>
                        <td>Competition level</td>
                    </tr>
                    <tr>
                        <td>activity</td>
                        <td>string</td>
                        <td>Sport</td>
                    </tr>
                    <tr>
                        <td>division</td>
                        <td>string</td>
                        <td>Division in which this team competes</td>
                    </tr>
                    <tr>
                        <td>league</td>
                        <td>string</td>
                        <td>League this team is assigned to, if any</td>
                    </tr>                    
                    <tr>
                        <td>year</td>
                        <td>integer</td>
                        <td>The school year for which this information applies</td>
                    </tr>
                    <tr>
                        <td>overall_record</td>
                        <td>string</td>
                        <td>Record of all contests won, lost, and/or tied; wins-losses-ties</td>
                    </tr>                    
                    <tr>
                        <td>league_record</td>
                        <td>string</td>
                        <td>Record of league contests won, lost, and/or tied; wins-losses-ties</td>
                    </tr>
                    <tr>
                        <td>league_finish</td>
                        <td>integer</td>
                        <td>Final league placement, if any</td>
                    </tr>
                    <tr>
                        <td>osaa_rank</td>
                        <td>integer</td>
                        <td>*Team's OSAA ranking compared to other teams in the division</td>
                    </tr>                    
                    <tr>
                        <td>apr</td>
                        <td>integer</td>
                        <td>*Adjusted playoff ranking, if any</td>
                    </tr>
                    <tr>
                        <td>rpi_rank</td>
                        <td>integer</td>
                        <td>*Team's RPI ranking compared to other teams' RPI values in the division</td>
                    </tr>
                    <tr>
                        <td>rpi</td>
                        <td>float</td>
                        <td>*Rating percentage index; range [0, 1]</td>
                    </tr>
                    <tr>
                        <td>wwp</td>
                        <td>float</td>
                        <td>*Weighted winning percentage; range [0, 1]</td>
                    </tr>
                    <tr>
                        <td>owp</td>
                        <td>float</td>
                        <td>*Opponents' winning percentage; range [0, 1]</td>
                    </tr>
                    <tr>
                        <td>colley_rank</td>
                        <td>integer</td>
                        <td>*Team's Colley ranking compared to other teams' Colley values in the division</td>
                    </tr>
                    <tr>
                        <td>colley</td>
                        <td>float</td>
                        <td>*Colley rating</td>
                    </tr>
                    <tr>
                        <td>roster</td>
                        <td>array</td>
                        <td>**JSON array of the roster of players containing JSON objects</td>
                    </tr>
                    <tr>
                        <td>photo_url</td>
                        <td>string</td>
                        <td>Full URL path to the team photo, if any</td>
                    </tr>
                    <tr>
                        <td>updated_at</td>
                        <td>string</td>
                        <td>Date/time of when the team's information was last updated</td>
                    </tr>
                    <tr>
                        <td>calculated_at</td>
                        <td>string</td>
                        <td>Date/time of when the team's ranking specific information was last calculated</td>
                    </tr>

                </table>
                
                <br />

                <div class="example">                
                    http://www.osaa.org/api/teams/9552<br /><br />                    
                    [{"id":9552,<br />&nbsp;
                      "name":"Philomath",<br />&nbsp;
                      "level":"V",<br />&nbsp;
                      "activity":"BBX",<br />&nbsp;
                      "division":"4A",<br />&nbsp;
                      "league":"4A-4 (2014-2017)",<br />&nbsp;
                      "year":2014,<br />&nbsp;
                      "overall_record":"22-2-0",<br />&nbsp;
                      "league_record":"9-1-0",<br />&nbsp;
                      "league_finish":"1",<br />&nbsp;
                      "osaa_rank":2,<br />&nbsp;
                      "apr":2,<br />&nbsp;
                      "rpi_rank":2,<br />&nbsp;
                      "rpi":0.680189636748686,<br />&nbsp;
                      "wwp":0.928571428571429,<br />&nbsp;
                      "owp":0.546445594997978,<br />&nbsp;
                      "colley_rank":1,<br />&nbsp;
                      "colley":0.949374037551917,<br />&nbsp;
                      "roster":[{"home_number":"4",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                 "away_number":"4",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                 "is_captain":null,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                 "name":"Jack Doe",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                 "position":"G",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                 "position_2":"",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                 "grade":"12",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                 "height":"5-9",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                 "weight":""}, ... ],<br />&nbsp;
                      "team_photo":"http://www.osaa.org/images/team_photos/9552.jpg",<br />&nbsp;
                      "updated_at":"2015-03-05 09:00:01",<br />&nbsp;
                      "calculated_at":"2015-02-24 22:44:30"}]<br /><br />
                    HTTP/1.1 200 OK<br />
                    Connection: Close<br />
                    Content-Type: application/json<br />
                    Content-Length: 2453<br />
                    Content-Count: 1
                </div>

                <br />

                <div style="font-size: 9pt;">
                    *The OSAA uses a modified RPI and a Colley rankings system.  These systems are only used to calculate bracket matchups and team placements for the teams that have qualified for the OSAA Championships.
                    <div style="margin-left: 40px;">
                        For more information on team rankings, please refer to the <a href="<?php echo url('/help/rankings'); ?>" target="_blank">Rankings Frequently Asked Questions</a>.
                    </div>

                     <br />

                    **Rosters are returned as a JSON array of JSON objects.  Each object represents a participant on the team and will contain the following values:
                    <div style="margin-left: 40px;">                         
                        <div style="width: 135px; display: inline-block;">home_number</div>Integer - participant's home jersey number, if any<br />
                        <div style="width: 135px; display: inline-block;">away_number</div>Integer - participant's away jersey number, if any<br />
                        <div style="width: 135px; display: inline-block;">is_captain</div>Boolean - true if the participant is a team captain, false or null otherwise<br />
                        <div style="width: 135px; display: inline-block;">name</div>String - full name of the participant, expected to be in "First Last" format<br />
                        <div style="width: 135px; display: inline-block;">position</div>String - abbreviation for the position this participant fills on the team, if any<br />
                        <div style="width: 135px; display: inline-block;">position_2</div>String - abbreviation for the second or alternate position this participant fills on the team, if any<br />
                        <div style="width: 135px; display: inline-block;">grade</div>Integer - grade in school for this participant (9 = freshman, 10 = sophomore, 11 = junior, 12 = senior)<br />
                        <div style="width: 135px; display: inline-block;">height</div>String - participant's height, if any; expected to be in "FT-IN" format of two integers, i.e. "6-0" represents 6 feet and 0 inches in height<br />
                        <div style="width: 135px; display: inline-block;">weight</div>Integer - participant's weight, in US pounds, if any and only for the sport of football<br />
                    </div>
                </div>

            </dd> 
        </dl> 
    </p>

    <br />

    <p>
        <dl style="border-left: 4px solid #34C60E;">
            <dt><b>Schedules</b> - A schedule is a collection of contests for a specific team.  Schedules are referenced by team ID.<br /><br /></dt>
            <dd>
                <code>http://www.osaa.org/api/schedules/{id}</code><br /><br />
                
                <div style="">
                    See <b>Contests</b> node for data definitions.  A schedule returns an array of contests* for the given team ID.

                    <br /><br />
                    
                    <div style="font-size: 9pt;">
                        *Schedules will include all contests input by the schools.  For tracking purposes, soft deleting is supported.  Contests that have been deleted and removed from a schedule will have a status of <code>DEL</code>.  Deleted contests should be treated as non-existent as they are not recoverable (i.e. once a contest is deleted, it will not be reinstated.)
                    </div>

                </div>

            </dd> 
        </dl> 
    </p>

    <br />

    <p>
        <dl style="border-left: 4px solid #C9FFBB;">
            <dt><b>Contests</b> - A contest is an instance of two teams competing against each other in a team sport activity on a certain date.  A single contest can be accessed by ID number.  A collection of contests for a specific activity can be returned or narrowed down to contests for that activity on a specific date.  Contests for any activity on a specific date can also be accessed.<br /><br /></dt>
            <dd>
                <div class="filter_list">
                    <b>Optional Parameters</b><br />
                    <code>level</code>, <code>year</code><br />
                </div>

                <code>http://www.osaa.org/api/contests/{id}</code><br />
                <code>http://www.osaa.org/api/contests/{activity}</code><br />
                <code>http://www.osaa.org/api/contests/{activity}/{date}</code><br />
                <code>http://www.osaa.org/api/contests/{date}</code><br /><br />
                
                <table>
                    <tr>
                        <td>id</td>
                        <td>integer</td>
                        <td>Unique identification number</td>
                    </tr>
                    <tr>
                        <td>year</td>
                        <td>integer</td>
                        <td>The school year for which this information applies</td>
                    </tr>
                    <tr>
                        <td>activity</td>
                        <td>string</td>
                        <td>Sport</td>
                    </tr>
                    <tr>
                        <td>type</td>
                        <td>string</td>
                        <td>*Type of the activity</td>
                    </tr>                                                            
                    <tr>
                        <td>division</td>
                        <td>string</td>
                        <td>Division, highest division if teams compete at different divisions</td>
                    </tr>
                    <tr>
                        <td>is_cross_division</td>
                        <td>boolean</td>
                        <td>True if the teams compete at different divisions, false if teams are in the same division</td>
                    </tr>
                    <tr>
                        <td>level</td>
                        <td>string</td>
                        <td>Competition level, highest level if teams compete at different levels</td>
                    </tr> 
                    <tr>
                        <td>is_cross_level</td>
                        <td>boolean</td>
                        <td>True if the teams compete at different levels, false if teams are in the same level</td>
                    </tr>                   
                    <tr>
                        <td>league</td>
                        <td>string</td>
                        <td>League slug, if this contest is a league contest</td>
                    </tr>  
                    <tr>
                        <td>is_scoreable</td>
                        <td>boolean</td>
                        <td>True if this contest will yield a score, false if the contest does not allow a score to be entered</td>
                    </tr>             
                    <tr>
                        <td>status</td>
                        <td>string</td>
                        <td>**Scheduling status of the event</td>
                    </tr>                    
                    <tr>
                        <td>time_zone</td>
                        <td>string</td>
                        <td>Time zone slug</td>
                    </tr>   
                    <tr>
                        <td>start_at</td>
                        <td>string</td>
                        <td>Date/time of when the contest starts</td>
                    </tr>
                    <tr>
                        <td>postpone_at</td>
                        <td>string</td>
                        <td>Date/time of when the contest is postponed to</td>
                    </tr>
                    <tr>
                        <td>location</td>
                        <td>string</td>
                        <td>Alternate contest location, if any; if none, contest is held at home team's school</td>
                    </tr>
                    <tr>
                        <td>is_neutral</td>
                        <td>boolean</td>
                        <td>True if the contest's location is a neutral site, false otherwise; used in rankings calculations</td>
                    </tr>                    
                    <tr>
                        <td>is_tournament</td>
                        <td>boolean</td>
                        <td>True if the contest is part of a tournament, false otherwise</td>
                    </tr>
                    <tr>
                        <td>tournament</td>
                        <td>string</td>
                        <td>Name of the tournament, if any</td>
                    </tr>
                    <tr>
                        <td>is_endowment</td>
                        <td>boolean</td>
                        <td>True if the contest is an endowment game, false otherwise</td>
                    </tr>
                    <tr>
                        <td>home</td>
                        <td>object</td>
                        <td>***JSON object of the home team, contains (<code>id</code>) integer, (<code>name</code>, <code>score</code>, <code>sub_scores</code>) strings, (<code>is_win</code>, <code>is_tie</code>, <code>is_forfeit</code>, <code>is_recordable</code>, <code>is_league_recordable</code>, <code>is_rankable</code>) booleans, and (<code>weight</code>, <code>points</code>) floats</td>
                    </tr>
                    <tr>
                        <td>away</td>
                        <td>object</td>
                        <td>***JSON object of the away team, contains (<code>id</code>) integer, (<code>name</code>, <code>score</code>, <code>sub_scores</code>) strings, (<code>is_win</code>, <code>is_tie</code>, <code>is_forfeit</code>, <code>is_recordable</code>, <code>is_league_recordable</code>, <code>is_rankable</code>) booleans, and (<code>weight</code>, <code>points</code>) floats</td>
                    </tr>
                    <tr>
                        <td>is_forfeit</td>
                        <td>boolean</td>
                        <td>True if this contest was forfeited by the losing team (in which case refer to comments for more information), false otherwise</td>
                    </tr>
                    <tr>
                        <td>is_swap_designation</td>
                        <td>boolean</td>
                        <td>True if teams swapped designation; i.e. home team bats first, false otherwise; used in rankings calculations for baseball and softball contests only</td>
                    </tr>
                    <tr>
                        <td>oos_record</td>
                        <td>string</td>
                        <td>Out-of-state opponent's record, if any, in W-L or W-L-T format</td>
                    </tr>
                    <tr>
                        <td>oos_updated_at</td>
                        <td>string</td>
                        <td>Date/time of when the out-of-state opponent's record information was last updated, if applicable</td>
                    </tr>                    
                    <tr>
                        <td>comments</td>
                        <td>string</td>
                        <td>Comments or notes about this contest, if any</td>
                    </tr>
                    <tr>
                        <td>overtime_notes</td>
                        <td>string</td>
                        <td>Details entered if the contest went into overtime, extra innings, or extra sets</td>
                    </tr>
                    <tr>
                        <td>updated_at</td>
                        <td>string</td>
                        <td>Date/time of when the contest's information was last updated</td>
                    </tr>
                    <tr>
                        <td>created_at</td>
                        <td>string</td>
                        <td>Date/time of when this contest was created</td>
                    </tr>
                </table>
                
                <br />

                <div class="example">                
                    http://www.osaa.org/api/contests/14043<br /><br />                    
                    [{"id":14043,<br />&nbsp;
                      "year":2013,<br />&nbsp;
                      "activity":"VBL",<br />&nbsp;
                      "type":"PO",<br />&nbsp;
                      "division":"6A",<br />&nbsp;
                      "is_cross_division":false,<br />&nbsp;
                      "level":"V",<br />&nbsp;
                      "is_cross_level":false,<br />&nbsp;
                      "league":null,<br />&nbsp;
                      "is_scoreable":true,<br />&nbsp;
                      "status":"DONE",<br />&nbsp;
                      "time_zone":"PT",<br />&nbsp;
                      "start_at":"2013-11-09 20:30:00",<br />&nbsp;
                      "postpone_at":null,<br />&nbsp;
                      "location":"Court 1",<br />&nbsp;
                      "is_neutral":false,<br />&nbsp;
                      "is_tournament":false,<br />&nbsp;
                      "tournament":null,<br />&nbsp;
                      "is_endowment":false,<br />&nbsp;
                      "home":{"id":3218,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "name":"Central Catholic",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "score":"1",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "sub_scores":"29,25,12,22",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "is_win":false,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "is_tie":false,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "is_forfeit":false,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "is_recordable":true,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "is_league_recordable":false,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "is_rankable":false,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "weight":1.2,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "points":0},<br />&nbsp;
                      "away":{"id":556,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "name":"Lakeridge",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "score":"3",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "sub_scores":"31,23,25,25",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "is_win":true,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "is_tie":false,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "is_forfeit":false,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "is_recordable":true,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "is_league_recordable":false,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "is_rankable":false,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "weight":1.2,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      "points":1.2},<br />&nbsp;
                      "is_forfeit":false,<br />&nbsp;
                      "is_swap_designation":false,<br />&nbsp;
                      "oos_record":null,<br />&nbsp;
                      "oos_updated_at":null,<br />&nbsp;
                      "comments":null,<br />&nbsp;
                      "overtime_notes":null,<br />&nbsp;
                      "updated_at":"2013-11-09 22:26:55",<br />&nbsp;
                      "created_at":"2013-10-28 18:25:04"}]<br /><br />
                    HTTP/1.1 200 OK<br />
                    Connection: Close<br />
                    Content-Type: application/json<br />
                    Content-Length: 994<br />
                    Content-Count: 1
                </div>

                <br />

                <div style="font-size: 9pt;">
                    *All contests have one and only one contest type.  Contest types are returned by their slug and are defined as follows:
                    <div style="margin-left: 40px;">
                        <div style="width: 60px; display: inline-block;">J</div>Jamboree <i>(a practice or partial contest, will not have a score)</i><br />
                        <div style="width: 60px; display: inline-block;">EX</div>Exhibition <i>(an unranked contest that only counts toward overall record)</i><br />
                        <div style="width: 60px; display: inline-block;">A</div>Alumni <i>(an unranked contest that only counts toward overall record played between a school's team and alumni members)</i><br />
                        <div style="width: 60px; display: inline-block;">NL</div>Non-League <i>(a ranked contest between opponents from different leagues)</i><br />
                        <div style="width: 60px; display: inline-block;">L</div>League <i>(a ranked contest between opponents from the same league)</i><br />
                        <div style="width: 60px; display: inline-block;">LPO</div>League Playoff <i>(a ranked contest between opponents from the same league that does not count toward the teams' league records)</i><br />
                        <div style="width: 60px; display: inline-block;">PI</div>Play-In <i>(an unranked contest that only counts toward overall record)</i><br />
                        <div style="width: 60px; display: inline-block;">PO</div>Playoff <i>(an unranked contest that is part of the OSAA Championships and is counted on the overall record)</i>
                    </div>

                    <br />

                    **All contests have one and only one event status.  The event status will be returned by its slug, defined as follows:
                    <div style="margin-left: 40px;">
                        <div style="width: 60px; display: inline-block;">PND</div>Pending <i>(event is waiting for confirmation or authorization with no guarantee that it will be played)</i><br />
                        <div style="width: 60px; display: inline-block;">DEL</div>Deleted <i>(the event has been deleted from a schedule; soft delete support)</i><br />
                        <div style="width: 60px; display: inline-block;">SCHD</div>Scheduled <i>(event is confirmed to take place on the scheduled start date/time)</i><br />
                        <div style="width: 60px; display: inline-block;">CXL</div>Canceled <i>(event had been scheduled, but it never started so it has since been canceled; CXL contests can be rescheduled, but only as a new event)</i><br />
                        <div style="width: 60px; display: inline-block;">PPD</div>Postponed <i>(event delayed to a future date/time; a PPD contest will revert to SCHD at midnight on the day the contest was originally scheduled)</i><br />
                        <div style="width: 60px; display: inline-block;">LIVE</div>Live <i>(event has started and awaiting a score to be entered)</i><br />
                        <div style="width: 60px; display: inline-block;">DONE</div>Done <i>(the event had started and is now over; usually a LIVE contest changes to DONE once a score is entered)</i>
                    </div>

                    <br />

                    ***Contest team data returned for home and away teams includes several items.  Most items pertain to rankings calculations.  A more in-depth explanation of those data items is below:
                    <div style="margin-left: 40px;">                         
                        <div style="width: 135px; display: inline-block;">id</div>Integer - team's unique identification number, if any (OOS teams do not have id numbers)<br />
                        <div style="width: 135px; display: inline-block;">name</div>String - team's display name; OOS teams have their state in parentheses, lower level team has its level in square brackets if cross level<br />
                        <div style="width: 135px; display: inline-block;">score</div>String - team's final, overall score<br />
                        <div style="width: 135px; display: inline-block;">sub_scores</div>String - team's final, sub-score (period scores, quarter scores, innings, sets, etc.)<br />
                        <div style="width: 135px; display: inline-block;">is_win</div>Boolean - true if this team won the contest, false if the team did not win (could be a loss of a tie)<br />
                        <div style="width: 135px; display: inline-block;">is_tie</div>Boolean - true if the contest was tied<br />
                        <div style="width: 135px; display: inline-block;">is_forfeit</div>Boolean - true if this team forfeited the contest<br />
                        <div style="width: 135px; display: inline-block;">is_recordable</div>Boolean - true if the contest counts towards this team's overall record<br />
                        <div style="width: 135px; display: inline-block;">is_league_recordable</div>Boolean - true if the contest counts towards this team's league record<br />
                        <div style="width: 135px; display: inline-block;">is_rankable</div>Boolean - true if the contest counts towards this team's ranking<br />
                        <div style="width: 135px; display: inline-block;">weight</div>Float - the overall game weight or potential impact for this team<br />
                        <div style="width: 135px; display: inline-block;">points</div>Float - the number of points (0 up to the weight) this team earned for its win/loss/tie
                    </div>
                </div>

            </dd> 
        </dl> 
    </p>

    <br />

    <p>
        <dl style="border-left: 4px solid #FAD67A;">
            <dt><b>Leagues</b> - This node has a handle for accessing regular leagues and activity/league instances.  To narrow down a collection of regular leagues or activity/league instances to a specific league, use the optional <code>league</code> parameter.  The value of this parameter should be the league slug.<br /><br /></dt>
            <dd>
                <div class="filter_list">
                    <b>Optional Parameters</b><br />
                    <code>year, league</code><br />
                </div>

                <code>http://www.osaa.org/api/leagues</code><br />                                                
                <code>http://www.osaa.org/api/leagues/{activity}</code><br /><br />
                
                <table class="float_left">
                    <tr>
                        <td>id</td>
                        <td>integer</td>
                        <td>Unique identification number</td>
                    </tr>
                    <tr>
                        <td>slug</td>
                        <td>string</td>
                        <td>Unique identification string composed of the division and league number within that division</td>
                    </tr>
                    <tr>
                        <td>name</td>
                        <td>string</td>
                        <td>Full name of the league</td>
                    </tr>
                    <tr>
                        <td>divisions</td>
                        <td>array</td>
                        <td>JSON array of division slug strings spanned by this league</td>
                    </tr>   
                    <tr>
                        <td>year</td>
                        <td>integer</td>
                        <td>The school year for which this information applies</td>
                    </tr>                 
                    <tr>
                        <td>schools</td>
                        <td>array</td>
                        <td>*JSON array of schools, if any, in this league containing JSON objects with (<code>id</code>, <code>short_name</code>) pairs</td>
                    </tr>
                    <tr>
                        <td>activity</td>
                        <td>string</td>
                        <td>*Activity slug, if any, for this league</td>
                    </tr>
                    <tr>
                        <td>teams</td>
                        <td>array</td>
                        <td>*JSON array of teams, if any, in this activity league containing JSON objects with (<code>id</code>, <code>name</code>) pairs</td>
                    </tr>
                </table>
                
                <br class="clear" /><br />

                <div class="example">                
                    http://www.osaa.org/api/leagues/bsc?league=5A-1
                    <br /><br />
                    [{"id":24,<br />&nbsp;
                      "slug":"5A-1",<br />&nbsp;
                      "name":"5A-1 Northwest Oregon Conference",<br />&nbsp;
                      "divisions":["5A"],<br />&nbsp;
                      "year":2013,<br />&nbsp;
                      "schools":null,<br />&nbsp;
                      "activity":"BSC",<br />&nbsp;
                      "teams":[{"id":91,"name":"Putnam"},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                               {"id":824,"name":"Sandy"},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                               {"id":1271,"name":"Parkrose"},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                               {"id":1818,"name":"Sherwood"},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                               {"id":2332,"name":"St. Helens"},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                               {"id":3001,"name":"Wilsonville"},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                               {"id":4270,"name":"Liberty"},<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                               {"id":4432,"name":"Milwaukie \/ Milwaukie Acad. of the Arts"}]}]
                    <br /><br />
                    HTTP/1.1 200 OK<br />
                    Connection: Close<br />
                    Content-Type: application/json<br />
                    Content-Length: <br />
                    Content-Count: 1
                </div>

                <br />

                <div style="font-size: 9pt;">
                    *Leagues can be associated with or without an activity.  If <code>activity</code> is not provided (null), then the collection returned will be regular league assignments and not activity specific.  In such cases, an array of <code>schools</code> is returned with each collection item.  Those listed schools are normally assigned to that league.  The <code>activity</code> field and <code>teams</code> array will be null.
                    <br /><br />
                    If the <code>activity</code> field is not null, then the league is an activity specific league.  Each league returned in the collection will have a list of <code>teams</code> that are assigned to that specific activity/league combination and the <code>schools</code> array will be null.  Only varsity level teams are returned.                    
                </div>

            </dd> 
        </dl> 
    </p>

<?php $__env->stopSection(); ?>