1. 接口信息

1.1. 调用地址

https://api.regenai.com/v1/table/fetch

1.2. 请求方式

POST

1.3. 请求数据类型

multipart/form-data

1.4. 返回类型

JSON

2. 请求参数

名称 变量名 必填 类型 示例值 描述
Key app_key true String c5ed72329fece2fe0010a437505b01cb 分配的key
令牌 token true String 7007bd1257dce8d47489166a7c77a926 授权令牌
时间戳 timestamp true String 1522374165 timestamp 为January 1 1970 00:00:00 GMT 到现在的秒数
图片链接 image_url false String http://t.cn/EbhjOOq 图片链接地址
图片文件 image_file false Binary   图片文件
图片Base64数据 image_data false String   图片Base64数据
语言 language false String chs 默认chs
chs-简体中文
cht-繁体中文
eng-英语
jpn-日语
kor-韩语
vie-越南语
tha-泰语
spa-西班牙语
deu-德语
fra-法语
rus-俄语
nld-荷兰语
ita-意大利语
por-葡萄牙语
msa-马来语
ind-印尼语
识别结果返回类型 result_type false String "json" or "docx" 默认json, docx(word文档)

2.1. 请求说明

  • 支持的图片类型: jpg, jpeg, png及pdf, doc, docx. 图片最大支持8M.
  • token 的值计算方式为:md5($appkey+$timestamp+$appSecret)
    • token=md5("c5ed72329fece2fe0010a437505b01cb+1522374165+5c9597f3c8245907ea71a89d9d39d08e")=7007bd1257dce8d47489166a7c77a926
  • 生成token时,字符串连接中的“+”是必需的,缺少这个符号会无法验证通过验证

3. 返回值

3.1. 正确返回参数

名称 变量名 必填 类型 示例值 描述
返回状态码 result true int 0或1 请求状态. 1:成功, 0:失败
回复 response true json    

3.2. 正确返回样例

{
  "result": 1,
  "message": "success",
  "response": {
    "data": {
      "id": "7c8e31b1bb8b33132e75c6a51d4a8cfb84d51d74", 
      "message": "success",
      "result": 1,
      "sha1": "28d3dcc14c7fb1aaf6d65cf4b1708f04492fdd45", --识别图片唯一标识
      "time_cost": "1639", --识别所用时间
      "timestamp": 1620871622,
      "version": "20201023"
      "identify_results": [
        {
          "page": 0,  --页码
          "orientation": 0, -- 旋转角度(顺时针): 0/90/180/270
          "tables": [
            {
              "region": [ --第N个表格在图片上的四个顶点的X/Y坐标
                4, --左上角x坐标
                9, --左上角y坐标
                180, --右上角x坐标
                8, --右上角Y坐标
                180, --右下角x坐标
                23, --右下角Y坐标
                4, --左下角x坐标
                23 --左下角y坐标
              ],
              "row_num": 10, --行数
              "column_num": 2, --列数
              "cells": [
                {
                  "startrow": 0, --起始位置
                  "endrow": 1, --结束位置
                  "startcol": 0, --起始位置
                  "endcol": 1, --结束位置
                  "region": [ --cell的坐标
                      158,
                      261,
                      283,
                      262,
                      283,
                      308,
                      158,
                      307
                     ],  
                  "lines": [
                    {
                      "text": "aaabbbccc", --cell中的文字
                    }
                  ],
                  "text_rects": [
                    [
                      {
                        "raw_text": "", --当单独cell中有多行文字时,每行的文字信息
                        "confidence": 0.999, --字块内文字置信度
                        "region": [
                          4, --左上角x坐标
                          9, --左上角y坐标
                          180, --右上角x坐标
                          9, --右上角Y坐标
                          180, --右下角x坐标
                          23, --右下角Y坐标
                          4, --左下角x坐标
                          23 --左下角y坐标
                        ]
                      }
                    ]
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  }
}

results matching ""

    No results matching ""