跳轉到

Moodle API Integration

本目錄紀錄 NTUST Moodle API 的分析結果。由於校方系統權限設定,部分標準 Moodle Web Service API 被封鎖或呈現停用狀態。

可用 API (已驗證)

API 名稱 說明 路徑
core_course_get_enrolled_courses_by_timeline_classification 獲取使用者課程清單 service.php/...
core_courseformat_get_state 獲取單一課程週次、內容結構與連結 service.php/...
core_session_time_remaining 檢查當前 Session 剩餘時間 (防斷線) (尚未建立文檔,但測試可用)
core_output_load_template_with_dependencies 獲取系統 UI 模板 ( Mustache ) (尚未建立文檔,但測試可用)
core_calendar_get_calendar_monthly_view 獲取日曆月視圖事件 (作業截止日) (尚未建立文檔,但測試可用)

不可用 API (校方已封鎖 / 返回 servicenotavailable)

以下 API 經測試在 NTUST Moodle 呈現停用狀態,無法透過 sesskey 調用:

API 名稱 預計功能 失敗原因
mod_assign_get_submission_status 獲取作業繳交狀態 / 評分 servicenotavailable
mod_assign_get_assignments 獲取所有作業列表 servicenotavailable
core_completion_get_activities_completion_status 獲取活動完成勾選狀態 servicenotavailable
core_course_get_contents 獲取詳細課程內容 ( 替代方案: get_state ) servicenotavailable
core_calendar_get_calendar_events 獲取日曆事件列表 servicenotavailable

參考資料

$body = @{ username = "B11427014" password = "~Sky@Wind960325" service = "moodle_mobile_app" }

Invoke-RestMethod -Method Post -Uri "https://moodle2.ntust.edu.tw/login/token.php" -ContentType "application/x-www-form-urlencoded" -Body $body