Skip to content

REST API 数据结构

RunRequest

POST /api/v1/configs 返回 RunRequestPOST /api/v1/tasks 接收同一结构。

json
{
  "source": {
    "url": "https://www.wjx.cn/vm/example.aspx",
    "provider": "wjx"
  },
  "definition": {
    "provider": "wjx",
    "title": "用户满意度调查",
    "questions": []
  },
  "execution": {
    "target": 10,
    "threads": 2,
    "submitInterval": [0, 0],
    "answerDuration": [60, 120],
    "failStop": true,
    "pauseOnAliyunCaptcha": true
  },
  "answers": {
    "rules": [],
    "dimensions": [],
    "questions": []
  },
  "reverseFill": {
    "enabled": false,
    "format": "auto",
    "startRow": 1,
    "threads": 1
  },
  "psychometrics": {
    "enabled": true,
    "targetAlpha": 0.85
  }
}
字段类型说明
source.urlstring问卷链接。创建任务时不能为空。
source.providerstringwjxqqcredamo
definitionSurveyDefinition解析得到的问卷快照。
execution.targetinteger目标提交份数。
execution.threadsinteger并发数。
execution.submitInterval[integer, integer]每个工作线程两次提交之间的随机等待秒数。
execution.answerDuration[integer, integer]作答时长范围,单位秒。
execution.answerDatetimeWindow[string, string]可选作答时间窗口。
execution.failStopboolean连续失败达到阈值时停止。
execution.pauseOnAliyunCaptchaboolean遇到阿里云验证码时暂停。
answers.rulesConsistencyRule[]条件一致性规则。
answers.dimensionsstring[]心理测量维度。
answers.questionsQuestionStrategy[]每道题的答案策略。
reverseFillReverseFillPlanExcel 反填配置。
psychometricsPsychometricPolicy信效度配置。

QuestionStrategy

字段类型说明
question_typestringsinglemultipledropdownscalematrixorderslidertextmulti_text
probabilitiesWeightTable选项或矩阵行权重。
custom_weightsWeightTable自定义分布权重。
textsstring[]填空候选值。
rowsinteger矩阵行数。
option_countinteger选项数。
distribution_modestringrandomcustomreverse_fill
question_numinteger题号。
question_titlestring题目标题。
survey_providerstring平台名。
provider_question_idstring平台题目 ID。
provider_page_idstring平台页面 ID。
ai_enabledboolean用服务端 AI 配置生成填空答案。
option_fill_texts(string | null)[]选项附加填空值。
fillable_option_indicesinteger[]可填空选项下标。
attached_option_selectsobject[]选项附加下拉配置。
is_locationboolean是否为地址题。
location_partsstring[]地址组成。
multi_text_blank_modesstring[]多项填空生成模式。
multi_text_blank_ai_flagsboolean[]多项填空 AI 开关。
multi_text_blank_int_rangesinteger[][]多项填空整数范围。
text_random_modestringnonenamemobileid_cardinteger
text_random_int_rangeinteger[]随机整数范围。
dimensionstring心理测量维度。
psycho_biasstring心理量表方向。

WeightTable 的单选权重写法:

json
{
  "options": [0.7, 0.3]
}

矩阵权重写法:

json
{
  "rows": [
    [0.2, 0.8],
    [0.6, 0.4]
  ]
}

SurveyDefinition

字段类型说明
providerstring问卷平台。
titlestring问卷标题。
questionsQuestionMeta[]题目元数据。

QuestionMeta 包含题号、题型、选项、分页、必填状态、显示逻辑、跳题逻辑、媒体和平台原始 ID。字段名以 POST /api/v1/surveys/parse 返回值为准。

Task

字段类型说明
idstring任务 ID。
statusstringpendingrunningsucceededfailedstoppedinterrupted
configRunRequest任务配置快照。
resultRunResult成功数、失败数、停止状态和线程进度。
created_atstring创建时间。
started_atstring开始时间。
finished_atstring结束时间。
errorstring失败详情。
stop_messagestring停止原因。

本地配置文件

configs/example.json 使用 schemaVersion: 2ConfigDocument。它包含 surveyexecutionnetworkanswersreverseFillpsychometrics 六个区段。该文件格式与 REST RunRequest 不是同一个 JSON 外壳。