XUND
API ReferenceChatbot

Get the next question of the check

GET/v1/chatbot/question

The chatbot collects information from Patients by a question–answer flow. This endpoint is used to get the next question of the check.

Usage examples

URLPurpose
/v1/chatbot/questionUsing this endpoint without any additional parameter is its most frequent use case. The endpoint without parameters returns the last unanswered question with all its optionItems.
/v1/chatbot/question?optionTop=10The response question object will include only the top 10 optionItems. This parameter has no effect on the value of options.count in the response.
/v1/chatbot/question?optionTop=10&optionSkip=10The response question object will include the optionItems 11 to 20. These parameters have no effect on the value of options.count in the response.
/v1/chatbot/question?optionSearchTerm=tension%20headacheThe response question object will only include optionItems matching the search term: "tension headache".

Authorization

BearerToken
AuthorizationBearer <token>

Authenticate with a JWT bearer token obtained from the token endpoint with your Client Id and API key.

In: header

Query Parameters

optionTop?integer

If provided, only the top optionTop optionItem will be included in the response. Can be used for paging and/or performance optimization purposes. This parameter has no effect on the value of options.count in the response.

optionSkip?integer

If provided, the first optionSkip optionItem will not be included in the response. Can be used for paging and/or performance optimization purposes. This parameter has no effect on the value of options.count in the response.

optionSearchTerm?string

User-entered search text (localized). If provided, the optionItem list will include only the matching items. The resulting list of optionItems is sorted by relevancy. Space characters should be URL encoded. In some cases filtering happens by medical and not alphabetical logic, therefore the names or descriptions of results might not match the search term exactly.

questionId?string

By using this parameter, a recently asked question can be shown again.

Header Parameters

check-id*string

The ongoing check's identifier.

language*string

The expected language of the response.

Response Body

application/json

curl -X GET "https://example.com/v1/chatbot/question" \  -H "authorization: Bearer <token>" \  -H "check-id: 5e93d7a1-f240-43b5-8937-33419ea9cb6a" \  -H "language: en"

{  "id": "fadc8892-a7b0-473c-a67d-e8e676f0551f",  "text": "In which year were you born?",  "isSkippable": false,  "isAnswered": false,  "type": "TEXT",  "detailedType": "AGE",  "checkStateInfo": {    "detailedState": "AGE",    "state": "PROFILE"  },  "answerValidatorRegex": "^(19[0-9][0-9]|20[01][0-9]|202[0-2])$"}

Last updated on