合同比对
功能描述
获取比对成功的比对差异信息, 包括相似度、差异总数、新增数、删除数、修改数等信息
请求URL
https://doc-compare.intsig.com/doc_compare/diff_info?task_id=${task_id}
HTTP请求方法(Method)
HTTP GET
请求头说明(Request Headers)
请在HTTP请求中添加以下自定义Header。
header 名 |
值 |
x-ti-app-id |
请登录textin平台后前往 “工作台-账号设置-开发者信息” 查看 x-ti-app-id |
x-ti-secret-code |
请登录textin平台后前往 “工作台-账号设置-开发者信息” 查看 x-ti-secret-code |
URL参数(Parameters)
URL参数指以 {参数名}={参数值} 形式拼接到 URL 上的键值对。它以 ? 开头,不同参数之间使用 & 连接。形如 ?p1=v1&p2=v2
参数名 |
数据类型 |
是否必填 |
描述 |
task_id |
string |
是 |
创建任务得到的任务id |
with_diff_result |
boolean |
否 |
是否返回比对结果 |
响应体说明(Response)
Content-Type: application/json
JSON结构说明如下:
字段名 |
类型 |
描述 |
status |
integer |
异步请求状态 1 任务完成, 2 任务进行中, -1 任务失败 |
msg |
string |
api响应信息 |
code |
integer |
状态码 |
result |
array |
比对差异信息对象数组 |
++similarity |
number |
相似度 |
++create_time |
string |
任务创建时间 |
++standard_doc_id |
string |
标准文档id |
++standard_doc_name |
string |
标准文档名称 |
++compare_doc_id |
string |
比对文档id |
++compared_doc_name |
string |
比对文档名称 |
++diff_info |
object |
比对差异信息 |
+++total |
integer |
差异总数 |
+++insert |
integer |
新增数 |
+++delete |
integer |
删除数 |
+++change |
integer |
修改数 |
++diff_result |
array |
比对结果,with_diff_result = true 时返回, 比对结果每条分两种格式,段落/印章和表格 |
diff_result(段落,印章)
字段 |
类型 |
说明 |
element_id |
string |
元素id |
status |
string |
有DELETE , INSERT , CHANGE 三种 |
type |
string |
差异类型:text 文本, stamp 印章 |
diff |
array |
比对差异:数组只有两位,0 代表标准文档;1 代表比对文档, |
+ |
array |
每行差异(见差异详情) |
diff_result(表格)
字段 |
类型 |
说明 |
element_id |
string |
元素id |
status |
string |
有DELETE , INSERT , CHANGE 三种 |
type |
string |
cell 表格-单元格, row 表格-整行, col 表格-整列, table 表格-整表 |
area |
array |
内容和diff一致 |
diff |
array |
比对差异:数组只有1位 |
+status |
string |
有DELETE , INSERT , CHANGE 三种 |
+type |
string |
text 文本 |
+diff |
array |
比对差异:数组只有两位,0 代表标准文档;1 代表比对文档, |
++ |
array |
每行差异(见差异详情) |
差异详情
字段 |
类型 |
说明 |
++ char_polygons |
array |
框选坐标 |
++ doc_index |
integer |
文档索引:1标准 2比对 |
++ line_index |
integer |
行索引 |
++ page_index |
integer |
页索引 |
++ polygon |
array |
暂时废弃 |
++ sub_info |
array |
子差异 |
+++ sub_polygon |
array |
子差异框选 |
+++ sub_text_index |
object |
子差异字符坐标 |
++ text |
string |
具体差异文本 |
JSON结构示例
{"status":1,"code":200,"msg":"任务完成","result":[{"similarity":0.96106785535812,"compare_doc_id":"${compare_doc_id}","create_time":"2022-10-2414:26:24","standard_doc_id":"${standard_doc_id}","diff_info":{"insert":6,"delete":1,"total":9,"change":2},"diff_result":[{"area":[{"char_candidates":null,"char_polygons":[[742,157,742,157,742,172,742,172]],"doc_index":1,"line_index":1,"page_index":0,"polygon":null,"text":""},{"char_candidates":null,"char_polygons":[[743,157,773,157,773,172,743,172]],"doc_index":2,"line_index":1,"page_index":0,"polygon":null,"text":"无线\n"}],"diff":[{"diff":[[{"char_polygons":[[742,157,742,157,742,172,742,172]],"doc_index":1,"line_index":1,"page_index":0,"sub_info":[{"sub_polygons":[742,157,742,157,742,172,742,172],"sub_text_index":{"length":0,"start_index":0}}],"text":""}],[{"char_polygons":[[743,157,773,157,773,172,743,172]],"doc_index":2,"line_index":1,"page_index":0,"sub_info":[{"sub_polygons":[743,157,773,157,773,172,743,172],"sub_text_index":{"length":2,"start_index":42}}],"text":"无线\n"}]],"status":"INSERT","type":"text"}],"element_id":"1_0_141_88","status":"INSERT","type":"cell"},{"area":[{"char_candidates":null,"char_polygons":[[278,301,278,301,278,319,278,319]],"doc_index":1,"line_index":12,"page_index":0,"polygon":null,"text":""},{"char_candidates":null,"char_polygons":[[253,302,288,302,288,319,253,319]],"doc_index":2,"line_index":12,"page_index":0,"polygon":null,"text":"2024\n11\n20\n2025\n12\n31\n"}],"diff":[{"diff":[[{"char_polygons":[[278,301,278,301,278,319,278,319]],"doc_index":1,"line_index":12,"page_index":0,"sub_info":[{"sub_polygons":[278,301,278,301,278,319,278,319],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[295,301,295,301,295,319,295,319],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[330,301,330,301,330,319,330,319],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[278,327,278,327,278,345,278,345],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[322,327,322,327,322,345,322,345],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[357,327,357,327,357,345,357,345],"sub_text_index":{"length":0,"start_index":0}}],"text":""}],[{"char_polygons":[[253,302,288,302,288,319,253,319]],"doc_index":2,"line_index":12,"page_index":0,"sub_info":[{"sub_polygons":[253,302,288,302,288,319,253,319],"sub_text_index":{"length":4,"start_index":0}},{"sub_polygons":[340,302,358,302,358,319,340,319],"sub_text_index":{"length":2,"start_index":11}},{"sub_polygons":[393,302,410,302,410,319,393,319],"sub_text_index":{"length":2,"start_index":18}},{"sub_polygons":[304,328,339,328,339,345,304,345],"sub_text_index":{"length":4,"start_index":27}},{"sub_polygons":[365,328,383,328,383,345,365,345],"sub_text_index":{"length":2,"start_index":34}},{"sub_polygons":[413,328,431,328,431,345,413,345],"sub_text_index":{"length":2,"start_index":40}}],"text":"2024\n11\n20\n2025\n12\n31\n"}]],"status":"INSERT","type":"text"}],"element_id":"1_0_292_218","status":"INSERT","type":"cell"},{"area":[{"char_candidates":null,"char_polygons":[[701,360,701,360,701,375,701,375]],"doc_index":1,"line_index":15,"page_index":0,"polygon":null,"text":""},{"char_candidates":null,"char_polygons":[[721,359,842,359,842,376,721,376]],"doc_index":2,"line_index":15,"page_index":0,"polygon":null,"text":"871249@qq.com\n"}],"diff":[{"diff":[[{"char_polygons":[[701,360,701,360,701,375,701,375]],"doc_index":1,"line_index":15,"page_index":0,"sub_info":[{"sub_polygons":[701,360,701,360,701,375,701,375],"sub_text_index":{"length":0,"start_index":0}}],"text":""}],[{"char_polygons":[[721,359,842,359,842,376,721,376]],"doc_index":2,"line_index":15,"page_index":0,"sub_info":[{"sub_polygons":[721,359,842,359,842,376,721,376],"sub_text_index":{"length":13,"start_index":37}}],"text":"871249@qq.com\n"}]],"status":"INSERT","type":"text"}],"element_id":"1_0_352_88","status":"INSERT","type":"cell"},{"area":[{"char_candidates":null,"char_polygons":[[133,544,385,544,385,559,133,559]],"doc_index":1,"line_index":21,"page_index":0,"polygon":null,"text":"西班牙:2%;印度:1%;意大利:4.5\n"},{"char_candidates":null,"char_polygons":[[106,544,106,544,106,559,106,559]],"doc_index":2,"line_index":21,"page_index":0,"polygon":null,"text":"甲方负责支付谷歌在以下国家征收的数字服务税或监管运营费用(英国:3%;奥地利:4%;土耳其:6%;法国:1%;加拿大:1.5%)。若谷歌通知中提到的数字服务税和监管运营费用的国家或地区及费率有所增加或调整,甲方应按照谷歌的通知执行。此外,甲方还需承担除上述税费外,广告投放过程中可能产生的其他税费(如果有的话)。甲方应负责支付所有银行手续费,包括中间行费用,并确保乙方收到的金额与开具的发票金额一致。甲方将以美元向乙方支付款项,而乙方则向甲方提供发票。"}],"diff":[{"diff":[[{"char_polygons":[[133,544,385,544,385,559,133,559]],"doc_index":1,"line_index":21,"page_index":0,"sub_info":[{"sub_polygons":[133,544,385,544,385,559,133,559],"sub_text_index":{"length":20,"start_index":55}}],"text":"西班牙:2%;印度:1%;意大利:4.5\n"}],[{"char_polygons":[[106,544,106,544,106,559,106,559]],"doc_index":2,"line_index":21,"page_index":0,"sub_info":[{"sub_polygons":[106,544,106,544,106,559,106,559],"sub_text_index":{"length":0,"start_index":0}}],"text":"甲方负责支付谷歌在以下国家征收的数字服务税或监管运营费用(英国:3%;奥地利:4%;土耳其:6%;法国:1%;加拿大:1.5%)。若谷歌通知中提到的数字服务税和监管运营费用的国家或地区及费率有所增加或调整,甲方应按照谷歌的通知执行。此外,甲方还需承担除上述税费外,广告投放过程中可能产生的其他税费(如果有的话)。甲方应负责支付所有银行手续费,包括中间行费用,并确保乙方收到的金额与开具的发票金额一致。甲方将以美元向乙方支付款项,而乙方则向甲方提供发票。"}]],"status":"DELETE","type":"text"}],"element_id":"1_0_510_88","status":"DELETE","type":"cell"},{"area":[{"char_candidates":null,"char_polygons":[[737,744,745,744,745,759,737,759]],"doc_index":1,"line_index":27,"page_index":0,"polygon":null,"text":"甲方须在广告发布前七天内将所需款项转账至乙方指定的账户。乙方在收到款项后,将根据实际结算的费用开具相应的发票。如果甲方发布的内容违反法律规定,乙方有权利冻结甲方的预付款项。对于甲方预先支付的TikTok账户充值金额,乙方将扣除充值金额的5%作为合规保证金。若甲方的任何一个TikTok账户因违规推广而被暂停或关闭,乙方将保留该账户整个季度的合规保证金。对于甲方未被暂停且能够正常进行返点结算的账户,乙方将在返点结算时退还相应的合规保证金。"},{"char_candidates":null,"char_polygons":[[737,745,745,745,745,760,737,760]],"doc_index":2,"line_index":27,"page_index":0,"polygon":null,"text":"甲方须在广告发布前七天内将所需款项转账至乙方指定的账户。乙方在收到款项后,将根据实际结算的费用开具相应的发票。如果甲方发布的内容违反法律规定,乙方有权利冻结甲方的预付款项。对于甲方预先支付的TikTok账户充值金额,乙方将扣除充值金额的2%作为合规保证金。若甲方的任何一个TikTok账户因违规推广而被暂停或关闭,乙方将保留该账户整个季度的合规保证金。对于甲方未被暂停且能够正常进行返点结算的账户,乙方将在返点结算时退还相应的合规保证金。"}],"diff":[{"diff":[[{"char_polygons":[[737,744,745,744,745,759,737,759]],"doc_index":1,"line_index":27,"page_index":0,"sub_info":[{"sub_polygons":[737,744,745,744,745,759,737,759],"sub_text_index":{"length":1,"start_index":121}}],"text":"甲方须在广告发布前七天内将所需款项转账至乙方指定的账户。乙方在收到款项后,将根据实际结算的费用开具相应的发票。如果甲方发布的内容违反法律规定,乙方有权利冻结甲方的预付款项。对于甲方预先支付的TikTok账户充值金额,乙方将扣除充值金额的5%作为合规保证金。若甲方的任何一个TikTok账户因违规推广而被暂停或关闭,乙方将保留该账户整个季度的合规保证金。对于甲方未被暂停且能够正常进行返点结算的账户,乙方将在返点结算时退还相应的合规保证金。"}],[{"char_polygons":[[737,745,745,745,745,760,737,760]],"doc_index":2,"line_index":27,"page_index":0,"sub_info":[{"sub_polygons":[737,745,745,745,745,760,737,760],"sub_text_index":{"length":1,"start_index":121}}],"text":"甲方须在广告发布前七天内将所需款项转账至乙方指定的账户。乙方在收到款项后,将根据实际结算的费用开具相应的发票。如果甲方发布的内容违反法律规定,乙方有权利冻结甲方的预付款项。对于甲方预先支付的TikTok账户充值金额,乙方将扣除充值金额的2%作为合规保证金。若甲方的任何一个TikTok账户因违规推广而被暂停或关闭,乙方将保留该账户整个季度的合规保证金。对于甲方未被暂停且能够正常进行返点结算的账户,乙方将在返点结算时退还相应的合规保证金。"}]],"status":"CHANGE","type":"text"}],"element_id":"1_0_641_278","status":"CHANGE","type":"cell"},{"area":[{"char_candidates":null,"char_polygons":[[113,1130,143,1130,143,1145,113,1145]],"doc_index":1,"line_index":50,"page_index":0,"polygon":null,"text":"中国工商银行股份有限公司上海分行|9558830200000439564"},{"char_candidates":null,"char_polygons":[[113,1130,143,1130,143,1145,113,1145]],"doc_index":2,"line_index":50,"page_index":0,"polygon":null,"text":"中国工商银行股份有限公司北京分行|9558830200000123456"}],"diff":[{"diff":[[{"char_polygons":[[113,1130,143,1130,143,1145,113,1145]],"doc_index":1,"line_index":50,"page_index":0,"sub_info":[{"sub_polygons":[113,1130,143,1130,143,1145,113,1145],"sub_text_index":{"length":2,"start_index":12}},{"sub_polygons":[641,1117,649,1117,649,1132,641,1132],"sub_text_index":{"length":1,"start_index":32}},{"sub_polygons":[657,1117,666,1117,666,1132,657,1132],"sub_text_index":{"length":1,"start_index":34}},{"sub_polygons":[682,1117,691,1117,691,1132,682,1132],"sub_text_index":{"length":1,"start_index":37}}],"text":"中国工商银行股份有限公司上海分行|9558830200000439564"}],[{"char_polygons":[[113,1130,143,1130,143,1145,113,1145]],"doc_index":2,"line_index":50,"page_index":0,"sub_info":[{"sub_polygons":[113,1130,143,1130,143,1145,113,1145],"sub_text_index":{"length":2,"start_index":12}},{"sub_polygons":[641,1117,657,1117,657,1132,641,1132],"sub_text_index":{"length":2,"start_index":32}},{"sub_polygons":[666,1117,674,1117,674,1132,666,1132],"sub_text_index":{"length":1,"start_index":35}},{"sub_polygons":[691,1117,691,1117,691,1132,691,1132],"sub_text_index":{"length":0,"start_index":19}}],"text":"中国工商银行股份有限公司北京分行|9558830200000123456"}]],"status":"CHANGE","type":"text"}],"element_id":"1_0_1097_88","status":"CHANGE","type":"cell"},{"area":[{"char_candidates":null,"char_polygons":[[133,1222,133,1222,133,1239,133,1239]],"doc_index":1,"line_index":57,"page_index":0,"polygon":null,"text":""},{"char_candidates":null,"char_polygons":[[160,1223,335,1223,335,1240,160,1240]],"doc_index":2,"line_index":57,"page_index":0,"polygon":null,"text":"彩虹教育咨询有限公司\n"}],"diff":[{"diff":[[{"char_polygons":[[133,1222,133,1222,133,1239,133,1239]],"doc_index":1,"line_index":57,"page_index":0,"sub_info":[{"sub_polygons":[133,1222,133,1222,133,1239,133,1239],"sub_text_index":{"length":0,"start_index":0}}],"text":""}],[{"char_polygons":[[160,1223,335,1223,335,1240,160,1240]],"doc_index":2,"line_index":57,"page_index":0,"sub_info":[{"sub_polygons":[160,1223,335,1223,335,1240,160,1240],"sub_text_index":{"length":10,"start_index":4}}],"text":"彩虹教育咨询有限公司\n"}]],"status":"INSERT","type":"text"}],"element_id":"1_0_1216_88","status":"INSERT","type":"cell"},{"area":[{"char_candidates":null,"char_polygons":[[133,107,133,107,133,124,133,124]],"doc_index":1,"line_index":0,"page_index":1,"polygon":null,"text":""},{"char_candidates":null,"char_polygons":[[151,107,413,107,413,124,151,124]],"doc_index":2,"line_index":0,"page_index":1,"polygon":null,"text":"北京市海淀区中关村软件园1号楼\n100080\n李娜\n010-87654321\n010-12345678\n871257380@qq.com\n2024\n11\n19\n"}],"diff":[{"diff":[[{"char_polygons":[[133,107,133,107,133,124,133,124]],"doc_index":1,"line_index":0,"page_index":1,"sub_info":[{"sub_polygons":[133,107,133,107,133,124,133,124],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[133,133,133,133,133,150,133,150],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[151,159,151,159,151,176,151,176],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[133,185,133,185,133,202,133,202],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[133,211,133,211,133,228,133,228],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[148,237,148,237,148,254,148,254],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[168,289,168,289,168,306,168,306],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[221,289,221,289,221,306,221,306],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[247,289,247,289,247,306,247,306],"sub_text_index":{"length":0,"start_index":0}}],"text":""}],[{"char_polygons":[[151,107,413,107,413,124,151,124]],"doc_index":2,"line_index":0,"page_index":1,"sub_info":[{"sub_polygons":[151,107,413,107,413,124,151,124],"sub_text_index":{"length":17,"start_index":3}},{"sub_polygons":[151,133,203,133,203,150,151,150],"sub_text_index":{"length":6,"start_index":23}},{"sub_polygons":[168,159,203,159,203,176,168,176],"sub_text_index":{"length":2,"start_index":33}},{"sub_polygons":[151,185,253,185,253,202,151,202],"sub_text_index":{"length":12,"start_index":38}},{"sub_polygons":[151,211,253,211,253,228,151,228],"sub_text_index":{"length":12,"start_index":53}},{"sub_polygons":[165,237,312,237,312,254,165,254],"sub_text_index":{"length":16,"start_index":72}},{"sub_polygons":[186,289,221,289,221,306,186,306],"sub_text_index":{"length":4,"start_index":102}},{"sub_polygons":[265,289,282,289,282,306,265,306],"sub_text_index":{"length":2,"start_index":112}},{"sub_polygons":[313,289,330,289,330,306,313,306],"sub_text_index":{"length":2,"start_index":118}}],"text":"北京市海淀区中关村软件园1号楼\n100080\n李娜\n010-87654321\n010-12345678\n871257380@qq.com\n2024\n11\n19\n"}]],"status":"INSERT","type":"text"}],"element_id":"1_1_89_89","status":"INSERT","type":"cell"},{"area":[{"char_candidates":null,"char_polygons":[[511,211,511,211,511,228,511,228]],"doc_index":1,"line_index":8,"page_index":1,"polygon":null,"text":""},{"char_candidates":null,"char_polygons":[[529,211,631,211,631,228,529,228]],"doc_index":2,"line_index":8,"page_index":1,"polygon":null,"text":"010-12345678\n2024\n11\n19\n"}],"diff":[{"diff":[[{"char_polygons":[[511,211,511,211,511,228,511,228]],"doc_index":1,"line_index":8,"page_index":1,"sub_info":[{"sub_polygons":[511,211,511,211,511,228,511,228],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[546,289,546,289,546,306,546,306],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[599,289,599,289,599,306,599,306],"sub_text_index":{"length":0,"start_index":0}},{"sub_polygons":[634,289,634,289,634,306,634,306],"sub_text_index":{"length":0,"start_index":0}}],"text":""}],[{"char_polygons":[[529,211,631,211,631,228,529,228]],"doc_index":2,"line_index":8,"page_index":1,"sub_info":[{"sub_polygons":[529,211,631,211,631,228,529,228],"sub_text_index":{"length":12,"start_index":59}},{"sub_polygons":[564,289,599,289,599,306,564,306],"sub_text_index":{"length":4,"start_index":115}},{"sub_polygons":[651,289,669,289,669,306,651,306],"sub_text_index":{"length":2,"start_index":126}},{"sub_polygons":[699,289,717,289,717,306,699,306],"sub_text_index":{"length":2,"start_index":132}}],"text":"010-12345678\n2024\n11\n19\n"}]],"status":"INSERT","type":"text"}],"element_id":"1_1_89_467","status":"INSERT","type":"cell"}],"standard_doc_name":"doc_1.docx","compared_doc_name":"doc_2.docx"}]}
错误码说明
错误码 |
描述 |
200 |
创建成功 |
209 |
任务进行中 |
400 |
坏的请求 |
401 |
未授权 |
403 |
禁止访问 |
404 |
未找到资源 |
406 |
参数错误 |
500 |
服务器内部错误 |
40004 |
参数错误,请查看技术文档,检查传参 |
40007 |
机器人不存在或未发布 |
40008 |
机器人未开通,请至市场开通后重试 |
40101 |
x-ti-app-id 或 x-ti-secret-code 为空 |
40102 |
x-ti-app-id 或 x-ti-secret-code 无效,验证失败 |
40103 |
客户端IP不在白名单 |
40104 |
App has expired 应用已超过有效期 |
40105 |
Invalid IP source 无效的IP来源 |
40106 |
App does not match service 应用与service不匹配 |
40107 |
App has been overdrawn. Please use it after recharging. 应用额度已用完,请充值后使用 |
40109 |
QPS limit reached, request rejected 达到 qps 限制,请求拒绝 |
40202 |
Service not support 请求了不支持的服务 |
40203 |
API is not configured correctly. API配置不正确 |