Validate indication survey answers
POST
/prescription/survey/validate
const url = 'https://client-api.abi.ai/prescription/survey/validate';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"id":42,"answers":[{"id":1001,"answer":{"id":2001}},{"id":1002,"answer":{"text":"No known allergies."}}]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
id
required
Indication-survey identifier from the template.
integer
Example
42answers
required
Array<object>
object
id
required
Question identifier supplied by the survey template.
integer
Example
1001answer
required
Use id for a choice answer or text for an open-ended answer.
object
id
Selected choice identifier.
integer
Example
2001text
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." } } ]}Responses
Section titled “Responses”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"}