Skip to content

Validate indication survey answers

POST
/prescription/survey/validate
curl --request POST \
--url https://client-api.abi.ai/prescription/survey/validate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "id": 42, "answers": [ { "id": 1001, "answer": { "id": 2001 } }, { "id": 1002, "answer": { "text": "No known allergies." } } ] }'

Validate submitted indication-survey answers against the configured survey structure before creating a prescription request.

Media typeapplication/json
object
id
required

Indication-survey identifier from the template.

integer
Example
42
answers
required
Array<object>
object
id
required

Question identifier supplied by the survey template.

integer
Example
1001
answer
required

Use id for a choice answer or text for an open-ended answer.

object
id

Selected choice identifier.

integer
Example
2001
text

Open-ended answer text.

string
Example
No known allergies.
Example
{
"id": 42,
"answers": [
{
"id": 1001,
"answer": {
"id": 2001
}
},
{
"id": 1002,
"answer": {
"text": "No known allergies."
}
}
]
}

Validation completed. An empty array means the submitted answers match the survey template.

Media typeapplication/json

Validation errors. An empty array means that the submitted answers are valid.

Array<string>
Example
[]

Request could not be completed.

Media typeapplication/json
object
code

Short machine-readable error code.

string
message

Human-readable explanation of the error.

string
Examplegenerated
{
"code": "example",
"message": "example"
}