curl --request PUT \
--url https://api.eka.care/assessment/api/v1/continue/{assessment_id}/{qid} \
--header 'Content-Type: application/json' \
--header 'auth: <api-key>' \
--header 'client-id: <client-id>' \
--data '
{
"user_response": [
{
"selected_choices": [
{
"choice_id": "test-choice-1",
"choice_label": "Fever"
}
]
}
]
}
'import requests
url = "https://api.eka.care/assessment/api/v1/continue/{assessment_id}/{qid}"
payload = { "user_response": [{ "selected_choices": [
{
"choice_id": "test-choice-1",
"choice_label": "Fever"
}
] }] }
headers = {
"client-id": "<client-id>",
"auth": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'client-id': '<client-id>',
auth: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
user_response: [{selected_choices: [{choice_id: 'test-choice-1', choice_label: 'Fever'}]}]
})
};
fetch('https://api.eka.care/assessment/api/v1/continue/{assessment_id}/{qid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eka.care/assessment/api/v1/continue/{assessment_id}/{qid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'user_response' => [
[
'selected_choices' => [
[
'choice_id' => 'test-choice-1',
'choice_label' => 'Fever'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"auth: <api-key>",
"client-id: <client-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eka.care/assessment/api/v1/continue/{assessment_id}/{qid}"
payload := strings.NewReader("{\n \"user_response\": [\n {\n \"selected_choices\": [\n {\n \"choice_id\": \"test-choice-1\",\n \"choice_label\": \"Fever\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("client-id", "<client-id>")
req.Header.Add("auth", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.eka.care/assessment/api/v1/continue/{assessment_id}/{qid}")
.header("client-id", "<client-id>")
.header("auth", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_response\": [\n {\n \"selected_choices\": [\n {\n \"choice_id\": \"test-choice-1\",\n \"choice_label\": \"Fever\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/assessment/api/v1/continue/{assessment_id}/{qid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["client-id"] = '<client-id>'
request["auth"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_response\": [\n {\n \"selected_choices\": [\n {\n \"choice_id\": \"test-choice-1\",\n \"choice_label\": \"Fever\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"questions": [
{
"qid": 0,
"component_code": "I-ATSG",
"question_text": "Add all symptoms",
"tip": "Type here to search for symptoms.",
"component_data": {
"url": {
"base_url": "https://mdb.dev.eka.care/v1/sa-terms",
"query_params": {
"gender": "m",
"age": "23",
"src": "sn"
},
"search_query_param": "q"
},
"autosuggest_static_choices": {
"sections": [
{
"section_title": "Most Searched",
"choices": [
{
"id": "47258974-a65c-11eb-8d02-1e003a340630",
"common_name": "Fever"
},
{
"id": "473f9e54-a65c-11eb-8d02-1e003a340630",
"common_name": "Constipation"
},
{
"id": "471e8e62-a65c-11eb-8d02-1e003a340630",
"common_name": "Cough"
},
{
"id": "476efd70-a65c-11eb-8d02-1e003a340630",
"common_name": "Acidity"
},
{
"id": "4736971e-a65c-11eb-8d02-1e003a340630",
"common_name": "Diarrhoea"
},
{
"id": "4737ee0c-a65c-11eb-8d02-1e003a340630",
"common_name": "Vomiting"
},
{
"id": "4720607a-a65c-11eb-8d02-1e003a340630",
"common_name": "Headache",
"is_selected": true
},
{
"id": "47172c6c-a65c-11eb-8d02-1e003a340630",
"common_name": "Stomach ache"
}
]
}
]
}
},
"is_mandatory": true
}
],
"progress": "0.00",
"is_last_question": false
}
{
"questions": [
{
"qid": 1,
"component_code": "I-MULT",
"question_text": "Select all the symptoms you are experiencing",
"tip": "Select all option(s) that are applicable to you.",
"component_data": {
"choices": [
{
"choice_id": "s_473b48a4-a65c-11eb-8d02-1e003a340630",
"choice_label": "Throat pain"
},
{
"choice_id": "s_475b7ca0-a65c-11eb-8d02-1e003a340630",
"choice_label": "Body aches"
},
{
"choice_id": "s_4739c8bc-a65c-11eb-8d02-1e003a340630",
"choice_label": "Loss of weight"
},
{
"choice_id": "s_1fd50722-af36-11eb-8fc3-1e003a340631",
"choice_label": "Runny nose or discharge from nose"
},
{
"choice_id": "s_4784e554-a65c-11eb-8d02-1e003a340630",
"choice_label": "Loss of sense of smell"
},
{
"choice_id": "nota",
"choice_label": "None of the above"
}
]
}
}
],
"progress": "7.69",
"is_last_question": false
}
{
"questions": [
{
"qid": 2,
"component_code": "I-RADO",
"question_text": "Since when have you been experiencing fever",
"tip": "Select one of the options",
"component_data": {
"choices": [
{
"choice_id": "s_47259d92-a65c-11eb-8d02-1e003a340630",
"choice_label": "Less than 1 day"
},
{
"choice_id": "s_4725b232-a65c-11eb-8d02-1e003a340630",
"choice_label": "1 day to 4 days"
},
{
"choice_id": "s_4725c6a0-a65c-11eb-8d02-1e003a340630",
"choice_label": "More than 4 days"
},
{
"choice_id": "d_0e1592a4-e8c5-11eb-a89e-1e003a340631",
"choice_label": "I am not sure"
}
]
}
}
],
"progress": "15.38",
"is_last_question": false
}
{
"questions": [
{
"qid": 11,
"component_code": "I-RADG",
"question_text": "Have you lost your sense of taste and feel like you can't get the taste of food that you are consuming?\"",
"tip": "Select one answer in each row.",
"component_data": {
"choices": [
{
"choice_id": "s_344147d6-b416-11eb-8c69-1e003a340631",
"choice_label": "Loss of taste",
"qualifier": [
{
"id": "p",
"label": "Yes"
},
{
"id": "a",
"label": "No"
},
{
"id": "u",
"label": "Don't Know"
}
]
}
]
}
}
],
"progress": "84.62",
"is_last_question": false
}
{
"error": {
"error_code": "missing_field",
"display_message": "Uh huh, you missed a required field",
"message": "Missing required field - [ Error in field `choice_id`: This field is required. ]"
}
}
Step 3. Continue Assessment
This API is used to submit user answers and get the next questions based on the answers.
is_last_question will be true curl --request PUT \
--url https://api.eka.care/assessment/api/v1/continue/{assessment_id}/{qid} \
--header 'Content-Type: application/json' \
--header 'auth: <api-key>' \
--header 'client-id: <client-id>' \
--data '
{
"user_response": [
{
"selected_choices": [
{
"choice_id": "test-choice-1",
"choice_label": "Fever"
}
]
}
]
}
'import requests
url = "https://api.eka.care/assessment/api/v1/continue/{assessment_id}/{qid}"
payload = { "user_response": [{ "selected_choices": [
{
"choice_id": "test-choice-1",
"choice_label": "Fever"
}
] }] }
headers = {
"client-id": "<client-id>",
"auth": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {
'client-id': '<client-id>',
auth: '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
user_response: [{selected_choices: [{choice_id: 'test-choice-1', choice_label: 'Fever'}]}]
})
};
fetch('https://api.eka.care/assessment/api/v1/continue/{assessment_id}/{qid}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eka.care/assessment/api/v1/continue/{assessment_id}/{qid}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'user_response' => [
[
'selected_choices' => [
[
'choice_id' => 'test-choice-1',
'choice_label' => 'Fever'
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"auth: <api-key>",
"client-id: <client-id>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.eka.care/assessment/api/v1/continue/{assessment_id}/{qid}"
payload := strings.NewReader("{\n \"user_response\": [\n {\n \"selected_choices\": [\n {\n \"choice_id\": \"test-choice-1\",\n \"choice_label\": \"Fever\"\n }\n ]\n }\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("client-id", "<client-id>")
req.Header.Add("auth", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.eka.care/assessment/api/v1/continue/{assessment_id}/{qid}")
.header("client-id", "<client-id>")
.header("auth", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"user_response\": [\n {\n \"selected_choices\": [\n {\n \"choice_id\": \"test-choice-1\",\n \"choice_label\": \"Fever\"\n }\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/assessment/api/v1/continue/{assessment_id}/{qid}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["client-id"] = '<client-id>'
request["auth"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"user_response\": [\n {\n \"selected_choices\": [\n {\n \"choice_id\": \"test-choice-1\",\n \"choice_label\": \"Fever\"\n }\n ]\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"questions": [
{
"qid": 0,
"component_code": "I-ATSG",
"question_text": "Add all symptoms",
"tip": "Type here to search for symptoms.",
"component_data": {
"url": {
"base_url": "https://mdb.dev.eka.care/v1/sa-terms",
"query_params": {
"gender": "m",
"age": "23",
"src": "sn"
},
"search_query_param": "q"
},
"autosuggest_static_choices": {
"sections": [
{
"section_title": "Most Searched",
"choices": [
{
"id": "47258974-a65c-11eb-8d02-1e003a340630",
"common_name": "Fever"
},
{
"id": "473f9e54-a65c-11eb-8d02-1e003a340630",
"common_name": "Constipation"
},
{
"id": "471e8e62-a65c-11eb-8d02-1e003a340630",
"common_name": "Cough"
},
{
"id": "476efd70-a65c-11eb-8d02-1e003a340630",
"common_name": "Acidity"
},
{
"id": "4736971e-a65c-11eb-8d02-1e003a340630",
"common_name": "Diarrhoea"
},
{
"id": "4737ee0c-a65c-11eb-8d02-1e003a340630",
"common_name": "Vomiting"
},
{
"id": "4720607a-a65c-11eb-8d02-1e003a340630",
"common_name": "Headache",
"is_selected": true
},
{
"id": "47172c6c-a65c-11eb-8d02-1e003a340630",
"common_name": "Stomach ache"
}
]
}
]
}
},
"is_mandatory": true
}
],
"progress": "0.00",
"is_last_question": false
}
{
"questions": [
{
"qid": 1,
"component_code": "I-MULT",
"question_text": "Select all the symptoms you are experiencing",
"tip": "Select all option(s) that are applicable to you.",
"component_data": {
"choices": [
{
"choice_id": "s_473b48a4-a65c-11eb-8d02-1e003a340630",
"choice_label": "Throat pain"
},
{
"choice_id": "s_475b7ca0-a65c-11eb-8d02-1e003a340630",
"choice_label": "Body aches"
},
{
"choice_id": "s_4739c8bc-a65c-11eb-8d02-1e003a340630",
"choice_label": "Loss of weight"
},
{
"choice_id": "s_1fd50722-af36-11eb-8fc3-1e003a340631",
"choice_label": "Runny nose or discharge from nose"
},
{
"choice_id": "s_4784e554-a65c-11eb-8d02-1e003a340630",
"choice_label": "Loss of sense of smell"
},
{
"choice_id": "nota",
"choice_label": "None of the above"
}
]
}
}
],
"progress": "7.69",
"is_last_question": false
}
{
"questions": [
{
"qid": 2,
"component_code": "I-RADO",
"question_text": "Since when have you been experiencing fever",
"tip": "Select one of the options",
"component_data": {
"choices": [
{
"choice_id": "s_47259d92-a65c-11eb-8d02-1e003a340630",
"choice_label": "Less than 1 day"
},
{
"choice_id": "s_4725b232-a65c-11eb-8d02-1e003a340630",
"choice_label": "1 day to 4 days"
},
{
"choice_id": "s_4725c6a0-a65c-11eb-8d02-1e003a340630",
"choice_label": "More than 4 days"
},
{
"choice_id": "d_0e1592a4-e8c5-11eb-a89e-1e003a340631",
"choice_label": "I am not sure"
}
]
}
}
],
"progress": "15.38",
"is_last_question": false
}
{
"questions": [
{
"qid": 11,
"component_code": "I-RADG",
"question_text": "Have you lost your sense of taste and feel like you can't get the taste of food that you are consuming?\"",
"tip": "Select one answer in each row.",
"component_data": {
"choices": [
{
"choice_id": "s_344147d6-b416-11eb-8c69-1e003a340631",
"choice_label": "Loss of taste",
"qualifier": [
{
"id": "p",
"label": "Yes"
},
{
"id": "a",
"label": "No"
},
{
"id": "u",
"label": "Don't Know"
}
]
}
]
}
}
],
"progress": "84.62",
"is_last_question": false
}
{
"error": {
"error_code": "missing_field",
"display_message": "Uh huh, you missed a required field",
"message": "Missing required field - [ Error in field `choice_id`: This field is required. ]"
}
}
{
"questions": [
{
"qid": 0,
"component_code": "I-ATSG",
"question_text": "Add all symptoms",
"tip": "Type here to search for symptoms.",
"component_data": {
"url": {
"base_url": "https://mdb.dev.eka.care/v1/sa-terms",
"query_params": {
"gender": "m",
"age": "23",
"src": "sn"
},
"search_query_param": "q"
},
"autosuggest_static_choices": {
"sections": [
{
"section_title": "Most Searched",
"choices": [
{
"id": "47258974-a65c-11eb-8d02-1e003a340630",
"common_name": "Fever"
},
{
"id": "473f9e54-a65c-11eb-8d02-1e003a340630",
"common_name": "Constipation"
},
{
"id": "471e8e62-a65c-11eb-8d02-1e003a340630",
"common_name": "Cough"
},
{
"id": "476efd70-a65c-11eb-8d02-1e003a340630",
"common_name": "Acidity"
},
{
"id": "4736971e-a65c-11eb-8d02-1e003a340630",
"common_name": "Diarrhoea"
},
{
"id": "4737ee0c-a65c-11eb-8d02-1e003a340630",
"common_name": "Vomiting"
},
{
"id": "4720607a-a65c-11eb-8d02-1e003a340630",
"common_name": "Headache",
"is_selected": true
},
{
"id": "47172c6c-a65c-11eb-8d02-1e003a340630",
"common_name": "Stomach ache"
}
]
}
]
}
},
"is_mandatory": true
}
],
"progress": "0.00",
"is_last_question": false
}
{
"questions": [
{
"qid": 1,
"component_code": "I-MULT",
"question_text": "Select all the symptoms you are experiencing",
"tip": "Select all option(s) that are applicable to you.",
"component_data": {
"choices": [
{
"choice_id": "s_473b48a4-a65c-11eb-8d02-1e003a340630",
"choice_label": "Throat pain"
},
{
"choice_id": "s_475b7ca0-a65c-11eb-8d02-1e003a340630",
"choice_label": "Body aches"
},
{
"choice_id": "s_4739c8bc-a65c-11eb-8d02-1e003a340630",
"choice_label": "Loss of weight"
},
{
"choice_id": "s_1fd50722-af36-11eb-8fc3-1e003a340631",
"choice_label": "Runny nose or discharge from nose"
},
{
"choice_id": "s_4784e554-a65c-11eb-8d02-1e003a340630",
"choice_label": "Loss of sense of smell"
},
{
"choice_id": "nota",
"choice_label": "None of the above"
}
]
}
}
],
"progress": "7.69",
"is_last_question": false
}
{
"questions": [
{
"qid": 2,
"component_code": "I-RADO",
"question_text": "Since when have you been experiencing fever",
"tip": "Select one of the options",
"component_data": {
"choices": [
{
"choice_id": "s_47259d92-a65c-11eb-8d02-1e003a340630",
"choice_label": "Less than 1 day"
},
{
"choice_id": "s_4725b232-a65c-11eb-8d02-1e003a340630",
"choice_label": "1 day to 4 days"
},
{
"choice_id": "s_4725c6a0-a65c-11eb-8d02-1e003a340630",
"choice_label": "More than 4 days"
},
{
"choice_id": "d_0e1592a4-e8c5-11eb-a89e-1e003a340631",
"choice_label": "I am not sure"
}
]
}
}
],
"progress": "15.38",
"is_last_question": false
}
{
"questions": [
{
"qid": 11,
"component_code": "I-RADG",
"question_text": "Have you lost your sense of taste and feel like you can't get the taste of food that you are consuming?\"",
"tip": "Select one answer in each row.",
"component_data": {
"choices": [
{
"choice_id": "s_344147d6-b416-11eb-8c69-1e003a340631",
"choice_label": "Loss of taste",
"qualifier": [
{
"id": "p",
"label": "Yes"
},
{
"id": "a",
"label": "No"
},
{
"id": "u",
"label": "Don't Know"
}
]
}
]
}
}
],
"progress": "84.62",
"is_last_question": false
}
{
"error": {
"error_code": "missing_field",
"display_message": "Uh huh, you missed a required field",
"message": "Missing required field - [ Error in field `choice_id`: This field is required. ]"
}
}
hash in the URL is the unique identifier for the assessment which was provided in the response of init assessment API. The qid in the URL is the unique identifier for the question starting from 0 (first question).Authorizations
The authentication token of the developer (generated using Authorization API).
Headers
Any unique string to identify the logged in developer.
"test-client"
Locale is used to determine the language of the assessment. Supported locales are en, hi, kn for english, hindi and kannada respectively with default being en.
en, hi, kn "en"
Path Parameters
The hash that uniquely identifies the assessment session.
The question id that uniquely identifies the question.
Body
The request body should contain the answer to the question depending on the type of question component. It should be in format as explained in above dropdown.
- Autosuggest Request
- RadioRequest
- MultiRequest
- RadioGroupRequest
- UserInput
- SkippedRequest
Show child attributes
Show child attributes
Response
OK
- Master Response
- ATSG Response
- Radio Response
- Multi Select Response
- Radio Group Response
- Last Question Response
Show child attributes
Show child attributes
This is the progress of the assessment in percentage format. It is a number between 0.00 and 100.00.
0 <= x <= 10050
This is a boolean value. If true, this is the last question of the assessment and you can hit submit API.
false
Was this page helpful?

