跳到主要内容

获取题目统计概况

接口概述

  • 功能:获取题目统计概况
  • 请求方式: POST
  • 请求地址:/api/surveys/{survey_id}/analytics/aggs

请求参数

参数名类型参数位置描述示例值
survey_idintegeruri问卷ID292192
question_idsarray[string]body题目 ID 列表,来自获取问卷详情["q-1-kEFC"]

响应示例

{
"code": "OK",
"error": {
"type": ""
},
"data": {
"aggregations": {
"q-1-kEFC": { //题目ID
"doc_count": 1, // 当前题目统计总量
"filtered": {
"buckets": [
{
"doc_count": 1, // 当前选项统计数量
"key": "o-101-EFGH" // 选项 ID
}
],
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0
}
}
},
"total": 1
},
"request_id": "1fb7b924-acb4-4595-a083-86c9b199c1d7"
}