1、API接口文档

1.1、接口说明

1.1.1、接口规范

简要描述:

  • 接口采用 Restful 的 Web API 实现方案,通过 HTTP POST请求的方式对外提供服务。

接口URL规范:

  • https://restapi.heils.cn/{versionno}/{companykey}/auth

请求方式:

  • POST

参数:

参数名 必选 类型 说明
versionno string 守护者接口版本号
companykey string 企业key
token string 鉴权token,接口调用凭证

备注

versionno
  • 接口的功能、传输的数据模型会因版本不同而改变。通过在根地址中(接口URL前)写入版本号以使用该版本对应的接口功能。版本升级时将发送业务公告,第一版为v1
companykey
  • 平台添加新企业后会生成一个属于该应用的companykey
token
  • 云端服务器需要鉴定用户是否有权调用业务接口,用户调用鉴权接口,可获取token(有效期为一天,过期后需再次获取),之后每一次调用业务接口的请求都需要写入此token(建议在URL中)作为校验。鉴权接口所需参数:companykey,timestamp(毫秒),sign,其中companykey和companysecret都是守护者平台添加创建新企业用户时生成,sign的算法为:MD5-32(companysecret+companykey+timestamp+companysecret)(注意:中间参数包含了key和值)

签名工具类:

package com.facerecognition.utils;

import java.io.IOException;
import java.security.GeneralSecurityException;
import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

public class SignUtil {

    // 企业秘钥
    private static final String SECRET = "xxxxx";

    /**
     * 使用默认secret签名
     * 
     * @param paramValues
     * @return
     */
    public static String sign(Map<String, String> paramValues) {
        return sign(paramValues, null, SECRET);
    }

    /**
     * 使用<code>secret</code>对paramValues按以下算法进行签名:
     * md5(secretkey1value1key2value2...secret)
     * 
     * @param paramNames
     *            需要签名的参数名
     * @param paramValues
     *            参数列表
     * @param secret
     * @return
     */
    public static String sign(Map<String, String> paramValues, String secret) {
        if (StringUtils.isEmpty(secret)) {
            secret = SECRET;
        }
        return sign(paramValues, null, secret);
    }

    /**
     * 对paramValues进行签名,其中ignoreParamNames这些参数不参与签名
     * 
     * @param paramValues
     * @param ignoreParamNames
     * @param secret
     * @return
     */
    public static String sign(Map<String, String> paramValues, List<String> ignoreParamNames, String secret) {
        StringBuilder sb = new StringBuilder();
        List<String> paramNames = new ArrayList<String>(paramValues.size());
        paramNames.addAll(paramValues.keySet());
        if (ignoreParamNames != null && ignoreParamNames.size() > 0) {
            for (String ignoreParamName : ignoreParamNames) {
                paramNames.remove(ignoreParamName);
            }
        }
        Collections.sort(paramNames);
        sb.append(secret);
        for (String paramName : paramNames) {
            sb.append(paramName).append(paramValues.get(paramName));
        }
        sb.append(secret);
        try {
            byte[] sha1Digest = getMD5Digest(sb.toString());
            return byte2hex(sha1Digest);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "";
    }

    private static byte[] getMD5Digest(String data) throws IOException {
        byte[] bytes = null;
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            bytes = md.digest(data.getBytes("UTF-8"));
        } catch (GeneralSecurityException gse) {
            throw new IOException(gse);
        }
        return bytes;
    }

    private static String byte2hex(byte[] bytes) {
        StringBuilder sign = new StringBuilder();
        for (int i = 0; i < bytes.length; i++) {
            String hex = Integer.toHexString(bytes[i] & 0xFF);
            if (hex.length() == 1) {
                sign.append("0");
            }
            sign.append(hex.toUpperCase());
        }
        return sign.toString();
    }

}

1.2、数据接口

1.2.1、鉴权接口

简要描述:

  • 调用该接口可以获取token有效期为一天,过期后需再次获取。Token值作为所有接口鉴权参数

请求URL:

  • https://restapi.heils.cn/v1/{companykey}/auth

请求方式:

  • POST

参数:

参数名 必选 类型 说明
companykey string 企业key
timestamp string 系统时间戳
sign string 参数签名

返回示例

{
    "code": "0",
    "message": "操作成功",
    "data":"7cTRmjcc3I15amfRbP01f04stuKze2PMG2KvkAYneRG3fyESm71o9OU+vCfXy5"
}

返回参数说明

参数名 类型 说明
code string 状态码 1失败 0成功
message string 消息
data string token值

备注

1.2.2、照片上传接口

简要描述:

  • 用于上传员工或者访客照片,照片合格会返回图片地址和人脸特征值,在进行人员或者访客新增时需要上传

请求URL:

  • https://restapi.heils.cn/v1/{companykey}/uploadFace
  • https://restapi.heils.cn/v1/{companykey}/uploadFaceBase64

请求方式:

  • POST

参数:

参数名 必选 类型 说明
token string 鉴权token值
imagefile string 图片文件

图片文件 (Mutil表单文件流或者base64文件) 若图片编码为base64字符串,不加头部,如:data:image/jpg;base64 要求

  1. 图片尺寸为640*480左右
  2. 图片中只有一个人脸
  3. 图片中人脸端正
  4. 图片中人脸占图片30%以上
  5. 图片大小不超过400K
  6. 图片耳朵最好露出

    返回示例

  {
    "code": "0",
    "message": "操作成功",
    "data": {
        "faceimage": "http://ip:port/xxx.png",
        "facedata": "[-0.6083805,0.7291831,0.7847955,1.9079208,-4.9847283,-0.8347116,-0.56897813,0.73260015,-3.5438437,-9.645625,-6.2339973,3.1937027,-0.6423534,3.3978,0.7496131,-3.7174387,0.58547294,3.891225,-6.672946,-0.96264726,-4.74689,-0.8865954,6.568674,-5.1695204,9.376875,-4.617692,0.11449261,2.3313644,1.9549094,0.09848301,-0.9553648,-0.32310307,2.8044934,3.716304,0.3133348,6.5879602,-3.7589262,-5.597148,-0.79652184,3.8121655,2.2638977,2.0664508,-2.3711777,-3.385016,6.060168,3.7304082,-6.186924,-3.3172991,1.8623928,1.6207536,7.096748,-0.76461655,-5.0387063,3.878733,0.39471063,-2.0667362,-11.47308,0.76501703,4.339149,3.3660889,1.0908222,-0.51680726,1.6561584,-3.0942278,-2.2103226,2.5994549,-3.1783211,1.6414686,1.5633465,4.3688807,0.8155432,6.0329227,-0.16384107,-0.2318578,-1.7427837,-1.3796118,-0.31726462,1.2760503,-5.463266,0.53915125,-1.3553457,-1.5809871,-3.31844,4.295205,1.2688996,-0.052959938,-2.7124052,-1.3553011,2.5352302,-0.48008597,2.5229733,0.7050645,1.0951996,1.9062834,1.7304524,2.082749,2.2183456,6.1420507,-3.7504013,-1.1913786,-6.9753036,1.1550264,-5.673368,0.0018173382,-4.175441,3.7238688,-0.108318396,-1.172901,5.950934,-1.3825941,0.8586001,-2.3789644,-2.2639606,8.17212,-0.7667121,7.9849195,-3.5874283,5.7020617,-0.6341628,0.17146987,-1.003115,4.8375845,-1.4024737,-0.16783196,3.565316,-0.9011096,4.348053,1.5000782,4.2196875,-1.8065295,3.0661452,-2.5227861,-1.5141159,2.3152905,-5.75979,-3.3252952,-2.1155038,6.956399,-0.640537,8.666788,-0.70012516,-3.229395,-4.9182944,-1.5612938,1.5150365,-4.948287,3.628811,1.9411141,1.203409,-1.9919173,-4.4194756,-0.9084469,0.44399574,1.2477872,3.2125409,7.62236,-5.2029834,-2.0528324,0.34652343,-0.9005846,-0.30027756,5.265063,0.6406119,0.8537199,-1.6297139,3.6936295,-8.478616,3.418398,1.5683154,2.1498184,-3.50713,-3.1964192,-0.9630982,4.3967276,-5.1421146,-2.2128406,2.7707205,-3.6351345,3.3773677,1.5464041,-3.6540039,-0.5722303,-3.6372986,1.587698,-2.0962427,1.4824591,-4.983761,-0.578842,-0.7016598,-0.5449621,10.183753,-1.610789,-3.7764702,5.277636,-2.6365798,-1.5288275,0.05381474,2.6974678,6.033136,1.2057804,0.59816563,1.2041745,0.5217943,-1.2946391,1.9167864,-2.8219676,-0.17643076,-3.7976027,11.4385,-4.030636,0.30340287,-1.7534764,-1.063587,3.3947024,-0.22738197,-1.4586353,4.3922915,1.8178868,1.4214414,2.9674332,2.6508248,-3.3313897,0.9440322,-1.7793852,-1.5507436,3.297789,2.4336603,2.7162476,0.75194997,-0.450122,3.0296328,5.52507,7.2799716,-4.0625615,-5.2341127,1.5609975,-4.068404,-4.049742,-4.361267,-2.0987256,-0.6271237,-2.4413705,0.2036324,-3.1064065,-2.1640716,-0.9673201,4.8498926,2.5954711,-8.02673,2.4510827,4.9478784,-2.047774,-4.9467363,-0.85316694,3.5773888,-1.6211786,-2.0195684,-1.2633306,0.5009074,-1.1240855,0.6387829,0.14582066,-1.6990321,0.7161804,-0.39926848,-2.927058,5.2047873,-0.97152686,3.1249566,1.33518,-4.4007645,-1.9343752,-5.615332,-2.7575183,0.91735244,6.4210143,4.417341,4.9166026,-0.8937125,0.8760333,-5.4539967,4.5527577,-3.7494767,0.80316025,2.0107815,-0.027915753,-0.11797625,7.059169,-2.5095305,-4.2769127,2.0840971,1.2782698,-2.5764453,4.0280657,-2.331156,-1.680843,-5.1427817,-0.98892426,2.3560581,3.1960087,2.7691255,3.1188552,-4.0894227,3.0481853,0.42118734,2.7271605,-3.3716052,2.475756,-3.0500584,2.5717175,2.2423127,0.94606876,2.016293,-1.6667966,-7.931474,3.917573,-4.5776477,-4.743468,2.8245695,4.987849,-0.70903015,0.42926446,2.8304422,2.599072,-2.2123556,0.4188927,-6.5545416,-0.030274794,-0.9862917,-0.39640656,-2.1346128,-5.0671153,-0.7827394,1.7085311,-3.801072,-6.3394384,-3.0218217,2.9957364,1.073923,3.917008,-1.072476,-2.0128474,-4.436081,2.8978863,-5.494255,-0.6885984,-2.9594908,-4.69231,2.7664998,0.47806227,3.1192174,0.64386714,-0.3542319,-2.8764558,0.4888264,-6.6865816,-2.1796982,-4.2344646,-0.75044477,2.1056771,0.3861111,-6.053758,-1.557212,-8.348673,2.0992928,-4.6600776,2.654355,-7.415196,-2.1951485,-2.7516856,2.8050323,-0.030412324,-3.1478796,-0.64416236,0.99462587,3.8614454,5.2452145,-1.1728411,6.5944715,3.9984684,-1.3076082,-0.0059707463,-0.15999503,0.63590664,0.6621263,-1.6530577,6.8923125,-4.9337554,0.1721547,-2.7514005,0.3770159,3.1836388,-0.5042957,0.44752496,-0.58392566,-3.254364,2.3464413,-7.768415,1.4951015,-7.027346,-3.4651537,8.202022,-1.7956648,-5.2419233,3.0423663,-1.9811647,-2.919047,3.8167582,-1.9164182,2.111355,1.844897,-1.2338985,4.0449057,-1.2580999,9.444005,4.080339,4.8319116,1.9182682,-1.5525036,1.5665996,-0.6293088,0.08543182,6.0754395,-3.6155398,3.560078,-5.076356,0.5210432,3.4036748,2.4512982,-0.34849492,5.278837,4.1506925,7.399345,4.167518,1.7310549,-0.56403446,-4.6860666,1.2940017,-4.998195,-2.5535197,-2.4942195,4.126335,-3.6320229,2.3441048,6.5069184,0.47542915,-0.7652411,0.7738508,-0.27325952,0.034419037,-0.78995717,0.5348246,-0.47346935,-6.9940305,4.279777,0.1256443,-0.8007494,3.8708782,-6.573225,-2.0695899,-1.9324108,-2.4822676,2.360261,5.4198337,0.15138842,-1.1032248,-5.0391917,7.9708757,-1.5986818,-0.6605744,-0.5049735,2.5997026,-5.5281453,0.63095677,-3.4883952,0.85741276,0.25048906,0.9247312,2.163537,7.3155026,-5.212939,-1.3531772,-3.363639,-1.2422382,-2.8725781,-1.9130096,-5.624954,-2.1544259,3.8397586,1.5009714,1.5279406,-2.0026908,0.45718884,2.933032,3.854211,4.515193,-2.688803,1.7661301,0.7800683,5.4203887,-2.250014,-1.2892578,2.9366674,2.6695619,-1.9569485,4.192834,-1.5654863,-0.8589667,-1.521386,2.3884177,-2.3515453,2.4294133,-0.64499813,-5.3329,-5.2647133,4.6374125,-2.3887446,-5.1867967,-0.17385724,7.575338,-1.1432117,-5.339078,-0.5638904,-2.8310244,2.4003825,-2.5467107,-6.711735,-3.3285427,-2.5793626,0.8648344,-5.888062,-0.97979474,4.578608,0.20311493,-0.48342708,-3.837348,0.19368602,2.1602592,3.9287367,3.5771954,7.0477915,-2.9359658,-2.0881064,-1.008286,-1.5988524,0.9563316,2.4208794,1.8985456,-3.2772346,0.11257604,-4.8117423,0.5837855,-1.1075718,7.8813453,-0.59325546,-1.3953263,-1.2503015,2.8099246,3.5889537,-2.5817642,-1.603801,-2.4062514,-5.0886984,-2.015688,1.5522832,-2.3644195,-2.1337216,-2.1432047,4.086516,-1.0267035,4.095934,-1.3740897,-1.6881012,1.9102782,-1.880279,0.5840843,-4.2412963,0.016023956,-7.2445483,-4.358164,6.7163897,5.376983,-0.30978015,-7.591332,-1.5230883,4.0308204,-0.09515841,-3.3970768,3.1385279,8.334809,2.8168814,1.4508283,7.1279345,0.49211788,-3.842889,0.6620654,-5.110579,-0.9046244,-2.9758687,5.6873417,3.9213886,-5.7653537,2.125269,-3.8004851,-4.769293,-3.1940644,6.2430143,-4.7787466,3.8893871,0.8684501,2.5351968,0.6671961,0.5791509,-3.8249605,2.4663956,0.4914032,2.3039503,-0.8329351,3.463564,0.6034956,5.791288,2.2721574,4.2632356,-6.1088066,-6.033222,1.759896,0.0023163334,2.605878,-1.4566127,-1.6965152,0.45673007,3.902055,-1.3839544,0.8582987,-3.4963021,5.878155,2.4235785,-0.49132848,0.79503566,0.16854525,3.408782,2.2556353,0.4748971,-1.5941365,-4.724735,3.9090567,-0.6808668,-2.4401567,-3.4914799,0.9116436,6.853761,6.885007,0.10951618,1.7604527,1.9258038,-0.96040404,2.5765162,3.2946355,-0.5637653,2.411892,-2.214763,-0.16864467,7.950783,-0.5554099,-1.3817668,1.0857853,1.0202658,-2.134608,1.3141885,5.6826644,2.524106,1.2236701,-2.6323433,1.7901645,-2.050768,-2.5017152,-1.1112661,1.0238439,3.2417634,-1.3190185,-1.7707361,2.020951,1.2172093,0.6290474,-1.2017144,5.8637333,4.6907587,-2.607812,-2.8260427,9.10001,-6.6441965,-3.4538999,-3.123031,-5.1352897,0.9672041,-0.7285292,1.2698412,2.1580634,2.1430092,-2.5845044,2.838159,2.4472876,-7.504387,6.1995597,-3.3668911,-3.5653884,2.8920333,-1.579127,2.4008832,-0.4887112,-6.726655,0.16709094,2.7535975,-1.0982168,-2.1159003,3.1731908,-4.6475205,0.79790527,-1.7967895,6.933109,-0.030298423,-2.4990695,-3.9680316,-1.9506446,4.2559133,-2.8250113,0.4994003,-1.5087417,-5.7463703,1.1300619,-1.2411556,-6.595294,-0.0934006,-0.8706929,4.403768,5.192113,0.48310396,-4.834977,-2.3440928,-2.2974927,-4.196175,2.414912,-0.6605946,2.9274123,4.1227612,-0.16037798,-8.127076,-3.446029,1.9328995,-2.111106,1.8778713,-2.897048,1.5886728,-5.4323025,1.7045444,-2.4136143,3.8408532,-0.5337128,-2.2928207,-1.7382953,0.09098073,-1.300728,-0.8281953,-1.1525726,-0.84625304,-2.2878902,-5.030779,-2.67265,2.7247734,-2.264197,3.3062067,-0.46559003,-2.9468179,-1.1472961,-1.4520688,-3.1004658,-1.8536705,-4.1697574,0.32169607,1.7598208,2.2715564,4.2248416,3.1257176,3.677123,4.230256,2.8922606,-0.87217396,-3.0904217,-0.55574507,1.9435997,5.549021,-3.7872756,3.0897324,-0.097842395,-4.4661193,2.938934,3.0534244,0.10790524,5.6419616,0.15369686,3.483013,1.6553112,-4.8810697,-0.9231835,3.173117,-1.7551247,4.637335,-0.730577,-1.5425801,6.371815,6.6207714,-4.487834,2.7473419,4.8579273,6.569581,1.8208268,8.746096,-7.077973,-0.4775117,-7.0221877,-7.0100126,-7.0821586,-8.197698,-3.6210713,1.2812003,-5.560208,-4.276379,-1.4776398,-0.88758385,-2.5942981,2.5243943,1.0197445,2.4176617,2.45327,-0.6637189,2.800004,-1.9259262,4.606128,-1.1435777,0.9984667,-1.7773466,6.289685,-2.1428418,3.051026,4.0307584,5.7427187,0.5248256,1.680105,4.312598,1.576643,-2.6204045,-2.1039653,-3.2650077,1.0309405,-5.9963536,-0.06316836,1.8335751,4.349598,-4.1136026,2.2643158,1.4947948,3.4409015,-2.7974985,-0.5884103,1.3973489,2.9184449,3.3647053,-2.400469,-0.9896228,-0.18442164,-2.7528298,-4.6264386,-1.7453794,0.4437589,-3.3659153,0.44241753,-1.8192259,-4.884926,-3.4103706,-1.8074872,1.9465916,0.2501485,0.22709401,-2.7311225,3.5477087,-3.846348,-4.78966,-1.5117993,-9.949708,-2.7689896,-2.1754947,1.7796515,-0.49461982,-7.8260283,-0.03801961,-3.5190663,-12.320113,4.802042,6.158374,-0.68677723,-2.1307847,-1.8024589,-1.6365415,6.4522047,-6.4947424,-2.5854187,-3.7983563,-0.42141622,-0.7935041,-7.003582,5.5538554,-6.708067,-0.6512247,2.9709935,2.9106574,-1.229637,4.874803,3.3120294,-1.2471927,-6.0788355,-4.0578327,-4.098973,-6.8474193,0.9618608,1.3166021,-4.3165364,1.5605065,-0.46334445,-1.1101197,-4.03313,-1.5837098,-2.1403253,-2.6463747,-1.9522319,0.8720429,0.88892406,-3.645824,-1.4897184,-5.4864287,-2.8008966,-1.277286,5.33907,1.9947534,-0.63594425,-1.9454434,4.5144076,7.9519305,-4.2052994,-3.6233494,0.10096723,-0.28127253,-3.9660218,-5.2565346,1.66393,0.83401763,-4.3888535,1.46052,0.06148243,-5.221744,1.7384404,0.88950753,-3.5079823,-0.21860728,-0.90256715,-1.1420189,0.79628253,-1.0500495,-0.2897424,5.5788155,5.1457224,-2.1806767,-5.907452,-4.913401,0.32267064,1.6881089,3.062316,-6.4352713,0.8358607,5.531818,-3.8972135,-2.0571852,3.4767585,-1.9873329,2.1148405,-4.491925,-0.7844994,0.54622877,-2.8520143,2.5221395,-1.9883534,4.29222,-3.3693078,-9.340117,-1.3140259,-1.3029573,2.6761913,0.69102776,-0.50975263,5.9260507,-5.0172124,-4.191392,0.21400985,-5.877317,3.8581715,3.0733378,-7.019503,0.7743113,0.6001988,-2.2386222,3.8154416,1.264989,7.6107078,-5.024393,-1.0051936,2.352628,1.7679702,1.6264362,-1.2554924,-5.4021635,-0.6205427,-1.9513756,9.007512,-1.1787542,-0.37205938]"
    }
}

返回参数说明

参数名 类型 说明
code string 状态码 1失败 0成功
message string 消息
data 数据集
faceimage string 人脸图片地址
facedata string 人脸特征

备注

1.2.3、员工新增接口

简要描述:

  • 员工增加

请求URL:

  • https://restapi.heils.cn/v1/{companykey}/employeeAdd

请求方式:

  • POST

参数:

参数名 必选 类型 说明
token string 鉴权token值
name string 员工名称
sex int 性别(1:男;2:女)
faceimages string 人脸图片路径(,号分隔)(最多两张)
facedatas string 人脸特征( | 号分隔)(最多两张)
phonenumber string 手机号码
job string 岗位
ifignoresame boolean 是否忽略相同人脸数据(默认:false)
organizationid string 机构(部门)ID
authorizationgroupid int 授权组ID
birthtime string 出生年月(yyyy-MM-dd )
employeenumber string 工号
remark string 备注

返回示例

{
    "data": {
        "employeeid": "GY00000023",
        "name": "测试员工",
        "authorizationgroupid": 33,
        "authorizationgroupname": "禾思一号门",
        "organizationid": "001",
        "organizationname": "heils",
        "phonenumber": "15874144120",
        "createtime": "2018-04-20 17:17:05"
    },
    "message": "操作成功",
    "code": "0"
}

返回参数说明

参数名 类型 说明
employeeid string 员工ID
name string 员工名称
authorizationgroupid int 授权组ID
authorizationgroupname string 授权组名称
organizationid string 机构(部门)ID
organizationname string 机构(部门)名称
phonenumber string 手机号码
createtime string 创建时间

备注

  • 增加:雇员新增之前先调用图片上传接口校验图片是否符合规则,同时获取人脸特征数据。验证通过之后调用增加接口保存数据

1.2.4、员工更新接口

简要描述:

  • 针对已经入库的员工数据做更新修改操作,包括基本信息和图片数据

请求URL:

  • https://restapi.heils.cn/v1/{companykey}/employeeUpdate

请求方式:

  • POST

参数:

参数名 必选 类型 说明
token string 鉴权token值
employeeid string 雇员ID
name string 员工名称
sex int 性别(1:男;2:女)
faceimages string 人脸图片路径(,号分隔)(最多两张)
facedatas string 人脸特征( | 号分隔)(最多两张)
phonenumber string 手机号码
job string 岗位
ifignoresame boolean 是否忽略相同人脸数据(默认:false)
organizationid string 机构(部门)ID
authorizationgroupid int 授权组ID
birthtime string 出生年月(yyyy-MM-dd )
employeenumber string 工号
remark string 备注

返回示例

{
    "message": "操作成功",
    "code": "0"
}

返回参数说明

参数名 类型 说明
code string 状态码 1失败 0成功
message string 消息
data string token值

备注

  • 更新:查询员工是否存在,校验各属性通过进行数据更新

1.2.5、员工删除接口

简要描述:

  • 删除已经成功添加的员工数据,关联信息数据都会从云端清除

请求URL:

  • https://restapi.heils.cn/v1/{companykey}/employeeDelete

请求方式:

  • POST

参数:

参数名 必选 类型 说明
token string 鉴权token值
employeeid string 雇员ID

返回示例

{
    "code": "0",
    "message": "操作成功",
}

返回参数说明

参数名 类型 说明
code string 状态码 1失败 0成功
message string 消息
data string token值

备注

  • 删除数据不可恢复,设备关联在终端也会被同步删除

1.2.6、访客新增接口

简要描述:

  • 访客增加

请求URL:

  • https://restapi.heils.cn/v1/{companykey}/visitorAdd

请求方式:

  • POST

参数:

参数名 必选 类型 说明
token string 鉴权token值
name string 员工名称
sex int 性别(1:男;2:女)
starttime string 访问开始时间
endtime string 访问结束时间
faceimages string 人脸图片路径(,号分隔)(最多两张)
facedatas string 人脸特征( | 号分隔)(最多两张)
phonenumber string 手机号码
job string 岗位
ifignoresame boolean 是否忽略相同人脸数据(默认:false)
organizationid string 机构(部门)ID
authorizationgroupid int 授权组ID
birthtime string 出生年月(yyyy-MM-dd )
employeenumber string 工号
remark string 备注

返回示例

{
    "data": {
        "visitorid": "FK00000019",
        "name": "测试员工",
        "authorizationgroupid": 33,
        "authorizationgroupname": "禾思一号门",
        "starttime": "2018-05-04 00:00:00",
        "endtime": "2018-06-04 00:00:00",
        "phonenumber": "15874144120",
        "createtime": "2018-04-20 17:41:14"
    },
    "message": "操作成功",
    "code": "0"
}

返回参数说明

参数名 类型 说明
visitorid string 访客ID
name string 访客名称
authorizationgroupid int 授权组ID
authorizationgroupname string 授权组名称
starttime string 访问开始时间
endtime string 访问结束时间
phonenumber string 手机号码
createtime string 创建时间

备注

  • 增加:访客新增之前先调用图片上传接口校验图片是否符合规则,同时获取人脸特征数据。验证通过之后调用增加接口保存数据

1.2.7、访客更新接口

简要描述:

  • 针对已经入库的访客数据做更新修改操作,包括基本信息和图片数据

请求URL:

  • https://restapi.heils.cn/v1/{companykey}/visitorUpdate

请求方式:

  • POST

参数:

参数名 必选 类型 说明
token string 鉴权token值
visitorid string 访客ID
name string 员工名称
sex int 性别(1:男;2:女)
starttime string 开始时间(yyyy-MM-dd HH:mm:ss)大于当前时间
endtime string 结束时间(yyyy-MM-dd HH:mm:ss)结束时间大于开始时间
phonenumber string 手机号码
faceimages string 人脸图片路径(,号分隔)(最多两张)
facedatas string 人脸特征( | 号分隔)(最多两张)
authorizationgroupid int 授权组ID
birthtime string 出生年月(yyyy-MM-dd )
idcard string 身份证
family string 民族
remark string 备注
ifignoresame boolean 是否忽略相同人脸数据(默认:false)

返回示例

{
    "message": "操作成功",
    "code": "0"
}

返回参数说明

参数名 类型 说明
code string 状态码 1失败 0成功
message string 消息
data string token值

备注

  • 更新:查询访客是否存在,校验各属性通过进行数据更新

1.2.8、访客删除接口

简要描述:

  • 删除已经成功添加的访客数据,关联信息数据都会从云端清除

请求URL:

  • https://restapi.heils.cn/v1/{companykey}/visitorDelete

请求方式:

  • POST

参数:

参数名 必选 类型 说明
token string 鉴权token值
visitorid string 访客ID

返回示例

{
    "code": "0",
    "message": "操作成功",
}

返回参数说明

参数名 类型 说明
code string 状态码 1失败 0成功
message string 消息

备注

  • 删除数据不可恢复,设备关联在终端也会被同步删除

1.2.9、识别记录查询接口

简要描述:

  • 查询识别的记录,包括人员识别记录,访客识别记录,最大时间段允许31天

请求URL:

  • https://restapi.heils.cn/v1/{companykey}/recognitionRecordQuery

请求方式:

  • POST

参数:

参数名 必选 类型 说明
token string 鉴权token值
personid string 员工\访客ID
persontype string 员类型(0,全部、1、人员;2、访客)
organizationid string 机构ID
authorizationgroupid int 授权组id
similarity float 相似度
starttime string 开始时间(记录时间段:2000-01-01)
endtime string 结束时间(记录时间段 2000-02-01)
limit int 每页条数
start int 开始位置

返回示例

{
    "data": {
        "list": [
            {
                "organizationname": null,
                "persontype": "1",
                "datanumber": "6870585153999347712",
                "personid": "GY00000102",
                "name": "zeng",
                "deviceid": "84:20:96:18:b1:e4",
                "devicename": "rk3288-新版",
                "deviceno": "AAK00001",
                "identificationtime": "2017-12-04 09:47:07",
                "updatetime": "2017-12-04 09:47:10",
                "similarity": "0.76",
                "faceimage": "http:xxx.jpg",
                "facedata": null,
                "organizationid": null
            }
        ],
        "count": {
            "total": 1,
            "visitorcount": 0,
            "employeecount": 1
        }
    },
    "message": "操作成功",
    "code": "0",
    "sumsize": 1
}

返回参数说明

  • 集合list数据
参数名 类型 说明
persontype String 人员类型
datanumber String 人员\访客数据标识
personid String 人员\访客ID
name String 人员\访客名称
deviceid String 设备ID
devicename String 设备名称
identificationtime String 识别时间
updatetime String 上传时间
similarity String 相似度
faceimage String 人脸图片
  • 统计数据:count
参数名 类型 说明
total int 总数
employeecount int 雇员数
visitorcount int 访客数

备注

1.2.10、回调接口

简要描述:

  • 当有人员被设备识别出后,云端服务器会向回调URL地址POST字段deviceid、personid、identificationtime、faceimage、type和persontype,回调地址由第三方服务提供。

请求URL:

  • http://xx.com/xxx

请求方式:

  • POST

参数:

参数名 必选 类型 说明
deviceid string 设备ID
personid string 人员ID
identificationtime string 识别时间
faceimage string 识别图片
type string 识别类型(1、正常;2、疑似; 3:陌生)
persontype string 人员类型(1、员工;2、访客)

返回示例

{
    "code": "0",
    "message": "操作成功"
}

返回参数说明

参数名 类型 说明
code string 状态码 1失败 0成功
message string 消息
data string token值