Admin - Content
Create content
Creates a new content item in the unit.
ProductionStagingUAT
POSThttps://ankiren.com/api/admin/courses/{courseId}/units/{unitId}/content
Parameters
Path Parameters
- courseIdintegerpathRequired
- unitIdintegerpathRequired
Request Body
Bắt buộc.
- namestringRequired
- type1 | 2 | 3 | …Required
- lessonstring?
- sortOrderinteger
- videoUrlstring<uri>?
- pdfUrlstring<uri>?
- totalScoreinteger
- status"draft" | "published" | "archived"
application/json
{ "name": "Introduction to Hiragana", "type": 1, "lesson": "string", "sortOrder": 0, "videoUrl": "https://ankiren.com", "pdfUrl": "https://ankiren.com", "totalScore": 0, "status": "published" }
Responses
201 · Content created
- idinteger
- unitIdinteger
- externalIdstring?
- namestring
- type1 | 2 | 3 | …
Content type:
- 1: Video
- 2: PDF
- 3: Quiz (Multiple Choice)
- 6: Quiz (Matching)
- 8: Quiz (Dropdown)
- 9: Quiz (True/False)
- 11: Quiz (Image)
- 12: Quiz (Mixed)
- lessonstring?
HTML content for the lesson
- sortOrderinteger
- videoUrlstring<uri>?
- pdfUrlstring<uri>?
- totalScoreinteger
- status"draft" | "published" | "archived"
- createdAtstring<date-time>
- updatedAtstring<date-time>
application/json
{ "id": 1, "unitId": 1, "externalId": "content-hiragana-intro", "name": "Introduction to Hiragana", "type": 1, "lesson": "string", "sortOrder": 0, "videoUrl": "https://example.com/videos/hiragana-intro.mp4", "pdfUrl": "https://example.com/pdfs/hiragana-guide.pdf", "totalScore": 100, "status": "published", "createdAt": "2026-01-01T00:00:00.000Z", "updatedAt": "2026-01-01T00:00:00.000Z" }
Sample Code
Đổi ngôn ngữ ở ô Language trên thanh Documentation.
cURL
curl -X POST 'https://ankiren.com/api/admin/courses/{courseId}/units/{unitId}/content' \
-H 'Authorization: Bearer <token>' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"name": "Introduction to Hiragana",
"type": 1,
"lesson": "string",
"sortOrder": 0,
"videoUrl": "https://ankiren.com",
"pdfUrl": "https://ankiren.com",
"totalScore": 0,
"status": "published"
}'