Skip to content

Post Answers (Anonymous User)

Submit quiz answers for an anonymous user.


Overview

This endpoint allows submitting answers to quiz questions for an anonymous user. It returns the updated answer object and the anonymous user ID.

Method: POST
Endpoint:
/api/v1/namespaces/:namespaceId/quizzes/:quizId/users/anonymous/answers

Quiz must support anonymous participation.


Request

Path Parameters

ParameterTypeRequiredDescription
namespaceIdstringNamespace unique ID
quizIdstringQuiz unique ID

Body

json
{
  "anonymousUserId": "anon_12345",
  "questionId": "question123",
  "answer": {
    "type": "text",
    "value": "Answer content"
  },
  "language": "en"
}

Body Parameters

FieldTypeRequiredDescription
anonymousUserIdstringAnonymous user identifier
questionIdstringID of the question being answered
answerobjectAnswer content
languagestringOptional language preference

Response

json
{
  "answers": {
    "id": "quiz1234-anon_12345",
    "userId": "anon_12345",
    "quizId": "quiz1234",
    "qAnswers": {},
    "completionStatus": 2,
    "isAnonymous": true
  },
  "anonymousUserId": "anon_12345"
}

Error Responses

  • 500 Internal Server Error – If the quiz does not exist
json
{
  "error": "quiz does not exist"
}

Other possible errors:

  • Quiz not found
  • Namespace not found
  • Invited user not found