行业区域政企通

domain说明

序号 系统 环境 地址 备注
1 卓易政企通 测试 https://test-gateway.eazytec-cloud.com 适用【园企通】【行业政企通】【乡镇政企通】【协会政企通】
2 卓易政企通 线上 https://gateway.eazytec-cloud.com 适用【园企通】【行业政企通】【乡镇政企通】【协会政企通】
3 宜兴政企通 测试 https://test-gateway.eazytec-cloud.com/YX 适用【宜兴政企通】
4 宜兴政企通 线上 https://gateway.eazytec-cloud.com/YX 适用【宜兴政企通】
5 宜兴政企通 线上-政务外网 http://10.36.12.1:8000/YX(vpn) http://2.18.243.11:8000/YX(政务外网) 适用【宜兴政企通-政务外网】
6 江苏政企通 测试 https://test-gateway.eazytec-cloud.com/JS 适用【江苏政企通】
7 江苏政企通 线上 https://gateway.eazytec-cloud.com/JS 适用【江苏政企通】

审批执法一体化政企通

名片扫描接口文档

  • 请求URL

    {domain}/AGCS_zqc/v2/ocr/bcard/upload/format

  • 请求方式

    POST

  • 请求Header参数

key value 举例 是否必须
Content-Type application/json application/json
  • 请求Query参数

  • 请求Body

    • Type: raw
        {
            "image": "...",
            "url": "...",
            "headers": {
                "...": "...",
                ...
            }
        }
      
    • 示例
        // 方式一:传image string
        {
            "image": "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAE ... 7H/j/+b9ja8Gb36o//2Q=="
        }
        // 方式二:传image url
        {
            "url": "https://gateway.eazytec-cloud.com/EFS_gcs/test/image/xiezhi.jpg"
        }
        // 方式三:传image url并带上header
        {
            "url": "https://xxx.jpg",
            "headers": {
                "apikey": "0cf8d5ab024e42b1ad53f73a5bbc4a64"
            }
        }
      
参数 描述 格式 举例 是否必须
image 名片图片经过base64编码后的字符串(注意这里不需要经过urlencode处理,本接口内部已有处理,附录提供了一种java版的转换函数) 字符串 "/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAE ... 7H/j/+b9ja8Gb36o//2Q=="
url 名片图片的URL 字符串 "https://gateway.eazytec-cloud.com/EFS_gcs/test/image/xiezhi.jpg"
headers 名片图片的URL的请求Header(某些url需要配合header才能请求到) Map {"apikey":"0cf8d5ab024e42b1ad53f73a5bbc4a64"}

注:image string和image url两种方式只需二选一

  • 返回
    • 返回成功
        {
            "data": {
                "result": "1",
                "address": "江苏省宜兴市兴业路298号卓易创业软件园",
                "postalcode": "214205",
                "name": "谢智",
                "cellphone": "13382255960",
                "company": "江苏卓易信息科技股份有限公司",
                "position": "政企通产品技术架构师 高级技术经理",
                "landline": "051080322888",
                "fax": "051080322666",
                "email": "xiezhi@eazytec.com"
            },
            "msg": "success",
            "status": 200
        }
      
    • 返回失败: 参数错误
        {
            "data": "参数错误",
            "msg": "fail",
            "status": 400
        }
      
    • 返回失败: 扫描失败:xxx
        {
            "data": "扫描失败:xxx",
            "msg": "fail",
            "status": 500
        }
      
参数 描述 格式
result 是否成功 string,"1"或"0"
name 姓名 string
company 公司名称 string
position 职位 string
address 地址 string
postalcode 邮政编码 string
cellphone 手机号 string
landline 座机 string
fax 传真 string
email 电子邮件 string
  • postman截图

    • request-header request-header
    • request-body request-body
    • response response
  • 注意事项

    • 当前受第三方SDK的限制,对图片的大小和格式有要求,一般来说,图片的格式必须为jpg,大小须小于4M:

      图像数据,base64编码后进行urlencode,要求base64编码和urlencode后大小不超过4M,仅支持jpg格式,推荐 jpg 文件设置为:尺寸 1024×768,图像质量 75 以上,位深度 24。(注: base64编码后大小会增加约1/3)

  • 附录

    • InputStream base64编码为字符串(Java语言)

        import org.apache.commons.codec.binary.Base64;
        import java.io.InputStream;
        import java.util.*;
      
        public static String getBase64StringFromImageInputStream(InputStream inputStream, int size) {
            if (null == inputStream) {
                return "";
            }
      
            String base64String = "";
            try {
                // 来自网络的InputStream需要指定size,否则可以通过inputStream.available()获取大小
                if (size <= 0) {
                    size = inputStream.available();
                }
                byte[] data = new byte[size];
                // inputStream.read只能保证最多读取指定的字节,所以需要循环多次尝试读取,直到全部读完
                int readCount = 0;
                int index = 10000;
                while (readCount < size && index >= 0) {
                    readCount += inputStream.read(data, readCount, size - readCount);
                    index -= 1;
                }
      
                base64String = Base64.encodeBase64String(data);
            } catch (Exception e) {
                e.printStackTrace();
                base64String = "";
            } finally {
            }
      
            return base64String;
        }
      
江苏卓易信息科技股份有限公司-TNG基础平台组 all right reserved,powered by Gitbook该文件最后修改时间: 2021-01-27 06:23:28

results matching ""

    No results matching ""