Submit answers to a consult form

Submit your users responses to a consult form

🚧

This endpoint is authenticated by a Public key

Submit a response to a consult form to create an encounter with a patient. See a very simple example of the payload below.

{
	"patient":"hay8tauk1ivlovi",
  "form" : "rm22sbli4r3k1a9",
  "responses": [
    {
    	"question":1,
      "response":0,
      "value" : "Headache and Fever"
    },
    {
    	"question":2,
      "response":0,
      "value" : "4 days ago"
    }
  ]
}

How To Answer Form Questions

Each question has its own type. The value of response and value in the responses object might be a list if the question is a select_multiple. The different types are listed below:

Text | text- These questions values are set as null by default, users are expected to provide the answer in text.

Select One | select_one questions - These questions have options and users are expected to choose one value from the provided responses in the form questions.

Select Multiple | select_multiple - These questions have options provided and users are able to choose more than one option from the provided options. In this case, the structure of the response object is different a little.

See example below.

{
  "question": 9,
  "response": [2,3,4],
  "value": ["Paracetamol", "Chloroquine"]
 }

📘

Response codes

200: Answers submitted
400: Error
400: User record not found
400: Form not found
400: Form has no questions
400: Questions not sorted sequentially
400: Question $id not in form
400: Please provide answer to question $id
400: Response should be 1 for question $id
400: Response and Value should be an array for select_multiple questions
400: Response IDs passed no in select_multiple question response options
400: Values passed not in select_multiple question response options
400: Response ID passed not in select_one question response options
500: Server error

Body Params
string
required
Defaults to hay8tauk1ivlovi

ID of the user submitting the request

string
required
Defaults to rm22sbli4r3k1a9

ID of consult form being submitted

responses
array of objects

Answers to the form questions. See Glossary for more information

responses
Responses

Language
Credentials
Header
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json