Create an answer for a quiz

POST /manager/quiz-answer
application/json

Body Required

  • images array[object]
    Hide images attributes Show images attributes object
    • id_i18n_content integer
    • lang string

      Values are en_GB, fr_FR, es_ES, or de_DE.

    • content string
  • texts array[object]
    Hide texts attributes Show texts attributes object
    • id_i18n_content integer
    • lang string

      Values are en_GB, fr_FR, es_ES, or de_DE.

    • content string
  • is_correct boolean
  • nb_votes integer(int32)

Responses

  • 201 application/json

    returns the created quiz answer

    Hide response attributes Show response attributes object
    • id_quiz_answer integer(int32)
    • images array[object]
      Hide images attributes Show images attributes object
      • id_i18n_content integer
      • lang string

        Values are en_GB, fr_FR, es_ES, or de_DE.

      • content string
    • texts array[object]
      Hide texts attributes Show texts attributes object
      • id_i18n_content integer
      • lang string

        Values are en_GB, fr_FR, es_ES, or de_DE.

      • content string
    • is_correct boolean
    • nb_votes integer(int32)
  • 401 application/json

    Unauthorized.

    Hide response attribute Show response attribute object
    • message string
  • 403

    Forbidden - You don't have permission to access this route

  • 422 application/json

    Unprocessable Content

    Hide response attributes Show response attributes object
    • message string

      Error message.

    • errors object
      Hide errors attributes Show errors attributes object
      • field array[string]

        Error message details.

      • * array[string] Additional properties

        Error message details.

POST /manager/quiz-answer
curl \
 --request POST 'https://domain.tld/api/v2/manager/quiz-answer' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"images":[{"id_i18n_content":42,"lang":"en_GB","content":"Hello"}],"texts":[{"id_i18n_content":42,"lang":"en_GB","content":"Hello"}],"is_correct":"true","nb_votes":42}'
Request examples
{
  "images": [
    {
      "id_i18n_content": 42,
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "texts": [
    {
      "id_i18n_content": 42,
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "is_correct": "true",
  "nb_votes": 42
}
Response examples (201)
{
  "id_quiz_answer": 42,
  "images": [
    {
      "id_i18n_content": 42,
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "texts": [
    {
      "id_i18n_content": 42,
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "is_correct": "true",
  "nb_votes": 42
}
Response examples (401)
{
  "message": "Unauthorized."
}
Response examples (422)
{
  "message": "field is required! (and 3 more error)",
  "errors": {
    "field": [
      "Error message details here"
    ],
    "additionalProperty1": [
      "Error message details here"
    ],
    "additionalProperty2": [
      "Error message details here"
    ]
  }
}