PHP code example of tuowt / mpms-hkep

1. Go to this page and download the library: Download tuowt/mpms-hkep library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

tuowt / mpms-hkep example snippets


use Hkep\Factory;

$config = [
    'bearer'     => 'token', // OAuth2.0获取到的access_token
    'accessToken' => 'token',// OAuth2.0获取到的access_token
];

$app = Factory::auth($config);

// 获取用户信息 可选参数 $academicYear = 学年
$result = $app->user->userinfo($academicYear = null);
pr($result);

// 必填参数$membercode = 會員代碼, 可选参数 $prodcode = HKEP 產品代碼
$result = $app->user->logout($membercode, $prodcode = null);
pr($result);

// 可选参数 $lite = 0,简化模式;1,一般模式,默认简化模式
$result = $app->user->permission($lite = 0);
pr($result);

// 必填参数$classid = 班级编号
$result = $app->student->getStudentsByClass($classid);
pr($result);