Responding to questions

To progress through the routes of the Smart Symptom Checker, questions provided as part of the API response need to be answered.

Questions that are asked as part of a conversation can be one of 2 types:

  • Free text questions that require a user to type in a response
  • Multiple choice questions that require the user to choose one or more answers from a list of choices

Free text

As the Healthily API is powered by AI, free text answers are required for certain questions. The AI is then able to process this information and respond accordingly.

ℹ️

Success

If a question object does not contain a choices array, a free text answer is expected.

Example response

{
    "popup": false,
    "messages": [{
        "type": "TEXT",
        "value": "OK Guest, please tell me what symptoms you have today. I'm a chatbot, so short sentences work best.",
        "meta": {
            "chat_context": [
                "false"
            ]
        }
    }],
    "question": {
        "mandatory": false,
        "multiple": false
    },
    "conversation_model": {
        "conversation_context": {
            "conversation": false,
            "type": "ASSESSMENT"
        },
        "symptoms_summary": {},
        "report": {}
    },
    "available_commands": [
        "STOP_CS"
    ],
    "conversation_id": "aea5d7f1-d0ec-4bad-8651-c8e0e40f2ed5"
}

Example request

The following request structure is used to reply to a free text question

{
    "message": "I have a headache",
    "conversation_id": "aea5d7f1-d0ec-4bad-8651-c8e0e40f2ed5"
}

Multiple choice

Single

Example response

The following API response describes a question for which the user should only provide one answer

{
    "popup": false,
    "messages": [{
        "type": "TEXT",
        "value": "OK Tim, please tell me how long you have been experiencing symptoms.",
        "meta": {
            "chat_context": [
                "false"
            ]
        }
    }],
    "question": {

        "mandatory": true,
        "multiple": false,
        "choices": [{
                "id": "hour",
                "label": "Few hours"
            },
            {
                "id": "day",
                "label": "Few days"
            },
            {
                "id": "week",
                "label": "Few weeks"
            },
            {
                "id": "month",
                "label": "Few months"
            },
            {
                "id": "year",
                "label": "More than 3 months"
            }
        ]
    },
    "conversation_model": {
        "conversation_context": {
            "conversation": false,
            "type": "ASSESSMENT"
        },
        "symptoms_summary": {},
        "report": {}
    },
    "available_commands": [
        "STOP_CS"
    ],
    "conversation_id": "6e0fe8b7-eabc-4f64-b135-70946182579c"
}

Example request

The proceeding request should only contain one answer, the question.choices.id chosen by the user returned as a string in the message key.

{
    "message": "week",
    "conversation_id": "6e0fe8b7-eabc-4f64-b135-70946182579c"
}

Multiple

Example response

The following API response describes a question for which the user could provide one or more answers

{
    "popup": false,
    "messages": [{
        "type": "TEXT",
        "value": "OK Tim, please tell me how long you have been experiencing symptoms.",
        "meta": {
            "chat_context": [
                "false"
            ]
        }
    }],
    "question": {
        "mandatory": false,
        "multiple": true,
        "choices": [{
                "id": "C0028643",
                "label": "Numbness/tingling of skin"
            },
            {
                "id": "C0015230",
                "label": "Skin change (altered skin, colour change or rash)"
            },
            {
                "id": "C0151786",
                "label": "Weakness of specific body part(s)"
            },
            {
                "id": "CM000413",
                "label": "Swelling of part of the body"
            },
            {
                "id": "None of them",
                "label": "None of them"
            }
        ]
    },
    "conversation_model": {
        "conversation_context": {
            "conversation": false,
            "type": "ASSESSMENT"
        },
        "symptoms_summary": {},
        "report": {}
    },
    "available_commands": [
        "STOP_CS"
    ],
    "conversation_id": "6e0fe8b7-eabc-4f64-b135-70946182579c"
}

Example request

The proceeding request can contain multiple answers as a comma-separated list of question.choices.id in the message key.

{
    "message": "C0028643,C0151786",
    "conversation_id": "6e0fe8b7-eabc-4f64-b135-70946182579c"
}

What’s Next