Skip to main content

Smart Report HTML を取得する

SmartReport のレンダリング済み HTML を、リンクされた batchId、templateId、rowIndex、任意の verificationScore、および対応する row ペイロード(rowIndex、status、inputData、results、errors)とともに取得します。

重要: このエンドポイントは Content-Type: application/json で応答し、生の text/html ドキュメントではなく、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 検証エラーです。

Webhook と MCP 統合​

注記​

  • HTTP レスポンスは application/json を使用するため、WebView、iframe、または PDF レンダラーに埋め込む前に JSON ペイロードから data.html を抽出してください。
  • score=true が渡された場合、data.verificationScore が返されます。
  • コンテキストにバッチ行オブジェクトが紐付いていない場合、data.row は null になります。

関連項目​