Documentation

Admin - Content

Update content

Updates content details.

ProductionStagingUAT
PUThttps://ankiren.com/api/admin/courses/{courseId}/units/{unitId}/content/{contentId}

Parameters

Path Parameters

  • courseIdintegerpathRequired
  • unitIdintegerpathRequired
  • contentIdintegerpathRequired

Request Body

Bắt buộc.

  • namestring
  • type1 | 2 | 3 | …
    enum: 1, 2, 3, 6, 8, 9, 11, 12
  • lessonstring?
  • sortOrderinteger
  • videoUrlstring<uri>?
    format: uri
  • pdfUrlstring<uri>?
    format: uri
  • totalScoreinteger
  • status"draft" | "published" | "archived"
application/json
{
  "name": "string",
  "type": 1,
  "lesson": "string",
  "sortOrder": 0,
  "videoUrl": "https://ankiren.com",
  "pdfUrl": "https://ankiren.com",
  "totalScore": 0,
  "status": "draft"
}

Responses

200 · Content updated

  • 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 PUT 'https://ankiren.com/api/admin/courses/{courseId}/units/{unitId}/content/{contentId}' \
  -H 'Authorization: Bearer <token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "type": 1,
  "lesson": "string",
  "sortOrder": 0,
  "videoUrl": "https://ankiren.com",
  "pdfUrl": "https://ankiren.com",
  "totalScore": 0,
  "status": "draft"
}'