Documentation

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
    enum: 1, 2, 3, 6, 8, 9, 11, 12
  • lessonstring?
  • sortOrderinteger
    default: 0
  • videoUrlstring<uri>?
    format: uri
  • pdfUrlstring<uri>?
    format: uri
  • totalScoreinteger
    default: 0
  • status"draft" | "published" | "archived"
    default: "published"
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)
    enum: 1, 2, 3, 6, 8, 9, 11, 12
  • lessonstring?

    HTML content for the lesson

  • sortOrderinteger
  • videoUrlstring<uri>?
    format: uri
  • pdfUrlstring<uri>?
    format: uri
  • totalScoreinteger
    default: 0
  • status"draft" | "published" | "archived"
  • createdAtstring<date-time>
    format: date-time
  • updatedAtstring<date-time>
    format: 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"
}'