Create a quiz

POST /manager/quiz
application/json

Body

  • active boolean Required
  • acknowledge boolean
  • start_date string | null
  • end_date string | null
  • type_answer string Required
  • type_callback string Required
  • titles array[object] Required
    Hide titles attributes Show titles attributes object
    • lang string

      Values are en_GB, fr_FR, es_ES, or de_DE.

    • content string
  • descriptions array[object]
    Hide descriptions attributes Show descriptions attributes object
    • lang string

      Values are en_GB, fr_FR, es_ES, or de_DE.

    • content string
  • questions array[object]
    Hide questions attributes Show questions attributes object
    • lang string

      Values are en_GB, fr_FR, es_ES, or de_DE.

    • content string
  • callback_text array[object]
    Hide callback_text attributes Show callback_text attributes object
    • lang string

      Values are en_GB, fr_FR, es_ES, or de_DE.

    • content string

Responses

  • 201 application/json

    returns the created quiz

    Hide response attributes Show response attributes object
    • id_quiz integer(int32)
    • active boolean
    • date_insert string(date-time)
    • date_update string(nullable)
    • start_date string(nullable)
    • end_date string(nullable)
    • acknowledge boolean
    • type_answer string(nullable)
    • type_callback string(nullable)
    • titles array[object]
      Hide titles attributes Show titles attributes object
      • id_i18n_content integer
      • lang string

        Values are en_GB, fr_FR, es_ES, or de_DE.

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

        Values are en_GB, fr_FR, es_ES, or de_DE.

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

        Values are en_GB, fr_FR, es_ES, or de_DE.

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

        Values are en_GB, fr_FR, es_ES, or de_DE.

      • content string
    • answers object

      Additional properties are allowed.

      Hide answers attributes Show answers 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)
    • ambassador_quiz_answer object

      Additional properties are allowed.

      Hide ambassador_quiz_answer attributes Show ambassador_quiz_answer attributes object
      • id_ambassador_quiz_answer integer(int32)
      • date_insert string(date-time)
      • ambassador object

        Additional properties are allowed.

        Hide ambassador attributes Show ambassador attributes object
        • id_ambassador integer(int32)
        • image string
        • firstname string
        • lastname string
        • username string
        • email string
        • email_tmp string
        • active integer(int32)
        • status integer(int32)
        • online boolean

          true: when last_action_date is less than 5 minutes ago

        • last_action_date string(date-time)
        • customer_id string
        • anonymized boolean
      • answer array[object]
        Hide answer attributes Show answer attributes object
        • id_i18n_content integer
        • lang string

          Values are en_GB, fr_FR, es_ES, or de_DE.

        • content string
    • answers_count integer(int32)
    • id_ambassador_post 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
curl \
 --request POST 'https://domain.tld/api/v2/manager/quiz' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"active":true,"acknowledge":true,"start_date":"string","end_date":"string","type_answer":"string","type_callback":"string","titles":[{"lang":"en_GB","content":"Hello"}],"descriptions":[{"lang":"en_GB","content":"Hello"}],"questions":[{"lang":"en_GB","content":"Hello"}],"callback_text":[{"lang":"en_GB","content":"Hello"}]}'
Request examples
{
  "active": true,
  "acknowledge": true,
  "start_date": "string",
  "end_date": "string",
  "type_answer": "string",
  "type_callback": "string",
  "titles": [
    {
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "descriptions": [
    {
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "questions": [
    {
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "callback_text": [
    {
      "lang": "en_GB",
      "content": "Hello"
    }
  ]
}
Response examples (201)
{
  "id_quiz": 42,
  "active": true,
  "date_insert": "2025-05-04T09:42:00Z",
  "date_update": "string",
  "start_date": "string",
  "end_date": "string",
  "acknowledge": true,
  "type_answer": "string",
  "type_callback": "string",
  "titles": [
    {
      "id_i18n_content": 42,
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "descriptions": [
    {
      "id_i18n_content": 42,
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "questions": [
    {
      "id_i18n_content": 42,
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "callback_texts": [
    {
      "id_i18n_content": 42,
      "lang": "en_GB",
      "content": "Hello"
    }
  ],
  "answers": {
    "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
  },
  "ambassador_quiz_answer": {
    "id_ambassador_quiz_answer": 42,
    "date_insert": "2025-05-04T09:42:00Z",
    "ambassador": {
      "id_ambassador": 42,
      "image": "string",
      "firstname": "string",
      "lastname": "string",
      "username": "string",
      "email": "string",
      "email_tmp": "string",
      "active": 42,
      "status": 42,
      "online": true,
      "last_action_date": "2025-05-04T09:42:00Z",
      "customer_id": "string",
      "anonymized": true
    },
    "answer": [
      {
        "id_i18n_content": 42,
        "lang": "en_GB",
        "content": "Hello"
      }
    ]
  },
  "answers_count": 42,
  "id_ambassador_post": 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"
    ]
  }
}