GET
/
assessment
/
api
/
v1
/
component_list
curl --request GET \
  --url https://api.eka.care/assessment/api/v1/component_list/ \
  --header 'auth: <auth>'
{
  "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"
        ]
      }
    }
  }
}

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

auth
string
required

The auth token of the user. It is used to authenticate the user.

Content-Type
string

The content type of the request. It is used to determine the type of data being sent.

Response

200
application/json
OK

The response contains json schema for request and response format of each component.