Documentation

Admin - Questions

Create question

Creates a new question with optional answers.

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

Parameters

Path Parameters

  • courseIdintegerpathRequired
  • unitIdintegerpathRequired
  • contentIdintegerpathRequired

Request Body

Bắt buộc.

  • textstringRequired
  • explanationstring?
  • sortOrderinteger
    default: 0
  • imageUrlstring<uri>?
    format: uri
  • type"multiple_choice" | "matching" | "dropdown" | …
    default: "multiple_choice"enum: multiple_choice, matching, dropdown, true_false, image
  • answers[CreateAnswerRequest]
    • textstringRequired
    • isCorrectboolean
      default: false
    • sortOrderinteger
      default: 0
    • imageUrlstring<uri>?
      format: uri
    • matchingKeystring?
application/json
{
  "text": "What is the reading for this character: あ",
  "explanation": "string",
  "sortOrder": 0,
  "imageUrl": "https://ankiren.com",
  "type": "multiple_choice",
  "answers": [
    {
      "text": "string",
      "isCorrect": false,
      "sortOrder": 0,
      "imageUrl": "https://ankiren.com",
      "matchingKey": "string"
    }
  ]
}

Responses

201 · Question created

  • idinteger
  • contentIdinteger
  • externalIdstring?
  • textstring
  • explanationstring?
  • sortOrderinteger
  • imageUrlstring<uri>?
    format: uri
  • type"multiple_choice" | "matching" | "dropdown" | …
    enum: multiple_choice, matching, dropdown, true_false, image
  • createdAtstring<date-time>
    format: date-time
  • answers[CourseAnswer]
    • idinteger
    • questionIdinteger
    • externalIdstring?
    • textstring
    • imageUrlstring<uri>?
      format: uri
    • isCorrect0 | 1

      1 = correct, 0 = incorrect

    • sortOrderinteger
    • matchingKeystring?

      Used for matching-type questions

application/json
{
  "id": 1,
  "contentId": 1,
  "externalId": "q-hiragana-001",
  "text": "What is the reading for this character: あ",
  "explanation": "あ is pronounced as 'a' like in 'father'",
  "sortOrder": 0,
  "imageUrl": "https://ankiren.com",
  "type": "multiple_choice",
  "createdAt": "2026-01-01T00:00:00.000Z",
  "answers": [
    {
      "id": 1,
      "questionId": 1,
      "externalId": "a-hiragana-001-a",
      "text": "a",
      "imageUrl": "https://ankiren.com",
      "isCorrect": 1,
      "sortOrder": 0,
      "matchingKey": "group-a"
    }
  ]
}

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/{contentId}/questions' \
  -H 'Authorization: Bearer <token>' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "text": "What is the reading for this character: あ",
  "explanation": "string",
  "sortOrder": 0,
  "imageUrl": "https://ankiren.com",
  "type": "multiple_choice",
  "answers": [
    {
      "text": "string",
      "isCorrect": false,
      "sortOrder": 0,
      "imageUrl": "https://ankiren.com",
      "matchingKey": "string"
    }
  ]
}'