获取问卷聚合数据
接口概述
- 功能:获取问卷聚合数据
- 请求方式:POST
- 请求地址:/api/surveys/{survey_id}/report_aggs?appid={appid}&access_token={access_token}
请求参数
参数名 | 类型 | 必须 | 参数位置 | 描述 | 示例值 |
---|---|---|---|---|---|
survey_id | integer | 是 | uri | 问卷ID | 292192 |
from | integer | 否 | body | 开始时间(时间戳,单位秒) | 1730190699 |
to | integer | 否 | body | 结束时间(时间戳,单位秒) | 1730192699 |
interval | string | 否 | body | 答题趋势间隔 ("1w", "1d", "12h", "3h", "1h", "10m", "5m", "1m") | 1d |
响应参数
参数名 | 类型 | 描述 |
---|---|---|
duration_avg | integer | 平均答题时长 |
status | array | 答题状态统计 |
status[0].key | string | 状态("valid", "invalid") |
status[0].count | integer | 数量 |
channel | array | 渠道统计 |
channel[0].key | string | 渠道("unknown", "wx") |
channel[0].count | integer | 数量 |
location | array | 地域统计 |
location[0].key | string | 国家 |
location[0].count | integer | 数量 |
location[0].children | array | 下层地域统计 |
ua_device | array | 设备统计 |
ua_device[0].key | string | 设备("unknown", "Computer") |
ua_device[0].count | integer | 数量 |
ua_os | array | 操作系统统计 |
ua_os[0].key | string | 操作系统("unknown", "MacOS") |
ua_os[0].count | integer | 数量 |
trends | array | 答题趋势 |
trends[0].key | string | 时间戳,单位毫秒 |
trends[0].count | integer | 数量 |
响应示例
{
"error": {
"type": ""
},
"data": {
"duration_avg": 11,
"status": [
{
"key": "valid",
"count": 5
},
{
"key": "invalid",
"count": 1
}
],
"channel": [
{
"key": "unknown",
"count": 5
},
{
"key": "wx",
"count": 1
}
],
"location": [
{
"key": "中国",
"count": 6,
"children": [
{
"key": "广东省",
"count": 6,
"children": [
{
"key": "深圳市",
"count": 5,
"children": []
},
{
"key": "广州市",
"count": 1,
"children": []
}
]
}
]
}
],
"ua_device": [
{
"key": "unknown",
"count": 4
},
{
"key": "Computer",
"count": 2
}
],
"ua_os": [
{
"key": "unknown",
"count": 4
},
{
"key": "MacOS",
"count": 2
}
],
"trends": [
{
"key": "1730044800000",
"count": 4
},
{
"key": "1730131200000",
"count": 2
}
]
},
"code": "OK",
"request_id": "lVX5tIxeZlZ6Wov020241029164207"
}