Skip to main content
Skip table of contents

POST /v1/chatbot/answer

The chatbot is built mainly on question-answer flow. This endpoint can be used to answer the last asked question.

Request

Request header additional fields

Parameter name

Parameter type

Parameter description

check-id

string

The ongoing check’s identifier

Request body parameters

Parameter name

Parameter type

Parameter description

questionId

string

id of the answered question

answer

Answer?

If the question is not skipped, the answer can be included in this object

Examples

Click here to expand...

The patient entered '1980' as the answer to a TEXT type question

JSON
{
    "questionId": "6bcd3297-3c66-47c2-af3e-1fc8688be628",
    "answer": {
        "value": "1980"
    }
}

The patient selected an option item with id 'ebf2b5b3-1d42-40ec-bba0-6a43f9da5b5a' as answer

JSON
{
    "questionId": "e38f994b-6464-4c49-8b11-28687031d46d",
    "answer": {
        "id": "ebf2b5b3-1d42-40ec-bba0-6a43f9da5b5a"
    }
}

The patient skipped the question

JSON
{
    "questionId": "183d2cd6-567f-416b-befb-065500cbaf57"
}

Response

Response Body data structure

Property name

Property type

Property description

checkStatus

CheckStatus

See the purpose of the type

mandatoryFunction

FunctionType

Deprecated. Use GET /v1/chatbot/question and FUNCTION question type instead.

Example

The check is still in progress, the client app can request the next question

JSON
{
  "checkStatus": "IN_PROGRESS"
}

QuestionType related behavior

  • TEXT: The question is expected not to have options. Send the answer value or skip the question (if the question is skippable) and the check moves on to the next question without any additional action

  • SINGLE_SELECT: The question is expected to have options. Send the id of the selected option, or a skip answer (if the question is skippable) and the check moves on to the next question without any additional action

  • INFO: The question is expected not to have options. The check moves on only if a skip answer is sent to this endpoint

  • EXTENDING: The question is expected to have options. If the patient selected an option, send the id of the selected option. After this action, the question should be requested again. Its options list will be expanded with new items. Patients can keep on selecting new options as long as they want, the question must be requested again after each selection. The selection loop can be finished by sending a skip answer. It’s required for the check flow to move on

  • FUNCTION: This endpoint can not be used for FUNCTION-type questions. The related function’s confirm endpoint must be used to continue the check

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.