====== Student Information System (Classic) Developer Guide ======
Information in here is for the classic edition of the Pacific SIS which is no longer in use. Refer to the current version at [[sis_developer_manual|Student Information System Developer Guide]]
===== RESTful API =====
Extracting the data from the SIS programmatically is done through its RESTful API. The API can pull student enrollment data, school information data and staff information data. You will need to login as a SuperAdmin.
Under Tools menu, you will see API Token submenu. Click on it to generate API Tokens.
{{ :sis-user-manual:opensis-restful-api-1.png?nolink |}}
If you do not see it, then give yourself permission. Go to Users->Setup->Profiles and select
the Super Administrator. Scroll down to the Tools section and make sure the access to the API
is turned on. It should look like this:
{{ :sis-user-manual:opensis-restful-api-2.png?nolink |}}
If the API token menu is turned on, select that to generate the API token.
To generate a new token, click generate button. Once you click the Generate button a new Key
and Secret will be generated. This Key and Secret values will be needed to access the APIs.
You can generate multiple tokens and they will all be valid for accessing APIs.
{{ :sis-user-manual:opensis-restful-api-3.png?nolink |}}
You can test the APIs via URL using a recent browser that decodes the JSON in
a proper format.
For Student Enrollment Information, do this:
https://yoursis.domain.name/api/StudentEnrollmentInfo.php?api_key=&api_secret=&sch_year=&format=
For example if key=zuwYEmB5Kg, secret=14dd1c998bacf7200a9c92932dee86fa, format=json, school year=2018 then the URL will be:
https://yoursis.domain.name/api/StudentEnrollmentInfo.php?api_key=zuwYEmB5Kg&api_secret=14dd1c998bacf7200a9c92932dee86fa& sch_year=2018&format=json
For School Information, do this:
https://yoursis.domain.name/api/SchoolInfo.php?api_key=&api_secret=
For example if key=zuwYEmB5Kg, secret=14dd1c998bacf7200a9c92932dee86fa, format=json then the URL will be:
https://yoursis.domain.name/api/SchoolInfo.php?api_key=zuwYEmB5Kg&api_secret=14dd1c998bacf7200a9c92932dee86fa&format=json
For Staff Information, do this:
http://yoursis.domain.name/api/StaffInfo.php?api_key=&api_secret=&sch_year=&format=
Fore example if key=zuwYEmB5Kg, secret=14dd1c998bacf7200a9c92932dee86fa, format=json, school year=2018 then the URL will be:
https://yoursis.domain.name/api/StaffInfo.php?api_key=zuwYEmB5Kgapi_secret=14dd1c998bacf7200a9c92932dee86fa&sch_year=2018&format=json
An example of using the API in code code (e.g. in PHP code), run the following code to retrieve the student enrollment information API.
$url = 'http://fedsis.doe.fm:88/api/StudentEnrollmentInfo.php?' .http_build_query(
[
'api_key' => ' zuwYEmB5Kg ' ,
'api_secret' => ' 14dd1c998bacf7200a9c92932dee86fa ' ,
'sch_year' => '2018' ,
'format' => 'json' ,
]
);
$ch = curl_init( $url );
curl_setopt( $ch , CURLOPT_CONNECTTIMEOUT, 3600);
curl_setopt( $ch , CURLOPT_TIMEOUT, 3600);
curl_setopt( $ch , CURLOPT_RETURNTRANSFER, true);
curl_setopt( $ch , CURLOPT_SSL_VERIFYPEER, false);
curl_setopt( $ch , CURLOPT_SSL_VERIFYHOST, false);
curl_setopt( $ch , CURLOPT_POST, true);
$response = curl_exec( $ch );