List all the components
curl --request GET \
--url https://api.eka.care/assessment/api/v1/component_list/ \
--header 'auth: <auth>'import requests
url = "https://api.eka.care/assessment/api/v1/component_list/"
headers = {"auth": "<auth>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {auth: '<auth>'}};
fetch('https://api.eka.care/assessment/api/v1/component_list/', 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/component_list/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"auth: <auth>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.eka.care/assessment/api/v1/component_list/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("auth", "<auth>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.eka.care/assessment/api/v1/component_list/")
.header("auth", "<auth>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/assessment/api/v1/component_list/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["auth"] = '<auth>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"autosuggest": {
"question": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"questions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"qid": {
"type": "number"
},
"component_code": {
"type": "string"
},
"question_text": {
"type": "string"
},
"tip": {
"type": "string"
},
"component_data": {
"type": "object",
"properties": {
"url": {
"type": "object",
"properties": {
"base_url": {
"type": "string"
},
"query_params": {
"type": "object",
"properties": {
"gender": {
"type": "string"
},
"age": {
"type": "string"
},
"src": {
"type": "string"
}
},
"required": [
"gender",
"age"
]
},
"search_query_param": {
"type": "string"
}
},
"required": [
"base_url",
"query_params",
"search_query_param"
]
},
"autosuggest_static_choices": {
"type": "object",
"properties": {
"sections": {
"type": "array",
"items": {
"type": "object",
"properties": {
"section_title": {
"type": "string"
},
"choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"common_name": {
"type": "string"
},
"is_selected": {
"type": "boolean"
}
},
"required": [
"id",
"common_name"
]
}
}
},
"required": [
"section_title",
"choices"
]
}
}
},
"required": [
"sections"
]
}
},
"required": [
"url",
"autosuggest_static_choices"
]
},
"is_mandatory": {
"type": "boolean"
}
},
"required": [
"qid",
"component_code",
"question_text",
"tip",
"component_data",
"is_mandatory"
]
}
},
"progress": {
"type": "string"
},
"is_last_question": {
"type": "boolean"
}
},
"required": [
"questions",
"progress",
"is_last_question"
]
},
"answer": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"user_response": {
"type": "array",
"items": {
"type": "object",
"properties": {
"selected_choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"choice_id": {
"type": "string"
},
"choice_label": {
"type": "string"
}
},
"required": [
"choice_id"
]
}
}
},
"required": [
"selected_choices"
]
}
}
},
"required": [
"user_response"
]
}
},
"multi_select": {
"question": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"questions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"qid": {
"type": "number"
},
"component_code": {
"type": "string"
},
"question_text": {
"type": "string"
},
"tip": {
"type": "string"
},
"component_data": {
"type": "object",
"properties": {
"choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"choice_id": {
"type": "string"
},
"choice_label": {
"type": "string"
}
},
"required": [
"choice_id",
"choice_label"
]
}
}
},
"required": [
"choices"
]
}
},
"required": [
"qid",
"component_code",
"component_data",
"question_text"
]
}
},
"progress": {
"type": "string"
},
"is_last_question": {
"type": "boolean"
}
},
"required": [
"questions",
"progress",
"is_last_question"
]
},
"answer": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"user_response": {
"type": "array",
"items": {
"type": "object",
"properties": {
"selected_choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"choice_id": {
"type": "string"
},
"choice_label": {
"type": "string"
}
},
"required": [
"choice_id"
]
}
}
},
"required": [
"selected_choices"
]
}
}
},
"required": [
"user_response"
]
}
},
"radio": {
"question": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"questions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"qid": {
"type": "number"
},
"component_code": {
"type": "string"
},
"question_text": {
"type": "string"
},
"tip": {
"type": "string"
},
"component_data": {
"type": "object",
"properties": {
"choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"choice_id": {
"type": "string"
},
"choice_label": {
"type": "string"
}
},
"required": [
"choice_id",
"choice_label"
]
}
}
},
"required": [
"choices"
]
}
},
"required": [
"qid",
"component_code",
"component_data",
"question_text"
]
}
},
"progress": {
"type": "string"
},
"is_last_question": {
"type": "boolean"
}
},
"required": [
"questions",
"progress",
"is_last_question"
]
},
"answer": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"user_response": {
"type": "array",
"items": {
"type": "object",
"properties": {
"selected_choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"choice_id": {
"type": "string"
},
"choice_label": {
"type": "string"
}
},
"required": [
"choice_id"
]
},
"maxItems": 1
}
},
"required": [
"selected_choices"
]
}
}
},
"required": [
"user_response"
]
}
},
"radio_group": {
"question": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"questions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"qid": {
"type": "number"
},
"component_code": {
"type": "string"
},
"question_text": {
"type": "string"
},
"tip": {
"type": "string"
},
"component_data": {
"type": "object",
"properties": {
"choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"choice_id": {
"type": "string"
},
"choice_label": {
"type": "string"
},
"qualifier": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"label": {
"type": "string"
}
},
"required": [
"id",
"label"
]
}
}
},
"required": [
"choice_id",
"choice_label",
"qualifier"
]
}
}
},
"required": [
"choices"
]
}
},
"required": [
"qid",
"component_code",
"component_data",
"question_text"
]
}
},
"progress": {
"type": "string"
},
"is_last_question": {
"type": "boolean"
}
},
"required": [
"questions",
"progress",
"is_last_question"
]
},
"answer": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"user_response": {
"type": "array",
"items": {
"type": "object",
"properties": {
"selected_choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"choice_id": {
"type": "string"
},
"choice_label": {
"type": "string"
},
"choice_qualifier": {
"type": "string",
"enum": [
"p",
"a",
"u"
]
}
},
"required": [
"choice_id",
"choice_qualifier"
]
}
}
},
"required": [
"selected_choices"
]
}
}
},
"required": [
"user_response"
]
}
}
}
}{
"error": {
"error_code": "bad_request",
"display_message": "Something went wrong. Please try again.",
"message": "Bad Request"
}
}Assessment APIS
List all the components
This API is used to list all the components and the details about request and response format of each component. It includes the json schema of the request and response format of each component.
GET
/
assessment
/
api
/
v1
/
component_list
/
List all the components
curl --request GET \
--url https://api.eka.care/assessment/api/v1/component_list/ \
--header 'auth: <auth>'import requests
url = "https://api.eka.care/assessment/api/v1/component_list/"
headers = {"auth": "<auth>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {auth: '<auth>'}};
fetch('https://api.eka.care/assessment/api/v1/component_list/', 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/component_list/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"auth: <auth>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.eka.care/assessment/api/v1/component_list/"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("auth", "<auth>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.eka.care/assessment/api/v1/component_list/")
.header("auth", "<auth>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eka.care/assessment/api/v1/component_list/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["auth"] = '<auth>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"autosuggest": {
"question": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"questions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"qid": {
"type": "number"
},
"component_code": {
"type": "string"
},
"question_text": {
"type": "string"
},
"tip": {
"type": "string"
},
"component_data": {
"type": "object",
"properties": {
"url": {
"type": "object",
"properties": {
"base_url": {
"type": "string"
},
"query_params": {
"type": "object",
"properties": {
"gender": {
"type": "string"
},
"age": {
"type": "string"
},
"src": {
"type": "string"
}
},
"required": [
"gender",
"age"
]
},
"search_query_param": {
"type": "string"
}
},
"required": [
"base_url",
"query_params",
"search_query_param"
]
},
"autosuggest_static_choices": {
"type": "object",
"properties": {
"sections": {
"type": "array",
"items": {
"type": "object",
"properties": {
"section_title": {
"type": "string"
},
"choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"common_name": {
"type": "string"
},
"is_selected": {
"type": "boolean"
}
},
"required": [
"id",
"common_name"
]
}
}
},
"required": [
"section_title",
"choices"
]
}
}
},
"required": [
"sections"
]
}
},
"required": [
"url",
"autosuggest_static_choices"
]
},
"is_mandatory": {
"type": "boolean"
}
},
"required": [
"qid",
"component_code",
"question_text",
"tip",
"component_data",
"is_mandatory"
]
}
},
"progress": {
"type": "string"
},
"is_last_question": {
"type": "boolean"
}
},
"required": [
"questions",
"progress",
"is_last_question"
]
},
"answer": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"user_response": {
"type": "array",
"items": {
"type": "object",
"properties": {
"selected_choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"choice_id": {
"type": "string"
},
"choice_label": {
"type": "string"
}
},
"required": [
"choice_id"
]
}
}
},
"required": [
"selected_choices"
]
}
}
},
"required": [
"user_response"
]
}
},
"multi_select": {
"question": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"questions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"qid": {
"type": "number"
},
"component_code": {
"type": "string"
},
"question_text": {
"type": "string"
},
"tip": {
"type": "string"
},
"component_data": {
"type": "object",
"properties": {
"choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"choice_id": {
"type": "string"
},
"choice_label": {
"type": "string"
}
},
"required": [
"choice_id",
"choice_label"
]
}
}
},
"required": [
"choices"
]
}
},
"required": [
"qid",
"component_code",
"component_data",
"question_text"
]
}
},
"progress": {
"type": "string"
},
"is_last_question": {
"type": "boolean"
}
},
"required": [
"questions",
"progress",
"is_last_question"
]
},
"answer": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"user_response": {
"type": "array",
"items": {
"type": "object",
"properties": {
"selected_choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"choice_id": {
"type": "string"
},
"choice_label": {
"type": "string"
}
},
"required": [
"choice_id"
]
}
}
},
"required": [
"selected_choices"
]
}
}
},
"required": [
"user_response"
]
}
},
"radio": {
"question": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"questions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"qid": {
"type": "number"
},
"component_code": {
"type": "string"
},
"question_text": {
"type": "string"
},
"tip": {
"type": "string"
},
"component_data": {
"type": "object",
"properties": {
"choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"choice_id": {
"type": "string"
},
"choice_label": {
"type": "string"
}
},
"required": [
"choice_id",
"choice_label"
]
}
}
},
"required": [
"choices"
]
}
},
"required": [
"qid",
"component_code",
"component_data",
"question_text"
]
}
},
"progress": {
"type": "string"
},
"is_last_question": {
"type": "boolean"
}
},
"required": [
"questions",
"progress",
"is_last_question"
]
},
"answer": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"user_response": {
"type": "array",
"items": {
"type": "object",
"properties": {
"selected_choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"choice_id": {
"type": "string"
},
"choice_label": {
"type": "string"
}
},
"required": [
"choice_id"
]
},
"maxItems": 1
}
},
"required": [
"selected_choices"
]
}
}
},
"required": [
"user_response"
]
}
},
"radio_group": {
"question": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"questions": {
"type": "array",
"items": {
"type": "object",
"properties": {
"qid": {
"type": "number"
},
"component_code": {
"type": "string"
},
"question_text": {
"type": "string"
},
"tip": {
"type": "string"
},
"component_data": {
"type": "object",
"properties": {
"choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"choice_id": {
"type": "string"
},
"choice_label": {
"type": "string"
},
"qualifier": {
"type": "array",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"label": {
"type": "string"
}
},
"required": [
"id",
"label"
]
}
}
},
"required": [
"choice_id",
"choice_label",
"qualifier"
]
}
}
},
"required": [
"choices"
]
}
},
"required": [
"qid",
"component_code",
"component_data",
"question_text"
]
}
},
"progress": {
"type": "string"
},
"is_last_question": {
"type": "boolean"
}
},
"required": [
"questions",
"progress",
"is_last_question"
]
},
"answer": {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"user_response": {
"type": "array",
"items": {
"type": "object",
"properties": {
"selected_choices": {
"type": "array",
"items": {
"type": "object",
"properties": {
"choice_id": {
"type": "string"
},
"choice_label": {
"type": "string"
},
"choice_qualifier": {
"type": "string",
"enum": [
"p",
"a",
"u"
]
}
},
"required": [
"choice_id",
"choice_qualifier"
]
}
}
},
"required": [
"selected_choices"
]
}
}
},
"required": [
"user_response"
]
}
}
}
}{
"error": {
"error_code": "bad_request",
"display_message": "Something went wrong. Please try again.",
"message": "Bad Request"
}
}The response of this API contains the details of all the components and request and response format of each component in the form of json schema. These json schemas can be used to validate the request and response format of each component.
The format of the response is as follows:
Response
{
"success": true,
"data": {
"autosuggest": {
"question": {}, //json_schema for I-ATSG component question
"answer": {} // json_schema for I-ATSG component answer
},
"multi_select": {
"question": {}, // json_schema for I-MULT component question
"answer": {} // json_schema for I-MULT component answer
},
"radio": {
"question": {}, // json_schema for I-RADO component question
"answer": {} // json_schema for I-RADO component answer
},
"radio_group": {
"question": {}, // json_schema for I-RADG component question
"answer": {} // json_schema for I-RADG component answer
}
}
}
Headers
The auth token of the user. It is used to authenticate the user.
The content type of the request. It is used to determine the type of data being sent.
Response
OK
The response contains json schema for request and response format of each component.
Was this page helpful?
⌘I

