REG API V1.2
Bureau of Academic Administration and Development , Khon Kaen University
Base URLs:
- https://reg2.kku.ac.th/api/v1.2
Base URL for Dev
- https://reg2.kku.ac.th:8081
Contact : kritssa@kku.ac.th
Authentication
App Authentication
POST /oauth/token
For Application authentication.
oAuth2 authentication.
- Grant Type : password
Get Access Token By REG-Account
Example Code
var form = new FormData();
form.append("username", "");
form.append("password", "");
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/auth/login/reg-account",
"method": "POST",
"timeout": 0,
"processData": false,
"mimeType": "multipart/form-data",
"contentType": false,
"data": form,
"headers":headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers = [
'Accept'=>'application/json',
'Authorization'=>'Bearer {bearer-token}',
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('POST','https://reg2.kku.ac.th/api/v1.2/auth/login/reg-account', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
} ?>
curl --location --request POST "https://reg2.kku.ac.th/api/v1.2/auth/login/reg-account" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}'
--form "username=" \
--form "password="
Example responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "Success",
"data": {
"access_token": "string",
"payload": {
"application": {
"id": "number",
"app_name": "number"
},
"user": {
"user_id": "string",
"student_id": "string",
"citizen_id": "string",
"username": "string",
"mail": "string",
"firstname_th": "string",
"lastname_th": "string",
"firstname": "string",
"lastname": "string",
"level_id": "number",
"level_group_id": "3"
}
}
}
}
ขอ Token ด้วยบัญชีของระบบทะเบียน reg-account
POST /auth/login/reg-account
Parameters
| Parameter | In | Type | Require | Description |
|---|---|---|---|---|
| username | body | string | true | รหัสนักศึกษา |
| password | body | string | true | รหัสผ่านระบบทะเบียน |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| data | [object] | |
| » access_token | string | |
| » payload | [object] | |
| »» appllication | [object] | |
| »»» id | number | |
| »»» app_name | string | |
| »» user | [object] | |
| »»» user_id | string | รหัสนักศึกษา |
| »»» student_id | string | |
| »»» citizen_id | string | รหัสประชาชน |
| »»» username | string | รหัสนักศึกษา |
| string | อีเมล | |
| »»» firstname_th | string | ชื่อภาษาไทย |
| »»» lastname_th | string | นามสกุลภาษาไทย |
| »»» firstname | string | ชื่อภาษาอังกฤษ |
| »»» lastname | string | นามสกุลภาษาอังกฤษ |
Get Access Token By SSO-HashID
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'hash-id':' {hash-id}',
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/auth/login/sso-hash-id",
"method": "POST",
"timeout": 0,
"header":headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers = [
'Accept'=>'application/json',
'Authorization'=>'Bearer {bearer-token}',
'hash-id'=>'{hash-id}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('POST','https://reg2.kku.ac.th/api/v1.2/auth/login/sso-hash-id', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
} ?>
curl --location --request POST "https://reg2.kku.ac.th/api/v1.2/auth/login/sso-hash-id" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}'
-H 'hash-id: {hash-id}'
Example responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "Success",
"data": {
"access_token": "string",
"payload": {
"user": {
"user_id": "string",
"student_id": "string",
"citizen_id": "string",
"username": "string",
"mail": "string",
"firstname_th": "string",
"lastname_th": "string",
"firstname": "string",
"lastname": "string",
"level_id": "number",
"level_group_id": "3"
}
}
}
}
ขอ Token ด้วย Hash ID จาก KKU SSO
POST /auth/login/sso-hash-id
Headers Param
| Key | Value |
|---|---|
| hash-id | {SSO_HASH_ID} |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| data | [object] | |
| » access_token | string | |
| » payload | [object] | |
| »» appllication | [object] | |
| »»» id | number | |
| »»» app_name | string | |
| »» user | [object] | |
| »»» user_id | string | รหัสนักศึกษา |
| »»» student_id | string | |
| »»» citizen_id | string | รหัสประชาชน |
| »»» username | string | รหัสนักศึกษา |
| string | อีเมล | |
| »»» firstname_th | string | ชื่อภาษาไทย |
| »»» lastname_th | string | นามสกุลภาษาไทย |
| »»» firstname | string | ชื่อภาษาอังกฤษ |
| »»» lastname | string | นามสกุลภาษาอังกฤษ |
| »»» level_id | number | ระดับการศึกษา |
| »»» level_group_id | number | กลุ่มระดับการศึกษา |
Get Access Token By SSO Token
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'sso-token':' {sso-token}',
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/auth/login/sso",
"method": "POST",
"timeout": 0,
"header":headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers = [
'Accept'=>'application/json',
'Authorization'=>'Bearer {bearer-token}',
'sso-token'=>'{sso-token}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('POST','https://reg2.kku.ac.th/api/v1.2/auth/login/sso', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
// handle exception or api errors.
print_r($e->getMessage());
} ?>
curl --location --request POST "https://reg2.kku.ac.th/api/v1.2/auth/login/sso" \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}'
-H 'sso-token: {sso-token}'
Example responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "Success",
"data": {
"access_token": "string",
"payload": {
"application": {
"id": "number",
"app_name": "number"
},
"user": {
"user_id": "string",
"student_id": "string",
"citizen_id": "string",
"username": "string",
"mail": "string",
"firstname_th": "string",
"lastname_th": "string",
"firstname": "string",
"lastname": "string"
}
}
}
}
ขอ Token ด้วย SSO Token
POST /auth/login/sso
get SSO token
- https://sso-api.kku.ac.th/registrar-api.kku.ac.th/auth/saml
Headers Param
| Key | Value |
|---|---|
| sso-token | {SSO_ACCESS_TOKEN} |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| data | [object] | |
| » access_token | string | |
| » payload | [object] | |
| »» appllication | [object] | |
| »»» id | number | |
| »»» app_name | string | |
| »» user | [object] | |
| »»» user_id | string | รหัสนักศึกษา |
| »»» student_id | string | |
| »»» citizen_id | string | รหัสประชาชน |
| »»» username | string | รหัสนักศึกษา |
| string | อีเมล | |
| »»» firstname_th | string | ชื่อภาษาไทย |
| »»» lastname_th | string | นามสกุลภาษาไทย |
| »»» firstname | string | ชื่อภาษาอังกฤษ |
| »»» lastname | string | นามสกุลภาษาอังกฤษ |
Student
ส่วนสำหรับการดึงข้อมูลที่เกี่ยวข้องกับนักศึกษา
get_student_info
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'x-access-token':'{access-token}'
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/student/info",
"method": "get",
"timeout": 0,
"headers": headers,
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers=[
'Accept'=>'application/json',
'Authorization' => 'Bearer {bearer-token}',
'x-access-token' => '{access-token}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','https://reg2.kku.ac.th/api/v1.2/student/info', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}
?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/student/info \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
-H 'x-access-token: {access-token}'
Example responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "",
"student_info": {
"student_code": "string",
"prefix_name": "string",
"firstname_th": "string",
"lastname_th": "string",
"prefix": "string",
"firstname": "string",
"lastname": "string",
"faculty_id": "number",
"faculty_name": "string",
"faculty_name_eng": "string",
"program_id": "string",
"program_name": "string",
"citizen_id": "string",
"email": "string",
"student_year": "number",
"student_status": "number",
"student_status_name": "string",
"level_id": "number",
"level_name": "string",
"gpa": "double",
"credit_attempt": "integer",
"credit_satisfy": "integer",
"credit_point": "integer",
"grade_point": "integer",
"admit_acadyear": "number",
"admit_semester": "number",
"department_id": "number",
"campus_id": "number"
}
}
GET /student/info
ดึงข้อมูลส่วนตัวของนักศึกษา
Headers Param
| Key | Value |
|---|---|
| x-access-token | {ACCESS_TOKEN} |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| student_info | [object] | |
| » student_code | string | รหัสนักศึกษา |
| » prefix_name | string | คำนำหน้าชื่อ |
| » firstname_th | string | ชื่อภาษาไทย |
| » lastname_th | string | นามสกุลภาษาไทย |
| » prefix | string | คำนำหน้าชื่อภาษาอังกฤษ |
| » firstname | string | ชื่อภาษาอังกฤษ |
| » lastname | string | นามสกุลภาษาอังกฤษ |
| » faculty_id | string | รหัสคณะ |
| » faculty_name | string | ชื่อคณะ |
| » faculty_name_eng | string | ชื่อคณะภาษาอังกฤษ |
| » program_id | string | รหัสหลักสูตร |
| » program_name | string | ชื่อหลักสูตร |
| » citizen_id | string | รหัสประชาชน |
| string | อีเมล | |
| » student_year | number | ชั้นปีของนักศึกษา |
| » student_status | number | สถานะนักศึกษา |
| » student_status_name | string | ชื่อสถานะนักศึกษา |
| » level_id | number | รหัสของระดับการศึกษา |
| » level_name | string | ระดับการศึกษา |
| » gpa | double | เกรด |
| » credit_attempt | integer | หน่วยกิตที่ลง |
| » credit_satisfy | integer | หน่วยกิตที่ผ่าน |
| » credit_point | integer | หน่วยกิต |
| » grade_point | integer | คะแนนเกรด |
| » admit_acadyear | number | ปีการศึกษาที่เข้าศึกษา |
| » admit_semester | number | เทอมที่เข้าศึกษา |
| » department_id | number | รหัสภาควิชา |
| » campus_id | number | รหัสวิทยาเขต |
get_student_info_group_by_citizenid
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'x-access-token':'{access-token}'
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/student/info_group_by_citizenid/:citizen_id",
"method": "get",
"timeout": 0,
"headers": headers,
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers=[
'Accept'=>'application/json',
'Authorization' => 'Bearer {bearer-token}',
'x-access-token' => '{access-token}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','https://reg2.kku.ac.th/api/v1.2/student/info_group_by_citizenid/:citizen_id', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}
?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/student/info_group_by_citizenid/:citizen_id \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
-H 'x-access-token: {access-token}'
Example responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "get student data success.",
"student_info_list": [
{
"student_code": "string",
"firstname_th": "string",
"lastname_th": "string",
"faculty_id": "number",
"faculty_name": "string",
"program_id": "string",
"program_name": "string",
"citizen_id": "string",
"student_year": "number",
"student_status": "number",
"student_status_name": "string",
"level_id": "number",
"level_name": "string",
"gpa": "double",
"admit_acadyear": "number",
"admit_semester": "number"
}
]
}
GET /student/info_group_by_citizenid/:citizen_id
ดึงข้อมูลนักศึกษาทุกรหัสโดยใช้รหัสประชาชน
Headers Param
| Key | Value |
|---|---|
| x-access-token | {ACCESS_TOKEN} |
Path Parameters
| Parameter | In | Type | Require | Description |
|---|---|---|---|---|
| citizen_id | query | string | true | รหัสประชาชน |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| student_info_list | [object] | |
| » student_code | string | รหัสนักศึกษา |
| » firstname_th | string | ชื่อภาษาไทย |
| » lastname_th | string | นามสกุลภาษาไทย |
| » faculty_id | string | รหัสคณะ |
| » faculty_name | string | ชื่อคณะ |
| » program_id | string | รหัสหลักสูตร |
| » program_name | string | ชื่อหลักสูตร |
| » citizen_id | string | รหัสประชาชน |
| » student_year | number | ชั้นปีของนักศึกษา |
| » student_status | number | สถานะนักศึกษา |
| » student_status_name | string | ชื่อสถานะนักศึกษา |
| » level_id | number | รหัสของระดับการศึกษา |
| » level_name | string | ระดับการศึกษา |
| » gpa | double | เกรด |
| » admit_acadyear | number | ปีการศึกษาที่เข้าศึกษา |
| » admit_semester | number | เทอมที่เข้าศึกษา |
get_student_image
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'x-access-token':'{access-token}'
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/student/get_student_image",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers = [
'Accept'=>'application/json',
'Authorization'=>'Bearer {bearer-token}',
'x-access-token'=>'{access-token}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','https://reg2.kku.ac.th/api/v1.2/student/get_student_image', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}
// ...
?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/student/get_student_image \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
-H 'x-access-token: {access-token}'
Example Responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "success.",
"student_code": "543021264-9",
"student_image_data":"data:image/jpeg;base64,..."
}
GET /student/get_student_image
ดึงข้อมูลรูปนักศึกษา
Headers Param
| Key | Value |
|---|---|
| x-access-token | {ACCESS_TOKEN} |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| student_code | string | รหัสนักศึกษา |
| student_image_data | string | ข้อมูลรูปภาพเป็น base64_encode |
get_student_enroll_list
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'x-access-token':'{access-token}'
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/student/enroll_list/:acadyear/:semester",
"method": "get",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers=[
'Accept'=>'application/json',
'Authorization' => 'Bearer {bearer-token}',
'x-access-token' => '{access-token}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','https://reg2.kku.ac.th/api/v1.2/student/enroll_list/:acadyear/:semester', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
} ?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/student/enroll_list/:acadyear/:semester \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
-H 'x-access-token: {access-token}'
Example Responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"data": {
"student_info": {
"student_code": "string",
"gpa": "float",
"studentstatus": "number",
"sum_credit_attempt": "integer",
"sum_credit_satisfy": "integer"
},
"enroll_list": [
{
"course_id": "string",
"section": "number",
"course_code": "string",
"revision_code": "mumber",
"course_name_eng": "string",
"course_name": "string",
"class_id": "number",
"grade": "string",
"creditattempt": "integer",
"creditsatisfy": "integer",
"grademode": "string"
}
]
}
}
GET /student/enroll_list/:acadyear/:semester
ดึงข้อมูลส่วนตัวของนักศึกษา
Headers Param
| Key | Value |
|---|---|
| x-access-token | {ACCESS_TOKEN} |
Path Parameters
| Parameter | In | Type | Require | Description |
|---|---|---|---|---|
| acadyear | query | string | true | ปีการศึกษา |
| semester | query | string | true | เทอมการศึกษา |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| data | [object] | |
| » student_info | [object] | |
| »» student_code | string | รหัสนักศึกษา |
| »» gpa | float | เกรดเฉลี่ย |
| »» studentstatus | number | รหัสสถานะนักศึกษา |
| »» sum_credit_attempt | integer | หน่วยกิตที่ลงทะเบียน |
| »» sum_credit_satisfy | integer | หน่วยกิตที่ผ่าน |
| » enroll_list | [object] | |
| »» course_id | string | รหัส UID ของวิชา |
| »» section | number | Section |
| »» course_code | string | รหัสวิชา |
| »» revision_code | number | เวอร์ชั่นของวิชา |
| »» course_name_eng | string | ชื่อวิชาภาษาอังกฤษ |
| »» course_name | string | ชื่อวิชาภาษาไทย |
| »» class_id | number | |
| »» grade | string | เกรดที่ได้ เช่น A,B,C,D,E,F |
| »» creditattempt | integer | หน่วยกิตของวิชา |
| »» creditsatisfy | integer | หน่วยกิตที่ผ่าน |
| »» grademode | string | ประเภทของเกรด เช่น GD |
get_student_current_semester
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'x-access-token':'Bearer {access-token}'
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/student/current_semester",
"method": "get",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers = [
'Accept'=>'application/json',
'Authorization'=>'Bearer {bearer-token}',
'x-access-token'=>'{access-token}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','https://reg2.kku.ac.th/api/v1.2/student/current_semester', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}
// ...
?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/student/current_semester \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
-H 'x-access-token: {access-token}'
Example Responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"current_semester": {
"current_acadyear": "number",
"current_semester": "number"
}
}
GET /student/current_semester
ดึงเทอมปัจจุบันของนักศึกษา
Headers Param
| Key | Value |
|---|---|
| x-access-token | {ACCESS_TOKEN} |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| current_semester | [object] | |
| » current_acadyear | number | ปีการศึกษาปัจจุบัน |
| » current_semester | number | เทอมการศึกษาปัจจุบัน |
get_student_enroll_debt
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'x-access-token':'{access-token}'
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/student/enroll_debt/:acadyear/:semester",
"method": "get",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers = [
'Accept'=>'application/json',
'Authorization'=>'Bearer {bearer-token}',
'x-access-token'=>'{access-token}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','https://reg2.kku.ac.th/api/v1.2/student/enroll_debt/:acadyear/:semester', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}
// ...
?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/student/enroll_debt/:acadyear/:semester \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
-H 'x-access-token: {access-token}'
Example Responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"acadyear": "number",
"semester": "number",
"paid_status": "string",
"enroll_debt_list": [
{
"enroll_fee_id": "number",
"amount": "integer",
"balance": "integer"
}
]
}
GET /student/enroll_debt/:acadyear/:semester
ดึงข้อมูลเกี่ยวกับค่าเทอมของนักศึกษา
Headers Param
| Key | Value |
|---|---|
| x-access-token | {ACCESS_TOKEN} |
Path Parameters
| Parameter | In | Type | Require | Description |
|---|---|---|---|---|
| acadyear | query | string | true | ปีการศึกษา |
| semester | query | string | true | เทอมการศึกษา |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| data | [object] | |
| » acadyear | number | ปีการศึกษาปัจจุบัน |
| » semester | number | เทอมการศึกษาปัจจุบัน |
| » paid_status | string | สถานะการชำระ Y=ชำระแล้ว, N=ยังไม่ชำระ |
| » enroll_debt_list | [object] | |
| »» enroll_fee_id | number | รหัสหนี้สิน |
| »» amount | number | จำนวนเงินค่าธรรมเนียม |
| »» balance | number | ยอดคงค้าง |
get_enroll_credit_condition
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'x-access-token':'{access-token}'
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/student/enroll_credit_condition/:acadyear/:semester",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers = [
'Accept'=>'application/json',
'Authorization'=>'Bearer {bearer-token}',
'x-access-token'=>'{access-token}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','https://reg2.kku.ac.th/api/v1.2/student/enroll_credit_condition/:acadyear/:semester', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}
// ...
?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/student/enroll_credit_condition/:acadyear/:semester \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
-H 'x-access-token: {access-token}'
Example Responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"acadyear": "number",
"semester": "number",
"credit_condition": [
{
"student_status": "number",
"credit_min": "number",
"credit_max": "number",
"gpa": "float",
"gpax": "float"
}
]
}
GET /student/enroll_credit_condition/:acadyear/:semester
ดึงเงื่อนไขเกี่ยวกับหน่วยกิตที่ใช้ลงทะเบียน
- หน่วยกิตขั้นต่ำ
- หน่วยกิตสูงสุด
- เกรดในเทอมนั้นๆ
- เกรดรวม
- สถานะนักศึกษาในเทอม
Headers Param
| Key | Value |
|---|---|
| x-access-token | {ACCESS_TOKEN} |
Path Parameters
| Parameter | In | Type | Require | Description |
|---|---|---|---|---|
| acadyear | query | string | true | ปีการศึกษา |
| semester | query | string | true | เทอมการศึกษา |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| acadyear | number | ปีการศึกษาปัจจุบัน |
| semester | number | เทอมการศึกษาปัจจุบัน |
| » credit_condition | [object] | |
| »» student_status | number | สถานะของนักศึกษา |
| »» credit_min | number | จำนวนหน่วยกิตขั้นต่ำที่ลงทะเบียนได้ในเทอมนั้น |
| »» credit_max | number | จำนวนหน่วยกิตสูงสุดที่นักศึกษาสามารถลงทะเบียนได้ในเทอม |
| »» gpa | float | เกรดเฉลี่ยนในเทอมนั้นๆ |
| »» gpax | float | เกรดเฉลี่ยรวมทั้งหมด |
get_enroll_schedule
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'x-access-token':'{access-token}'
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/student/get_enroll_schedule",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers = [
'Accept'=>'application/json',
'Authorization'=>'Bearer {bearer-token}',
'x-access-token'=>'{access-token}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','https://reg2.kku.ac.th/api/v1.2/student/get_enroll_schedule', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}
// ...
?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/student/get_enroll_schedule \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
-H 'x-access-token: {access-token}'
Example Responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "success.",
"student_info": {
"student_code": "string",
"prefix_name": "string",
"firstname_th": "string",
"lastname_th": "string",
"prefix": "string",
"firstname": "string",
"lastname": "string",
"faculty_id": "number",
"faculty_name": "string",
"faculty_name_eng": "string",
"program_id": "number",
"program_name": "string",
"level_id": "number",
"level_name": "string",
"current_acadyear": "number",
"current_semester": "number"
},
"schedule": [
{
"schedule_code": "number",
"schedule_code_name": "string",
"schedule_code_name_eng": "string",
"date_from": "datetime 2019-07-22 08:30",
"date_to": "datetime 2019-07-22 08:30"
}
]
}
GET /student/get_enroll_schedule
ข้อมูลปฏิทินการศึกษาของนักศึกษารายบุคคล
Headers Param
| Key | Value |
|---|---|
| x-access-token | {ACCESS_TOKEN} |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| student_info | [object] | |
| » student_code | string | รหัสนักศึกษา |
| » prefix_name | string | คำนำหน้าชื่อ |
| » firstname_th | string | ชื่อภาษาไทย |
| » lastname_th | string | นามสกุลภาษาไทย |
| » prefix | string | คำนำหน้าชื่ออังกฤษ |
| » firstname | string | ชื่อภาษาอังกฤษ |
| » lastname | string | นามสกุลภาษาอังกฤษ |
| » faculty_id | number | รหัสคณะ |
| » faculty_name | string | ชื่อคณะ |
| » faculty_name_eng | string | ชื่อคณะ |
| » program_id | number | รหัสหลักสูตร |
| » program_name | string | ชื่อหลักสูตร |
| » level_id | number | ระดับการศึกษา |
| » level_name | string | ระดับการศึกษา |
| » current_acadyear | number | ปีการศึกษาปัจจุบัน |
| » current_semester | number | เทอมการศึกษาปัจจุบัน |
| schedule | [object] | |
| »» schedule_code | number | รหัสรายการ |
| »» schedule_code_name | string | ชื่อรายการภาษาไทย |
| »» schedule_code_name_eng | string | ชื่อรายการภาษาอังกฤษ |
| »» date_from | string | YYYY-MM-DD HH:MI |
| »» date_to | string | YYYY-MM-DD HH:MI |
get_computer_test
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'x-access-token':'{access-token}'
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/student/get_computer_test",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers = [
'Accept'=>'application/json',
'Authorization'=>'Bearer {bearer-token}',
'x-access-token'=>'{access-token}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','https://reg2.kku.ac.th/api/v1.2/student/get_computer_test', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}
// ...
?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/student/get_computer_test \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
-H 'x-access-token: {access-token}'
Example Responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"computer_test": [
{
"grade": "string",
"acadyear": "number",
"semester": "number"
}
]
}
GET /student/get_computer_test
ดึงข้อมูลผลสอบคอมพิวเตอร์
Headers Param
| Key | Value |
|---|---|
| x-access-token | {ACCESS_TOKEN} |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| computer_test | [object] | |
| » grade | string | เกรดวิชาสอบคอม {S=>Satisfy , U=>Unsatisfy} |
| » acadyear | string | ปีการศึกษาที่สอบ |
| » semester | string | เทอมการศึกษาที่สอบ |
get_student_class_schedule
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'x-access-token':'{access-token}'
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/student/get_class_schedule",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers = [
'Accept'=>'application/json',
'Authorization'=>'Bearer {bearer-token}',
'x-access-token'=>'{access-token}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','https://reg2.kku.ac.th/api/v1.2/student/get_class_schedule', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}
// ...
?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/student/get_class_schedule \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
-H 'x-access-token: {access-token}'
Example Responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"acadyear": "number",
"semester": "number",
"class_schedule": [
{
"student_code": "string",
"course_code": "string",
"course_name_eng": "string",
"course_name": "string",
"acadyear": "number",
"semester": "number",
"start_time": "string [HH:MM]",
"end_time": "string [HH:MM]",
"week_call": "string [MON,THU,..]",
"week_call_thai": "string [จันทร์]",
"room_code": "string",
"room_name": "string",
"building_code": "string"
}
]
}
GET /student/get_class_schedule
ดึงข้อมูลตารางเรียนของนักศึกษา
หากไม่ได้ระบุปีและเทอมการศึกษา ระบบจะใช่ ปีและเทอมการศึกษาปัจจุบัน
Headers Param
| Key | Value |
|---|---|
| x-access-token | {ACCESS_TOKEN} |
Parameters
| Parameter | In | Type | Require | Description |
|---|---|---|---|---|
| acadyear | query | string | false | ปีการศึกษา |
| semester | query | string | false | เทอมการศึกษา |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| acadyear | number | ปีการศึกษา |
| semester | number | เทอมการศึกษา |
| class_schedule | [object] | |
| » student_code | string | รหัสนักศึกษา |
| » course_code | string | รหัสวิชา |
| » course_name_eng | string | ชื่อวิชาภาษาอังกฤษ |
| » course_name | string | ชื่อวิชา |
| » acadyear | number | ปีการศึกษา |
| » semester | number | เทอมการศึกษา |
| » start_time | string | เวลาเริ่มต้น HH:MM |
| » end_time | string | เวลาสิ้นสุด HH:MM |
| » week_call | string | วัน MON,THU,WED |
| » week_call_thai | string | วัน จันทร์,อังคาร,พุธ |
| » room_code | string | ห้อง |
| » room_name | string | ชื่อห้อง |
| » building_code | string | อาคาร |
get_english_proficiency_test
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'x-access-token':'{access-token}'
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/student/get_english_proficiency_test",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers = [
'Accept'=>'application/json',
'Authorization'=>'Bearer {bearer-token}',
'x-access-token'=>'{access-token}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','https://reg2.kku.ac.th/api/v1.2/student/get_english_proficiency_test', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}
// ...
?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/student/get_english_proficiency_test \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
-H 'x-access-token: {access-token}'
Example Responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"english_proficiency_test": [
{
"studentid": "number",
"scores": "number",
"acadyear": "number",
"status": "string",
"typename": "string",
"typefullname": "string",
"examdate": "string [yyyy-mm-dd]"
}
]
}
GET /student/get_english_proficiency_test
ข้อมูลผลการสอบภาษาอังกฤษ
Headers Param
| Key | Value |
|---|---|
| x-access-token | {ACCESS_TOKEN} |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| english_proficiency_test | [object] | |
| » studentid | string | รหัสนักศึกษา |
| » scores | string | คะแนนสอบ |
| » acadyear | string | ปีการศึกษาที่ยื่นคะแนน |
| » status | string | สถานะผลสอบ |
| » typename | number | ชื่อผลการสอบย่อ |
| » typefullname | number | ชื่อผลการสอบ |
| » examdate | string | yyyy-mm-dd |
get_advisor
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'x-access-token':'{access-token}'
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/student/get_advisor",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers = [
'Accept'=>'application/json',
'Authorization'=>'Bearer {bearer-token}',
'x-access-token'=>'{access-token}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','https://reg2.kku.ac.th/api/v1.2/student/get_advisor', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}
// ...
?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/student/get_advisor \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
-H 'x-access-token: {access-token}'
Example Responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "success.",
"student_advisor": {
"officer_id": "number",
"officer_code": "number",
"prefix_name": "string",
"prefix_name_eng": "string",
"officer_name": "string",
"officer_surname": "string",
"officer_name_eng": "string",
"officer_surname_eng": "string",
"officer_email": "string",
"hrid": "number",
"ldap": "numbert"
}
}
GET /student/get_advisor
ข้อมูลอาจารย์ที่ปรึกษาของนักศึกษา
Headers Param
| Key | Value |
|---|---|
| x-access-token | {ACCESS_TOKEN} |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| student_advisor | [object] | |
| » officer_id | number | รหัสอาจารย์ |
| » officer_code | number | โค้ดอาจารย์ |
| » prefix_name | string | คำนำหน้าชื่ออาจารย์ภาษาไทย |
| » prefix_name_eng | string | คำนำหน้าชื่ออาจารย์ภาษาอังกฤษ |
| » officer_name | string | ชื่ออาจารย์ภาษาไทย |
| » officer_surname | string | นามสกุลอาจารย์ภาษาไทย |
| » officer_name_eng | string | ชื่อภาษาอังกฤษ |
| » officer_surname_eng | string | นามสกุลภาษาอังกฤษ |
| » officer_email | string | อีเมล |
| » hrid | number | รหัสเจ้าหน้าที่ของงานบุคคล |
| » ldap | number | ชื่อ ldap |
get_grade_summary
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
'x-access-token':'{access-token}'
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/student/get_grade_summary",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers = [
'Accept'=>'application/json',
'Authorization'=>'Bearer {bearer-token}',
'x-access-token'=>'{access-token}'
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','https://reg2.kku.ac.th/api/v1.2/student/get_grade_summary', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}
// ...
?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/student/get_grade_summary \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
-H 'x-access-token: {access-token}'
Example Responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "success",
"grade_summary": [
{
"course_id": "number",
"acadyear": "number",
"semester": "number",
"student_status": "number",
"credit_attempt": "integer",
"credit_satisfy": "integer",
"grade_point": "double",
"grade": "string",
"credit_in_semester_attempt": "integer",
"credit_in_semester_satisfy": "integer",
"grade_point_in_semester": "double",
"gpa_of_semester": "double",
"gpax": "double",
"sum_credit_attempt": "double",
"sum_credit_satisfy": "double",
"sum_credit_point": "double",
"sum_grade_point": "double",
"course_code": "string",
"course_name": "string",
"course_credit": "number"
}
]
}
GET /student/get_grade_summary
ข้อมูลสรุปเกรด
Headers Param
| Key | Value |
|---|---|
| x-access-token | {ACCESS_TOKEN} |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| grade_summary | [object] | |
| » course_id | number | รหัสรายวิชาในระบบ |
| » acadyear | number | ปีการศึกษา |
| » semester | number | เทอม |
| » student_status | number | รหัสสถานะนักศึกษา |
| » credit_attempt | number | หน่วยกิตที่ลง |
| » credit_satisfy | number | หน่วยกิตที่ผ่าน |
| » grade_point | double | คะแนนของเกรด |
| » grade | string | เกรดที่ได้ (A,B,C..) |
| » credit_in_semester_attempt | number | หน่วยกิตที่ลงของเทอมนั้น |
| » credit_in_semester_satisfy | number | หน่วยกิตที่ผ่านในเทอม |
| » grade_point_in_semester | double | คะแนนเกรดเฉลี่ยในเทอม |
| » sum_credit_attempt | double | จำนวนหน่วยกิตที่ลงทะเบียนรวม |
| » sum_credit_satisfy | double | จำนวนหน่วยกิตที่ผ่านรวม |
| » sum_credit_point | double | จำนวนหน่วยกิตรวม |
| » sum_grade_point | double | จำนวนคะแนนเกรดเฉลี่ยรวม |
| » course_code | string | รหัสวิชา |
| » course_name | string | ชื่อวิชา |
| » course_credit | number | หน่วยกิตรายวิชา |
Course
get_class_open_in_semester
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/course/open_in_semester/:acadyear/:semester",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers=[
'Accept'=>'application/json',
'Authorization' => 'Bearer {bearer-token}',
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','/course/open_in_semester/:acadyear/:semester', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
} ?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/course/open_in_semester/:acadyear/:semester \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
Example responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "success",
"course_open_in_semester": [
{
"course_id": "number",
"class_id": "number",
"course_code": "string",
"course_name": "string",
"course_name_eng": "string",
"section": "number",
"class_status": "string",
"total_seat": "integer",
"enroll_seat": "integer",
"faculty_name": "string",
"department_name": "string",
"level_name": "string",
"level_name_eng": "string",
"credit_total": "number"
}
]
}
GET /course/open_in_semester/:acadyear/:semester
ดึงข้อมูลรายวิชาที่เปิดสอนในเทอมนั้นๆ
Path Parameters
| Parameter | In | Type | Require | Description |
|---|---|---|---|---|
| acadyear | query | string | true | ปีการศึกษา |
| semester | query | string | true | เทอมการศึกษา |
Parameters
| Parameter | In | Type | Require | Description |
|---|---|---|---|---|
| campus_id | query | number | false | รหัสวิทยาเขต |
| faculty_id | query | string | false | รหัสคณะ |
| course_code | query | string | false | รหัสวิชา |
| section | query | number | false | section |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| course_open_in_semester | [object] | |
| » course_id | mumber | รหัส UID ของวิชา |
| » class_id | number | รหัส UID ของชั้น |
| » course_code | string | รหัสวิชา |
| » course_name | string | ชื่อวิชา |
| » course_name_eng | string | ชื่ือวิชาภาษาอังกฤษ |
| » section | number | กลุ่ม |
| » class_status | string | สถานะของชั้นเรียน |
| » total_seat | integer | จำนวนรับลงทะเบียน |
| » enroll_seat | integer | จำนวนที่นั่งที่ลงทะเบียนแล้ว |
| » faculty_name | string | ชื่อคณะ |
| » department_name | string | ภาควิชา |
| » level_name | string | ระดับการศึกษา |
| » level_name_eng | string | ระดับการศึกษาอังกฤษ |
| » credit_total | mumber | หน่วยกิตของวิชา |
get_teacher_of_class
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/course/teacher_of_class/:acadyear/:semester/:class_id",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers=[
'Accept'=>'application/json',
'Authorization' => 'Bearer {bearer-token}',
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','/course/teacher_of_class/:acadyear/:semester/:class_id', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
} ?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/course/teacher_of_class/:acadyear/:semester/:class_id \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
Example responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "",
"teacher_of_class": [
{
"section": "number",
"sequence": "number",
"officer_id": "number",
"prefix_name": "string",
"officer_name": "string",
"officer_surname": "string",
"prefix_name_eng": "string",
"officer_name_eng": "string",
"officer_surname_eng": "string",
"ldap_account": "string",
"hr_id": "number",
"class_id": "number",
"course_code": "number"
}
]
}
GET /course/teacher_of_class/:acadyear/:semester/:class_id
ข้อมูลอาจารย์ผู้สอน
Path Parameters
| Parameter | In | Type | Require | Description |
|---|---|---|---|---|
| acadyear | query | string | true | ปีการศึกษา |
| semester | query | string | true | เทอมการศึกษา |
| class_id | query | string | true | รหัส ID ของ class |
Parameters
| Parameter | In | Type | Require | Description |
|---|---|---|---|---|
| section | query | number | false | section |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| teacher_of_class | [object] | |
| » section | mumber | section |
| » sequence | number | ลำดับของผู้สอน |
| » officer_id | number | รหัสบุคคลกร |
| » prefix_name | string | คำนำหน้าชื่อ |
| » officer_name | string | ชื่อผู้สอน |
| » officer_surname | string | นามสกุลผู้สอน |
| » prefix_name_eng | string | คำนำหน้าชื่อภาษาอังกฤษ |
| » officer_name_eng | string | ชื่อผู้สอนภาษาอังกฤษ |
| » officer_surname_eng | string | นามสกุลผู้สอนภาษาอังกฤษ |
| » ldap_account | number | ชื่อบัญชี LDAP |
| » hr_id | number | รหัสบุคคลกร |
| » class_id | number | รหัสชั้นเรียน |
| » course_code | number | รหัสวิชา |
get_time_table
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/course/time_table/:course_code/:acadyear/:semester",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers=[
'Accept'=>'application/json',
'Authorization' => 'Bearer {bearer-token}',
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','/course/time_table/:course_code/:acadyear/:semester', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
} ?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/course/time_table/:course_code/:acadyear/:semester \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {bearer-token}' \
Example responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "success",
"course_time_table": [
{
"classid": "number",
"coursecode": "string",
"coursenameeng": "string",
"coursename": "string",
"section": "number",
"studycode": "string",
"facultyid": "number",
"facultyname": "string",
"acadyear": "number",
"semester": "number",
"totalseat": "number",
"enrollseat": "number",
"sequence": "number",
"weekday": "number",
"time1text": "13:00",
"time1of": "13:00:00",
"time2text": "13:55",
"time2of": "13:55:00",
"weekcall": "TUE",
"weekcallabb": "TU",
"weekcallthai": "อังคาร",
"roomcode": "-",
"roomname": "-",
"buildingcode": "-",
"capacity": ""
}
]
}
GET /course/time_table/:course_code/:acadyear/:semester
ข้อมูลเวลาเรียนของรายวิชา
Path Parameters
| Parameter | In | Type | Require | Description |
|---|---|---|---|---|
| course_code | query | string | true | รหัสวิชา |
| acadyear | query | string | true | ปีการศึกษา |
| semester | query | string | true | เทอมการศึกษา |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| course_time_table | [object] | |
| » classid | mumber | class_id |
| » coursecode | number | รหัสวิชา |
| » coursenameeng | number | ชื่อวิชาอังกฤษ |
| » coursename | string | ชื่อวิชา |
| » section | number | กลุ่มเรียน |
| » studycode | string | ประเภทการเรียนการสอบ |
| » facultyid | number | รหัสคณะของวิชา |
| » facultyname | string | คณะของวิชา |
| » acadyear | number | ปีการศึกษา |
| » semester | number | เทอม |
| » totalseat | number | จำนวนที่นั่ง |
| » enrollseat | number | จำนวนที่ลงทะเบียน |
| » sequence | number | ลำดับของวัน |
| » weekday | number | ลำดับของวัน |
| » time1text | string | เวลาเริ่มต้น [13:00] |
| » time1of | string | เวลาเริ่มต้น [13:00:00] |
| » time2text | string | เวลาสิ้นสุด [13:55] |
| » time2of | string | เวลาสิ้นสุด [13:55:00] |
| » weekcall | string | วัน [TUE] |
| » weekcallabb | string | วัน [TU] |
| » weekcallthai | string | วันภาษาไทย [อังคาร] |
| » roomcode | string | รหัสห้อง |
| » roomname | string | ชื่อห้อง |
| » buildingcode | string | ชื่ออาคาร |
» capacity / number / ความจุของห้อง
Program
get_program
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/program",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers=[
'Accept'=>'application/json',
'Authorization' => 'Bearer {bearer-token}',
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','/program', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/program \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
Example responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "",
"data": [
{
"program_id": "number",
"program_code": "number",
"program_type": "string",
"program_year": "number",
"faculty_id": "number",
"department_id": "number",
"program_name": "string",
"program_name_eng": "string",
"credit_total": "number",
"study_year_max": "number",
"study_year": "number",
"credit_graduate_request": "number"
}
]
}
GET /program
ดึงข้อมูลหลักสูตร
Parameters
| Parameter | In | Type | Require | Description |
|---|---|---|---|---|
| program_id | query | number | false | รหัสหลักสูตร |
| faculty_id | query | number | false | รหัสคณะ |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| data | [object] | |
| » program_id | number | รหัส UID ของหลักสูตร |
| » program_code | number | รหัสสาขา |
| » program_type | string | ประเภทหลักสูตร Minor / Major |
| » program_year | number | ปีของหลักสูตร |
| » faculty_id | number | รหัสคณะของหลักสูตร |
| » department_id | number | รหัสภาควิชาของหลักสูตร |
| » program_name | string | ชื่อหลักสูตรภาษาไทย |
| » program_name_eng | string | ชื่อหลักสูตรภาษาอังกฤษ |
| » credit_total | integer | หน่วยกิตรวมของหลักสูตร |
| » study_year_max | number | จำนวนปีที่เรียนสูงสุด |
| » study_year | number | จำนวนปีที่ศึกษา |
| » credit_graduate_request | number | จำนวนหน่วยกิตที่แจ้งจบได้ |
Faculty
get_faculty
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/faculty",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers=[
'Accept'=>'application/json',
'Authorization' => 'Bearer {bearer-token}',
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','/faculty', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/faculty \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
Example responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "",
"faculty": [
{
"facultyid": "number",
"facultyname": "string",
"facultynameeng": "string",
"facultyabb": "string",
"facultyabbeng": "string",
"facultytype": "string"
}
]
}
GET /faculty
ดึงข้อมูลรายชื่อคณะ/หน่วยงาน
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| faculty | [object] | |
| » facultyid | number | รหัสคณะ/หน่วยงาน |
| » facultyname | string | ชื่อคณะ/หน่วยงาน |
| » facultynameeng | string | ชื่อคณะ/หน่วยงาน ภาษาอังกฤษ |
| » facultyabb | string | ชื่อย่อภาษาไทย |
| » facultyabbeng | string | ชื่อย่อภาษาอังกฤษ |
| » facultytype | string | ประเภทของหน่วยงาน {F=>Faculty , O=>Organization} |
get_department
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/faculty/get_department",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers=[
'Accept'=>'application/json',
'Authorization' => 'Bearer {bearer-token}',
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','/faculty/get_department', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/faculty/get_department \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
Example responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "",
"department": [
{
"faculty_id": "number",
"department_id": "number",
"department_name": "string",
"department_name_eng": "string"
}
]
}
GET /faculty/get_department
ดึงข้อมูลรายชื่อภาควิชา
Parameters
| Parameter | In | Type | Require | Description |
|---|---|---|---|---|
| faculty_id | query | number | false | รหัสคณะ |
| department_id | query | number | false | รหัสภาควิชา |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| department | [object] | |
| » faculty_id | number | รหัสคณะ/หน่วยงาน |
| » department_id | string | รหัสภาควิชา |
| » department_name | string | ชื่อภาควิชาภาษาไทย |
| » department_name_eng | string | ชื่อภาควิชาภาษาไทย |
Officer
get_officer
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/officer/get_officer",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers=[
'Accept'=>'application/json',
'Authorization' => 'Bearer {bearer-token}',
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','/officer/get_officer', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/officer/get_officer \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
Example responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "",
"officer": [
{
"faculty_id": "2",
"faculty_name": "คณะวิทยาศาสตร์",
"officer_type": "อาจารย์ทั่วไป",
"officer_type_eng": "General instructor",
"prefix_name": "รองศาสตราจารย์",
"officer_name": "",
"officer_surname": "",
"prefix_name_eng": "Associate Professor",
"officer_name_eng": "",
"officer_surname_eng": "",
"officer_status": "เลิกสอน",
"ldap": "",
"email": ""
}
]
}
GET /officer/get_officer
ดึงข้อมูลอาจารย์ เจ้าหน้าที่
Parameters
| Parameter | In | Type | Require | Description |
|---|---|---|---|---|
| faculty_id | query | number | false | รหัสคณะ |
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| officer | [object] | |
| » faculty_id | number | รหัสคณะ/หน่วยงาน |
| » faculty_name | string | คณะ |
| » officer_type | string | ประเภทบุคลากร |
| » officer_type_eng | string | ประเภทบุคลากรอังกฤษ |
| » prefix_name | string | คำนำหน้าชื่อ |
| » officer_name | string | ชื่อ |
| » officer_surname | string | นามสกุล |
| » prefix_name_eng | string | คำนำหน้าชื่อ |
| » officer_name_eng | string | ชื่อ |
| » officer_surname_eng | string | นามสกุล |
| » officer_status | string | สถานะ |
| » ldap | string | ldap account |
| string | อีเมล |
Other
get_current_semester
Example Code
var headers = {
'Accept':'application/json',
'Authorization':'Bearer {bearer-token}',
};
var settings = {
"url": "https://reg2.kku.ac.th/api/v1.2/other/academic/get_current_semester",
"method": "GET",
"headers": headers
};
$.ajax(settings).done(function (response) {
console.log(response);
});
<?php
$headers=[
'Accept'=>'application/json',
'Authorization' => 'Bearer {bearer-token}',
];
$client = new \GuzzleHttp\Client();
$request_body = array();
try {
$response = $client->request('GET','/other/academic/get_current_semester', array(
'headers' => $headers,
'json' => $request_body,
)
);
print_r($response->getBody()->getContents());
}
catch (\GuzzleHttp\Exception\BadResponseException $e) {
print_r($e->getMessage());
}?>
curl -X GET https://reg2.kku.ac.th/api/v1.2/other/academic/get_current_semester \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'
Example responses
{
"status": {
"code": 200,
"text": "200 OK"
},
"message": "",
"data": [
{
"level_id": "10",
"level_name": "ระดับทั่วไป",
"level_name_eng": "General Level",
"current_acadyear": "2556",
"current_semester": "3",
"enroll_acadyear": "2544",
"enroll_semester": "3"
}
]
}
GET /other/academic/get_current_semester
ดึงข้อมูลปีการศึกษาปัจจุบัน
Response Status
| Status | Description |
|---|---|
| code | Http Code |
| text | Http Code Description |
Response Schema
Status Code 200
| Name | Type | Description |
|---|---|---|
| data | [object] | |
| » level_id | number | รหัสคณะ/หน่วยงาน |
| » level_name | string | ระดับการศึกษา |
| » level_name_eng | string | ระดับการศึกษา |
| » current_acadyear | string | ปีการศึกษาปัจจุบัน |
| » current_semester | string | เทอมปัจจุบัน |
| » enroll_acadyear | string | ปีการศึกษาที่ลงทะเบียน |
| » enroll_semester | string | เทอมที่ลงทะเบียน |
Errors
| Error Code | Meaning |
|---|---|
| 400 | Bad Request -- Your request is invalid. |
| 401 | Unauthorized -- Your API key is wrong. |
| 403 | Forbidden -- The kitten requested is hidden for administrators only. |
| 404 | Not Found -- The specified kitten could not be found. |
| 405 | Method Not Allowed -- You tried to access a kitten with an invalid method. |
| 406 | Not Acceptable -- You requested a format that isn't json. |
| 410 | Gone -- The kitten requested has been removed from our servers. |
| 418 | I'm a teapot. |
| 429 | Too Many Requests -- You're requesting too many kittens! Slow down! |
| 500 | Internal Server Error -- We had a problem with our server. Try again later. |
| 503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later. |