Tài liệu này dành cho partner triển khai theo nhánh xã/phường với endpoint:
POST /api/lms-base/learning-resources/divisions
Nếu bạn tích hợp theo nhánh khác, tham chiếu:
1. Luồng tích hợp nhanh
- Upload file qua
POST /api/lms-base/attachments. - Nhận
id+pathcủa từng file upload. - Replace URL trong
thumbnailUrl/contentsbằng path đã upload (hoặc dùng URL ngoài hợp lệ theo rule). - Gọi
POST /api/lms-base/learning-resources/divisions(upsert theodoetCode + divisionCode + sourceIdtrong phạm viX-Api-Key). - Poll duyệt bằng
GET /api/lms-base/learning-resources/divisions.
2. Rule nghiệp vụ chính
doetCodevàdivisionCodelà bắt buộc cho scope xã/phường.schoolCodekhông bắt buộc cho scope này.authorPinCode,authorName,creatorPinCode,creatorNamecó thể để trống; hệ thống tự gán theo mã/tên xã-phường.- Nếu đã tồn tại bản ghi cùng
doetCode + divisionCode + sourceId:- Đang
Pending/Rejected: cập nhật (operation=updated). - Đang
Approved: từ chối cập nhật, phải dùngsourceIdmới.
- Đang
3. Endpoint tra cứu và xóa
- Theo dõi duyệt: khuyến nghị dùng webhook
learning-resource.status-changed(xem Tổng quan tích hợp – mục 7.6); polling dưới đây dùng để đối soát/dự phòng. - Tra cứu trạng thái:
GET /api/lms-base/learning-resources/divisions- Bắt buộc
doetCodevàdivisionCode. - Không hỗ trợ lọc
schoolCode.
- Bắt buộc
- Xóa pending theo lô:
DELETE /api/lms-base/learning-resources/divisions- Request body:
string[]danh sách ULID, tối đa 200 id/lần. - Chỉ xóa được bản ghi đang
Pending.
- Request body:
4. Ví dụ gọi API chia sẻ (scope xã/phường)
curl --location 'https://partner.hanoi.edu.vn/api/lms-base/learning-resources/divisions' \
--header 'X-Api-Key: <api-key-don-vi-duoc-cap>' \
--header 'Content-Type: application/json' \
--data '{
"sourceId": "LR-DIV-000001",
"title": "Chuyên đề ôn tập cuối kỳ",
"description": "Nội dung dùng chung theo đơn vị quản lý.",
"thumbnailUrl": "https://<cdn-or-storage>/partner-code/thumb.png",
"authorPinCode": "",
"authorName": "",
"creatorPinCode": "",
"creatorName": "",
"fileIds": [
"01JQ2S96MKZ8E8GHW8EXB4VPA7",
"01JQ2SAXA9QXRVQ8S9QPA4J2AN"
],
"contents": [
{
"name": "Video tải lên",
"displayOrder": 1,
"type": "VIDEO",
"content": "https://<cdn-or-storage>/partner-code/video-division.mp4",
"description": "Video chính"
},
{
"name": "Video YouTube tham khảo",
"displayOrder": 2,
"type": "YOUTUBE",
"content": "https://www.youtube.com/watch?v=d3bn7DVrZOw",
"description": "Video tham khảo"
}
],
"gradeCode": "09",
"subjectCode": "0201",
"knowledgeUnitCode": "0201090100",
"doetCode": "01",
"divisionCode": "01234",
"schoolCode": "",
"yearCode": 2025,
"educationLevelCode": "03",
"semesterCode": 2
}'bash
Chi tiết toàn bộ field/rule: Tổng quan tích hợp.
