跳转到主要内容
JSON 文件包含用于指定文档数量、类型和名称的数据结构,以及每个文档的页数和页名。要为特定用户的移动端上传场景进行配置,请在移动端上传链接中使用该 JSON 文件。 md 参数可以接受两种形式的 JSON 输入:直接访问链接(经编码)或编码后的 JSON。 使用编码后的链接:
  1. 生成指向该 JSON 文件的直接访问链接。
注意: 链接应以 “http://” 或 “https://” 开头。
  1. 将该链接进行 URL 编码。
  2. 在移动端上传链接中,将编码后的 URL 作为 md 参数的值。
使用编码后的 JSON:
  1. 将 JSON 文件进行 URL 编码。
  2. 在移动端上传链接中,将编码后的 JSON 作为 md 参数的值。

JSON 结构

TransactionStructure 定义了用户在移动端上传会话期间需采集的一组文档,以便在一个处理事务中进行后续处理。只有在采集完所有文档后,处理事务才会开始。
PropertiesValueDescription
version2.4当前 ABBYY Vantage 版本。注意: 该值应与移动端上传链接中的 v 参数值一致。
elementsElementStructure元素集合的结构。
ElementStructure 定义了用户为在处理事务中进行后续处理而需采集的一组或多组文档的集合。
PropertiesValueDescription
typestandalone定义仅包含一组文档的集合。
typesingle_choice定义包含多组文档的集合。注意: 至少需指定两组文档。
name将在微型应用的 Capture Documents 界面上显示的文档集名称。注意: 仅对 single_choice 类型可用。
documentDocumentStructure集合中单个文档的结构。注意: 仅对 standalone 类型可用。
documentsDocumentStructure集合中所有文档的结构。注意: 仅对 single_choice 类型可用。
DocumentStructure 定义了该文档集中每个文档的属性集合。
PropertiesValueDescription
typeidcard定义采集身份证的正反两面。
typepassport定义采集护照的首页。
typedocument定义采集任意文档。
name将在微型应用的 Capture Documents 界面上显示的文档名称。
count1,2,3...在一个处理事务中要求采集的文档数量。默认值为“1”。注意: 在采集完所有文档之前,上传不会开始。
countany在一个处理事务中可采集的文档数量。注意: 采集到任意数量的文档后即可开始上传。
galleryEnabledfalse/true是否允许从设备相册上传该文档页的图像。
pagesPagesStructure文档页面的结构。
PagesStructure 定义了用户需采集的文档页面的属性集合。
PropertiesValueDescription
nameFront side/Back side身份证各页面的名称。
nameFirst page with photo护照首页的名称。
nameDocument page name任意文档各页面的名称。
count1,2,3...该文档要求采集的页面数量。默认值为“1”。在采集完该文档的所有页面之前,上传不会开始。注意: 身份证正反两面的要求值均为“1”。
countany任意文档可采集的页面数量。采集到任意数量的页面后即可开始上传。注意: 护照首页的要求值为“1”,其他护照页面的要求值为“any”。

JSON 示例

用于获取具有预定义页数的护照文件中特定金额的 JSON 结构示例:
{
  "version": "2.4",
  "elements": [
    {
      "type": "standalone",
      "document": {
        "type": "passport",
        "name": "护照",
        "count": 1,
        "galleryEnabled": true,
        "pages": [
          {
            "name": "带照片的首页",
            "count": 1
          },
          {
            "name": "其他页",
            "count": "任意"
          }
        ]
      }
    }
  ]
}
用于捕获多个预定义文档之一的 JSON 结构示例:
{
  "version": "2.4",
  "elements": [
    {
      "type": "single_choice",
      "name": "Document",
      "documents": [
        {
          "type": "idcard",
          "name": "身份证",
          "count": 1,
          "galleryEnabled": true,
          "pages": [
            {
              "name": "正面",
              "count": 1
            },
            {
              "name": "反面",
              "count": 1
            }
          ]
        },
        {
          "type": "passport",
          "name": "护照",
          "count": 1,
          "galleryEnabled": true,
          "pages": [
            {
              "name": "照片页首页",
              "count": 1
            },
            {
              "name": "其他页面",
              "count": "any"
            }
          ]
        }
      ]
    }
  ]
}
用于捕获多个文档并可选包含身份证件的 JSON 结构示例:
{
  "version": "2.4",
  "elements": [
    {
      "type": "standalone",
      "document": {
        "type": "document",
        "name": "发票",
        "count": 1,
        "galleryEnabled": true,
        "pages": [
          {
            "name": "页面",
            "count": "任意"
          }
        ]
      }
    },
    {
      "type": "standalone",
      "document": {
        "type": "idcard",
        "name": "身份证",
        "count": "任意",
        "galleryEnabled": true,
        "pages": [
          {
            "name": "正面",
            "count": 1
          },
          {
            "name": "背面",
            "count": 1
          }
        ]
      }
    }
  ]
}