Skip to main content

探测示例数据

检查 sampleData 核验负载,返回包含字段路径、值结构形态、推荐的 sectionType 选择、备选区块类型、建议表格列以及绑定建议的结构化映射。

在无头报告编排与 AI 智能体流水线中,可在从 获取模拟响应 获取负载或捕获 SmartBatch 行数据后立即调用此端点。你的 UI 或智能体无需猜测 dataPath 字符串或编写脆弱的 JSON 遍历逻辑,即可使用探测得到的 nodes 与 batch 元数据直接构建有效的 sections,或丰富传入 生成模板布局 的 prompt 上下文。遍历器最多检查至第 5 层深度和最多 600 个节点。

端点​

POST https://api.verifik.co/v2/smart-report-templates/introspect

Smart-Agent 代理(https://ai.verifik.co)暴露了完全相同的 /v2/... 路径,并同样要求携带你自己的 Authorization: Bearer <VERIFIK_JWT> 请求头。

请求头​

名称值
Content-Typeapplication/json
Acceptapplication/json
AuthorizationBearer <VERIFIK_JWT>

请求体参数​

名称类型必填说明
sampleDataobject是示例核验负载,包含可选的 batchName(string)、rowIndex(number)、inputData(object)和 results(object)。

请求示例​

const fetch = require("node-fetch");

async function run() {
const res = await fetch(
"https://api.verifik.co/v2/smart-report-templates/introspect",
{
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
body: JSON.stringify({
sampleData: {
batchName: "Driver Onboarding",
rowIndex: 0,
inputData: {
documentType: "CC",
documentNumber: "1020304050",
},
results: {
identity: {
fullName: "Mateo Rojas",
status: "active",
},
fines: [
{ code: "C02", amount: 580000, status: "pending" },
],
},
},
}),
}
);

console.log(await res.json());
}

run();

响应示例​

{
"data": {
"nodes": [
{
"path": "results.identity",
"shape": "object",
"sectionType": "keyValueGrid",
"alternatives": ["card", "table"],
"columns": [
{ "key": "fullName", "label": "Full Name" },
{ "key": "status", "label": "Status" }
],
"suggestion": {
"type": "keyValueGrid",
"dataPath": "results.identity"
}
},
{
"path": "results.fines",
"shape": "array",
"sectionType": "dataTable",
"alternatives": ["repeater", "table"],
"columns": [
{ "key": "code", "label": "Code" },
{ "key": "amount", "label": "Amount" },
{ "key": "status", "label": "Status" }
],
"suggestion": {
"type": "dataTable",
"dataPath": "results.fines"
}
}
],
"batch": [
{
"path": "inputData",
"shape": "object",
"sectionType": "keyValueGrid"
}
],
"count": 2,
"truncated": false
}
}

注意事项​

  • 遍历会在第 5 层深度停止,且节点上限为 600 个。当超大负载触及该上限时,truncated 为 true。
  • 此端点为只读且无状态;不会保存模板,也不会消耗核验积分。

相关页面​