API: Full Term List For LA/District/Region/Province etc.

Description: Get all of the future dates available for a specific school, district or region.

Example 1, get all term dates for a specific district, region, province of area.

Destination: http://myschoolholidays.com/api/getTermDates?district_id=1

Response:

{"0":{"start":"2012-09-03","end":"2012-10-26","term_number":"1","start_year":"2012","date_id":"4515","label":null},"1":{"start":"2012-11-01","end":"2012-12-21","term_number":"2","start_year":"2012","date_id":"4517","label":null},"2":{"start":"2013-01-02","end":"2013-02-15","term_number":"3","start_year":"2012","date_id":"4519","label":null},"3":{"start":"2013-02-21","end":"2013-03-28","term_number":"4","start_year":"2012","date_id":"4521","label":null},"4":{"start":"2013-04-15","end":"2013-05-24","term_number":"5","start_year":"2012","date_id":"4523","label":null},"5":{"start":"2013-06-03","end":"2013-07-24","term_number":"6","start_year":"2012","date_id":"4525","label":null},"url":"http:\/\/gb.myschoolholidays.com\/Bradford"}

Example code for developers to work with

PHP..

< ?php
$ch = curl_init ("http://myschoolholidays.com/api/getTermDates?district_id=1");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
$dates = json_decode($output);
print_r($dates); // An object containing the district term dates..
?>

Example 2, get all term dates for a specific school

Destination: http://myschoolholidays.com/api/getTermDates?school_id=8639

Response:

{"0":{"start":"2012-09-03","end":"2012-10-26","term_number":"1","start_year":"2012","date_id":"4515","label":null},"1":{"start":"2012-11-01","end":"2012-12-21","term_number":"2","start_year":"2012","date_id":"4517","label":null},"2":{"start":"2013-01-02","end":"2013-02-15","term_number":"3","start_year":"2012","date_id":"4519","label":null},"3":{"start":"2013-02-21","end":"2013-03-28","term_number":"4","start_year":"2012","date_id":"4521","label":null},"4":{"start":"2013-04-15","end":"2013-05-24","term_number":"5","start_year":"2012","date_id":"4523","label":null},"5":{"start":"2013-06-03","end":"2013-07-24","term_number":"6","start_year":"2012","date_id":"4525","label":null},"url":"http:\/\/gb.myschoolholidays.com\/Whateverschool"}

Example code for developers to work with

PHP..

< ?php
$ch = curl_init ("http://myschoolholidays.com/api/getTermDates?school_id=8639");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
$dates = json_decode($output);
print_r($dates); // An object containing the school term dates..
?>

0