Skip to main content

获取报告模板

按 ObjectId({id})获取单个 Smart Report 模板。此接口会返回完整的模板定义,包括 sections、reportTheme、sampleData、页面布局设置,以及已填充的 batchConfiguration 与 client 引用。

在无头与 AI 工作流中,可在以 append 或 edit 模式调用 生成模板布局 之前使用此端点加载当前的 sections 数组、获取已保存的 sampleData 以便用于 预览模板 HTML,或在执行 PUT 更新前检查模板内容。出于安全性和负载体积考虑,此端点会排除 security.password 与 thumbnail.image 字段。

端点​

GET https://api.verifik.co/v2/smart-report-templates/{id}

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

请求头​

名称值
Acceptapplication/json
AuthorizationBearer <VERIFIK_JWT>

参数​

名称类型必填说明
idstring是Smart Report 模板 ObjectId。

请求示例​

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

async function run() {
const id = "67c1f94b2d8a1c0012a4b301";
const res = await fetch(
`https://api.verifik.co/v2/smart-report-templates/${id}`,
{
method: "GET",
headers: {
Accept: "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
}
);

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

run();

响应示例​

{
"data": {
"_id": "67c1f94b2d8a1c0012a4b301",
"name": "Colombia Driver Onboarding Report",
"description": "Themed driver verification report for fleet onboarding",
"client": {
"_id": "507f1f77bcf86cd799439013",
"name": "Acme Mobility"
},
"batchConfiguration": {
"_id": "67c1f8102d8a1c0012a4b210",
"name": "Colombia Driver Onboarding"
},
"country": "CO",
"category": "citizen",
"isActive": true,
"pageSize": "A4",
"layoutVersion": 2,
"orientation": "portrait",
"margins": {
"top": 40,
"right": 40,
"bottom": 40,
"left": 40
},
"pdfEngine": "puppeteer",
"primaryColor": "#4F46E5",
"identityColor": "#111827",
"pageBackgroundColor": "#ffffff",
"reportTheme": {
"id": "light_cards",
"scoreEnabled": true,
"scoreProfile": "cabify_driver",
"scoreScale": "percent"
},
"sections": [
{
"id": "sec-header",
"type": "header",
"order": 0,
"label": "Driver Verification Report"
}
],
"createdAt": "2026-09-10T03:32:00.000Z",
"updatedAt": "2026-09-10T03:35:12.000Z"
}
}

注意事项​

  • 当模板不存在或属于其他客户时,此端点返回 HTTP 200 及 { "data": null },而非 404。
  • 返回文档中不包含 security.password 与 thumbnail.image。如需渲染或查看模板缩略图,请使用 列出报告模板。

相关页面​