Skip to main content

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으로 차단됩니다.

헤더​

이름값설명
Acceptapplication/jsonJSON 엔벨로프 응답 형식.
AuthorizationBearer <VERIFIK_JWT>클라이언트 범위 JWT (authUser.clientId).

매개변수​

이름위치타입필수설명
idpathstring예SmartReport ObjectId.
rowIndexqueryinteger아니요0부터 시작하는 행 인덱스(>= 0).
previewqueryboolean아니요true일 때 미리보기 모드로 렌더링합니다.
scorequeryboolean아니요verificationScore를 계산하여 data에 포함할지 여부.
scoreProfilequerystring아니요score가 활성화되었을 때 사용할 점수 프로필 식별자(최대 64자).

요청​

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();

응답​

{
"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": []
}
}
}

오류 코드​

상태오류 코드 / 유형원인
401UnauthorizedJWT가 누락되었거나 유효하지 않음.
403Forbidden공유 x402 실행이 시도됨. 본인의 클라이언트별 JWT를 사용하세요.
404not_found리포트 ID가 존재하지 않거나 다른 클라이언트에 속함.
404template_not_found연결된 템플릿을 찾을 수 없음.
409MissingParameter쿼리 또는 경로 매개변수에서 Joi 검증 실패.
409row_not_found요청한 rowIndex가 배치에 존재하지 않음.
409unknown_score_profile전달된 scoreProfile이 인식되지 않음.
422UnprocessableEntityMongoose 유효성 검사 오류.

웹훅 및 MCP 연동​

참고 사항​

  • HTTP 응답이 application/json을 사용하므로 웹뷰, iframe 또는 PDF 렌더러에 삽입하기 전에 JSON 페이로드에서 data.html을 추출해야 합니다.
  • score=true를 전달하면 data.verificationScore가 포함됩니다.
  • 해당 컨텍스트에 연결된 배치 행 객체가 없는 경우 data.row는 null입니다.

관련 문서​