Smart Report HTML 조회
SmartReport의 렌더링된 HTML을 연결된 batchId, templateId, rowIndex, 선택적 verificationScore 및 해당하는 row 페이로드(rowIndex, status, inputData, results, errors)와 함께 조회합니다.
중요: 이 엔드포인트는 원시 text/html 문서가 아니라 Content-Type: application/json으로 응답하며 data.html 안에 HTML 문자열을 반환합니다.
엔드포인트
GET https://api.verifik.co/v2/smart-reports/{id}/html
이 엔드포인트는 본인의 클라이언트별 Authorization: Bearer <VERIFIK_JWT>를 사용하여 Smart-Agent 프록시(https://ai.verifik.co/v2/smart-reports/{id}/html)를 통해서도 호출할 수 있습니다. 공유 x402 실행은 403 Forbidden으로 차단됩니다.
헤더
| 이름 | 값 | 설명 |
|---|---|---|
Accept | application/json | JSON 엔벨로프 응답 형식. |
Authorization | Bearer <VERIFIK_JWT> | 클라이언트 범위 JWT (authUser.clientId). |
매개변수
| 이름 | 위치 | 타입 | 필수 | 설명 |
|---|---|---|---|---|
id | path | string | 예 | SmartReport ObjectId. |
rowIndex | query | integer | 아니요 | 0부터 시작하는 행 인덱스(>= 0). |
preview | query | boolean | 아니요 | true일 때 미리보기 모드로 렌더링합니다. |
score | query | boolean | 아니요 | verificationScore를 계산하여 data에 포함할지 여부. |
scoreProfile | query | string | 아니요 | score가 활성화되었을 때 사용할 점수 프로필 식별자(최대 64자). |
요청
- Node.js
- PHP
- Python
- Go
- cURL
import axios from "axios";
const run = async () => {
const id = "6801a2b3c4d5e6f7a8b9c0d1";
const { data } = await axios.get(`https://api.verifik.co/v2/smart-reports/${id}/html`, {
params: {
rowIndex: 0,
preview: false,
score: true,
},
headers: {
Accept: "application/json",
Authorization: `Bearer ${process.env.VERIFIK_JWT}`,
},
});
console.log({
reportId: data.data.reportId,
htmlLength: data.data.html.length,
rowStatus: data.data.row?.status,
});
};
run();
<?php
$id = "6801a2b3c4d5e6f7a8b9c0d1";
$query = http_build_query([
"rowIndex" => 0,
"preview" => "false",
"score" => "true",
]);
$ch = curl_init("https://api.verifik.co/v2/smart-reports/" . $id . "/html?" . $query);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Accept: application/json",
"Authorization: Bearer " . getenv("VERIFIK_JWT"),
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
import os
import requests
report_id = "6801a2b3c4d5e6f7a8b9c0d1"
url = f"https://api.verifik.co/v2/smart-reports/{report_id}/html"
headers = {
"Accept": "application/json",
"Authorization": f"Bearer {os.getenv('VERIFIK_JWT')}",
}
params = {
"rowIndex": 0,
"preview": False,
"score": True,
}
response = requests.get(url, params=params, headers=headers)
print(response.json())
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
"os"
)
func main() {
id := "6801a2b3c4d5e6f7a8b9c0d1"
params := url.Values{}
params.Set("rowIndex", "0")
params.Set("preview", "false")
params.Set("score", "true")
req, _ := http.NewRequest("GET", "https://api.verifik.co/v2/smart-reports/"+id+"/html?"+params.Encode(), nil)
req.Header.Set("Accept", "application/json")
req.Header.Set("Authorization", "Bearer "+os.Getenv("VERIFIK_JWT"))
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var out map[string]interface{}
json.NewDecoder(resp.Body).Decode(&out)
fmt.Println(out)
}
curl -X GET "https://api.verifik.co/v2/smart-reports/6801a2b3c4d5e6f7a8b9c0d1/html?rowIndex=0&preview=false&score=true" \
-H "Accept: application/json" \
-H "Authorization: Bearer $VERIFIK_JWT"
응답
- 200 OK
- 401
- 403
- 404
- 409
- 422
{
"data": {
"reportId": "6801a2b3c4d5e6f7a8b9c0d1",
"batchId": "6801a2b3c4d5e6f7a8b9c0d3",
"templateId": "6801a2b3c4d5e6f7a8b9c0d2",
"rowIndex": 0,
"html": "<!DOCTYPE html><html><head><meta charset=\"utf-8\" /></head><body><h1>Verification Report</h1></body></html>",
"verificationScore": {},
"row": {
"rowIndex": 0,
"status": "completed",
"inputData": {
"documentType": "CC",
"documentNumber": "1032386359"
},
"results": {},
"errors": []
}
}
}
{
"message": "Unauthorized",
"code": "Unauthorized"
}
{
"message": "Shared x402 execution is forbidden on this endpoint",
"code": "Forbidden"
}
{
"message": "template_not_found",
"code": "NotFound"
}
{
"message": "unknown_score_profile",
"code": "unknown_score_profile"
}
{
"message": "UnprocessableEntity",
"code": "UnprocessableEntity"
}
오류 코드
| 상태 | 오류 코드 / 유형 | 원인 |
|---|---|---|
401 | Unauthorized | JWT가 누락되었거나 유효하지 않음. |
403 | Forbidden | 공유 x402 실행이 시도됨. 본인의 클라이언트별 JWT를 사용하세요. |
404 | not_found | 리포트 ID가 존재하지 않거나 다른 클라이언트에 속함. |
404 | template_not_found | 연결된 템플릿을 찾을 수 없음. |
409 | MissingParameter | 쿼리 또는 경로 매개변수에서 Joi 검증 실패. |
409 | row_not_found | 요청한 rowIndex가 배치에 존재하지 않음. |
409 | unknown_score_profile | 전달된 scoreProfile이 인식되지 않음. |
422 | UnprocessableEntity | Mongoose 유효성 검사 오류. |
웹훅 및 MCP 연동
- MCP 대응 도구: AI 에이전트는
smart_report_get_htmlMCP 도구를 통해 렌더링된 리포트 HTML 및 행 구조를 조회할 수 있습니다. MCP 및 AI 에이전트를 참조하세요. - 웹훅:
htmlUrl경로(/v2/smart-reports/{id}/html)는 Smart Report 실행, Smart Report 조회 및 Smart Report PDF 생성 응답에 포함됩니다. SmartReports 웹훅을 참조하세요.
참고 사항
- HTTP 응답이
application/json을 사용하므로 웹뷰, iframe 또는 PDF 렌더러에 삽입하기 전에 JSON 페이로드에서data.html을 추출해야 합니다. score=true를 전달하면data.verificationScore가 포함됩니다.- 해당 컨텍스트에 연결된 배치 행 객체가 없는 경우
data.row는null입니다.