热线:020-3888 8813
手机:159 7551 6269
系统API 考勤机API

接口全局调用说明

1、博海云考勤接口服务器接地址:http://yun.kqapi.com

2、频繁请求会造成服务器压力增加,所以接口请求调用频率要求大于20秒/次。

3、接口通过GET方式调用传递参数,编码格式为UTF-8。

4、公共请求参数,每次调用接口必需带上以下参数:

参数 类型 必填 说明
account string Yes   API帐号,请使用管理员帐号登录考勤系统在API设置的获取并设置API密钥。
requesttime unixtime stamp Yes   发起请求的unixtime时间戳,即1970/01/01到现在的秒数,服务器要求请求60秒内有效,否则返回请求超时,请检查服务器的时间与接口服务器时间差是否超过60秒。
sign string Yes   防伪签名,除sign参数外其它请求参数的签名,例如参数:account=xxx&requesttime=1234567890&start=2019-01-01&end=2019-01-31,参数键按字母顺序排序值拼接,即拼成:xxx2019-01-3112345678902019-01-01,再拼接API设置的密钥,例如密钥为key,即最后拼成xxx2019-01-3112345678902019-01-01key,再把这个字符串生成md5,即93c38c6616553a814affb2a11fe0a9b2,注意:参数值包含中文字符的请先转UTF-8编码后再生成签名。

5、接口返回结果为Json格式

{"status":1,"error":"","data":[]}
参数 类型 说明
status int 成功失败标志,1成功,其它失败,后面不再复述。
error string 如果失败返回错误提示,后面不再复述。
data array 返回数据的集合

获取打卡记录

1、接口路径:/Api/Api/recordlog

2、另有收费主动推送打卡记录接口,具体请联系客服。

3、接口调用参数:

参数 类型 必填 说明
start date No   获取打卡记录的开始时间,格式yyyy-mm-dd,不传时段参数即返回当天的所有记录。
end date No   获取打卡记录的结束时间,格式yyyy-mm-dd,不支持跨月查询记录。
page int No   分页的第1页,系统按每页50条记录进行分页处理,返回结果中包含记录总数和分页总数,请根据分页总数循环获取。
useraccount int No   员工CC号,不传即获取所有员工的记录。

4、接口返回结果为Json格式

{"status":1,"error":"","data":{"total":"2","totalpage":1,"page":1,"attendata":[{"atten_id":"763103149","atten_device":"Q10171210591","atten_uid":"1176","atten_type":"1","atten_status":"0","atten_time":"1522405040","atten_date":"2018-03-30","companyId":"11024","realname":"员工1","departname":"部门1","remark":"广州分公司"},{"atten_id":"763150570","atten_device":"Q10171210591","atten_uid":"1191","atten_type":"1","atten_status":"0","atten_time":"1522404974","atten_date":"2018-03-30","companyId":"11024","realname":"员工2","departname":"部门2","remark":"上海分公司"}]}}
参数 类型 说明
total int 时间段记录总数。
totalpage int 按每页50条记录的分页总数。
page int 当前记录分页。
attendata array 打卡记录数据集。
atten_id int 打卡记录自增ID,系统唯一。
atten_device string 打卡设备序列号。
atten_uid int 员工CC号,系统唯一。
atten_type int 验证方式,仅供参考。
atten_status int 打卡类型,仅供参考,即将取消。
atten_time int 打卡时间戳,即打卡时间的unixtime stamp形式。
atten_date date 打卡日期,即将取消。
companyId int 公司ID,系统唯一,即将取消。
realname string 员工姓名。
departname string 员工所属部门。
remark string 打卡设备的备注信息,即将取消。

获取部门列表

1、接口路径:/Api/Api/getDepartment

2、接口返回结果为Json格式

{"status":1,"error":"","data":[{"id":"1","pid":"0","name":"部门1","top":"9"},{"id":"2","pid":"0","name":"部门2","top":"8"}]}
参数 类型 说明
id int 部门ID,系统唯一。
pid int 部门父级ID,上层ID。
name string 部门名称。
top int 部门排序序号。

添加部门

1、接口路径:/Api/Api/addDepartment

2、接口调用参数:

参数 类型 必填 说明
parentid int Yes   部门父级ID,上层ID。
deptname string Yes   部门名称。

3、接口返回结果为Json格式

{"status":1,"error":"","data":123456}
参数 类型 说明
data int 添加成功后的部门ID。

修改部门

1、接口路径:/Api/Api/updateDepartment

2、接口调用参数:

参数 类型 必填 说明
deptid int Yes   所需修改的部门ID。
parentid int No   部门父级ID,上层ID。
deptname string No   部门名称。

3、接口返回结果为Json格式

{"status":1,"error":"","data":""}

获取员工列表

1、接口路径:/Api/Api/getEmployee

2、接口调用参数:

参数 类型 必填 说明
page int No   获取第几页,每页50条记录。

3、接口返回结果为Json格式

{"status":1,"error":"","data":{"total":"2","totalpage":1,"page":1,"userData":[{"account":"709394","realname":"员工1","fingerprint":7,"departname":"部门1","deptid":"1"},{"account":"194880","realname":"员工2","fingerprint":1,"departname":"部门2","deptid":"2"}]}}
参数 类型 说明
userData array 员工数据集。
account int 员工CC号。
realname string 员工姓名。
fingerprint int 员工指纹数。
departname string 所在部门名称。
deptid int 所在部门ID。

获取员工信息

1、接口路径:/Api/Api/getUserDetail

2、接口调用参数:

参数 类型 必填 说明
useraccount int Yes   员工CC号。

3、接口返回结果为Json格式

{"status":1,"error":"","data":{"account":"709394","email":"email@kqapi.com","realname":"员工1","mobile":"13800138000","sex":"1","departname":"部门1","fingerprint":7,"card":123456}}
参数 类型 说明
account int 员工CC号。
email string 员工电子邮箱。
realname string 员工姓名。
mobile string 员工手机号码。
sex int 员工性别,1男性,2女性。
fingerprint int 员工指纹数。
departname string 所在部门名称。
card int 刷卡卡号。

添加员工

1、接口路径:/Api/Api/addEmployee

2、接口调用参数:

参数 类型 必填 说明
realname string Yes   员工姓名。
password string Yes   员工系统登录密码,需转换为MD5。
mobile string Yes   员工手机号码。
email string No   员工电子邮箱。
card int No   员工刷卡卡号。
deptid int 所在部门ID。
sex int No   员工性别,1男性,2女性。
sn string No   设备序列号,添加员工后同时同步员工信息到设备,多个设备用英文逗号分隔。

3、接口返回结果为Json格式

{"status":1,"error":"","data":{"account":"123456"}}
参数 类型 说明
account int 添加成功后系统分配的员工CC号,系统唯一。

更新员工信息

1、接口路径:/Api/Api/updateEmployee

2、接口调用参数:

参数 类型 必填 说明
useraccount int Yes   员工CC号。
realname string No   员工姓名。
password string No   员工系统登录密码,需转换为MD5。
mobile string No   员工手机号码。
email string No   员工电子邮箱。
card int No   员工刷卡卡号。
deptid int 所在部门ID。
sex int No   员工性别,1男性,2女性。
sn string No   设备序列号,员工更新后同步员工信息到设备,多个设备用英文逗号分隔。

3、接口返回结果为Json格式

{"status":1,"error":"","data":""}

辞退并删除员工

1、接口路径:/Api/Api/layoffEmployee

2、接口调用参数:

参数 类型 必填 说明
useraccount string Yes   员工CC号,多个员工可用英文逗号隔开,警告:该操作删除的员工不可恢复。

3、接口返回结果为Json格式

{"status":1,"error":"","data":""}

同步员工到设备

1、接口路径:/Api/Api/syncEmployee

2、接口调用参数:

参数 类型 必填 说明
useraccount string Yes   员工CC号,多个员工可用英文逗号隔开。
sn string Yes   设备序列号,要同步员工信息的设备,多个设备用英文逗号分隔。

3、接口返回结果为Json格式

{"status":1,"error":"","data":""}

从设备删除员工

1、接口路径:/Api/Api/removeEmployee

2、接口调用参数:

参数 类型 必填 说明
useraccount string Yes   员工CC号,多个员工可用英文逗号隔开。
sn string Yes   设备序列号,要同步员工信息的设备,多个设备用英文逗号分隔。

3、接口返回结果为Json格式

{"status":1,"error":"","data":""}

登记补签卡

1、接口路径:/Api/Api/reCheck

2、接口调用参数:

参数 类型 必填 说明
useraccount string Yes   员工CC号,多个员工可用英文逗号隔开。
time datetime Yes   要补签的时间,格式yyyy-mm-dd hh:ii:ss。

3、接口返回结果为Json格式

{"status":1,"error":"","data":""}

添加申请单

1、接口路径:/Api/Api/Apply

2、接口调用参数:

参数 类型 必填 说明
useraccount int Yes   员工CC号。
starttime datetime Yes   申请的开始时间,格式yyyy-mm-dd hh:ii:ss。
endtime datetime Yes   申请的结束时间,格式yyyy-mm-dd hh:ii:ss。
type int Yes   申请的类型,1加班,2调体,3外出,其它为自定义类型详见请假类型列表接口。
reason string No   申请的原因说明。

3、接口返回结果为Json格式

{"status":1,"error":"","data":123}
参数 类型 说明
data int 申请添加成功后的记录ID。

获取请假类型列表

1、接口路径:/Api/Api/applyType

2、接口返回结果为Json格式

{"status":1,"error":"","data":{"210":"事假","211":"年假","212":"病假","0":"请假","1":"加班","2":"调休","3":"外出","4":"补签卡"}}
参数 类型 说明
data array 请假类型数据集,ID=>名称。

获取员工请假记录

1、接口路径:/Api/Api/applyRecord

2、接口调用参数:

参数 类型 必填 说明
useraccount int No   员工CC号。
start date Yes   开始时间,格式yyyy-mm-dd。
end date Yes   结束时间,格式yyyy-mm-dd。
page int No   第几页,按每页50条记录分页。

3、接口返回结果为Json格式

{"status":1,"error":"","data":{"total":"2","totalpage":1,"page":1,"data":[{"useraccount":"564442","typeid":"210","type_name":"外出","from":"2018-08-24 09:54","to":"2018-08-25 09:54","status":"已同意","realname":"员工1"},{"useraccount":"564442","typeid":"211","type_name":"病假","from":"2018-07-24 11:27","to":"2018-07-25 11:27","status":"已同意","realname":"员工2"}]}}
参数 类型 说明
useraccount int 员工CC号。
typeid int 请假类型ID。
type_name string 类型名称。
from datetime 开始时间,格式yyyy-mm-dd hh:ii。
to datetime 结束时间,格式yyyy-mm-dd hh:ii。
status string 请假审批状态。
realname string 员工姓名。

获取汇总报表

1、接口路径:/Api/Api/Report

2、接口调用参数:

参数 类型 必填 说明
start date Yes   汇总开始日期,格式yyyy-mm-dd。
end date Yes   汇总结束日期,格式yyyy-mm-dd。
useraccount string Yes   员工CC号,多个员工可用英文逗号隔开。
page int No   第几页,按每页50条记录分页。

3、接口返回结果为Json格式

{"status":1,"error":"","data":{"total":"1","totalpage":1,"page":1,"data":[{"useraccount":"123","workday":"8","realday":"0","worktime":"172800","realtime":"0","notcheckin":"8","notcheckout":"8","patchtimes":"0","latertimes":"0","latetime":"0","earlytimes":"0","earlytime":"0","absenttimes":"8","absenttime":"172800","applytime":"7200","overtime":"0","switchtime":"0","outtime":"0","holidaytime":"0","moretime":"0","apply":{"16":3600,"20":3600}}]}}
参数 类型 说明
useraccount int 员工CC号。
workday int 排班标准工作天数。
realday int 员工实际工作天数。
worktime int 排班标准工作秒数。
realtime int 员工实际工作秒数。
notcheckin int 员工上班未打卡次数。
notcheckout int 员工下班未打卡次数。
patchtimes int 员工补签卡次数
latertimes int 员工迟到次数。
latetime int 员工迟到总秒数。
earlytimes int 员工早退次数。
earlytime int 员工早退总秒数。
absenttimes int 员工旷工次数。
absenttime int 员工旷工总秒数。
applytime int 员工请假总秒数。
overtime int 员工加班总秒数。
switchtime int 员工调休总秒数。
outtime int 员工外出总秒数。
holidaytime int 节假日总秒数。
moretime int 员工额外工时总秒数。
apply array 请假按类型分类详细秒数,类型=>总秒数。

获取员工日卡报表

1、接口路径:/Api/Api/dayReport

2、接口调用参数:

参数 类型 必填 说明
start date Yes   汇总开始日期,格式yyyy-mm-dd。
end date Yes   汇总结束日期,格式yyyy-mm-dd,时间跨度不能大于31天。
useraccount int Yes   员工CC号,仅支持单个员工获取。

3、接口返回结果为Json格式

{"status":1,"error":"","data":[{"useraccount":"101324","date":"2018-06-01","work":"10:30","offwork":"19:30","checkin":"0","checkout":"0","late":"0","leaveearly":"0","worktime":"32400","realtime":"0","absent":"32400"},{"useraccount":"101324","date":"2018-06-02","work":"09:00","offwork":"12:00","checkin":"0","checkout":"0","late":"0","leaveearly":"0","worktime":"10800","realtime":"0","absent":"10800"}]}
参数 类型 说明
useraccount int 员工CC号。
date date 统计日期。
work time 排班标准上班时间。
offwork time 排班标准下班时间。
checkin int 员工实际上班打卡时间,unixtime stamp格式。
checkout int 员工实际下班打卡时间,unixtime stamp格式。
late int 员工迟到总秒数。
leaveearly int 员工早退总秒数。
worktime int 排班标准工作总秒数。
realtime int 员工实际工作秒数。
absent int 员工旷工总秒数。

获取设备列表

1、接口路径:/Api/Api/getDevice

2、接口调用参数:

参数 类型 必填 说明
sn string No   设备序列号。

3、接口返回结果为Json格式

{"status":1,"error":"","data":[{"sn":"0474140800378","remark":"广州分公司","updatetime":"1395731701","expired":"0"},{"sn":"0412135000230","remark":"上海分公司","updatetime":"1395927150","expired":"0"}]}
参数 类型 说明
sn string 设备序列号。
remark string 设备标识备注。
updatetime int 设备最后响应时间戳。
expired int 设备有效期时间戳,0为长期。

多了解一下,让我们电话沟通吧! 沟通一下

销售电话

159 7551 6269
020-3888 8813转813

售后咨询

020-3888 8813转814


天猫旗舰店


淘宝旗舰店

返回顶部