考勤打卡数据导出 最后更新时间: 2024年05月14日
产品介绍
该 API 是通过 HTTPS 协议访问远程服务的接口,提供考勤打卡数据的导出查询能力。
使用限制
详细的服务调用量限制可点我查阅。
使用说明
接收请求返回的数据(JSON或XML格式),参考返回参数文档解析数据。
如无特殊声明,接口的输入参数和输出数据编码全部统一为 UTF-8 编码方式。
业务身份和业务签名
接口调用要求进行业务身份和签名校验,详情见:业务身份和业务签名 。
1. 考勤打卡详情导出
请求地址
parameters代表的参数为“url 请求参数”,包括必填参数和可选参数。所有参数均使用字符"&"进行分隔。下面的列表枚举了这些参数及其使用规则。
url 请求参数
示例代码(以java为例)
import com.amap.wia.openapi.test.lib.MyHttpUtils;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/demo-lib
import com.amap.wia.openapi.test.lib.SignatureHelper;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/biz-token-sign
/*
* 通用 import 内容等暂略
*/
public static void main(String[] args) {
String requestUrl = "https://restwia.amap.com/api/v1/wia/attendance/detail/export";
//公共参数
Map<String, Object> params = new HashMap<>();
params.put("key", "在高德开放平台申请的key");
params.put("openId", "当前操作用户的openId");
params.put("bizToken", "在高德开放平台申请的bizToken");
params.put("workMapId","工作地图id");
//计算bizSign
String[] signArgs = new String[]{"工作地图id","openid"};
params.put("bizSign", SignatureHelper.calcSign("在高德开放平台申请的bizSecret", signArgs));//业务签名
params.put("startTime","开始时间戳");
params.put("endTime","结束时间戳");
// params.put("cursorId",);
params.put("pageSize",10);
String response = MyHttpUtils.postFormUrlencoded(requestUrl,params);
System.out.println(response);
}
返回参数
响应结果的格式为 JSON 形式。
以下是返回参数说明:
返回结果示例
{
"data":{
"attendDetailList":[
{
"dateStr":"23-11-21 星期二",
"userNickName":"ljy30",
"attendGroupName":"啦啦啦测试",
"attendTimeInfo":"2023/11/21 17:14:50",
"punchCardAddressName":"北京市朝阳区来广营乡红军营东路甲8号",
"punchCardTypeDesc":"上班卡",
"punchCardStatus":"正常上班",
"remark":"啦啦啦备注",
"images":"[\"https://amap-track-oss-files.oss-cn-shenzhen.aliyuncs.com/6d785f51ed8fb34822b374ef91309f0b/snapshot_temp_2_thumb.jpeg\",\"https://amap-track-oss-files.oss-cn-shenzhen.aliyuncs.com/48dfe378d0a8414181efd911dc6f308b/snapshot_temp_5_thumb.jpeg\",\"https://amap-track-oss-files.oss-cn-shenzhen.aliyuncs.com/37944ba2ff83b3d1f37a8cad53130634/snapshot_temp_8_thumb.jpeg\"]",
"position":null,
"resourceName":"北苑东路3号",
"resourceLocationCode":"WIA-200.90642,46.74314133"
},
{
"dateStr":"23-11-22 星期三",
"userNickName":"ljy30",
"attendGroupName":"啦啦啦测试",
"attendTimeInfo":"2023/11/22 15:38:06",
"punchCardAddressName":"北京市朝阳区北苑东路3号",
"punchCardTypeDesc":"上班卡",
"punchCardStatus":"正常上班",
"remark":null,
"images":"[]",
"position":null,
"resourceName":null,
"resourceLocationCode":null
},
{
"dateStr":"23-11-22 星期三",
"userNickName":"ljy30",
"attendGroupName":"啦啦啦测试",
"attendTimeInfo":"2023/11/22 15:38:21",
"punchCardAddressName":"北京市朝阳区来广营乡红军营东路甲8号",
"punchCardTypeDesc":"下班卡",
"punchCardStatus":"正常下班",
"remark":null,
"images":"[]",
"position":null,
"resourceName":"罗森(鸿懋商务大厦店)",
"resourceLocationCode":"WIA-200.90642,46.74588160"
}
],
"cursorId":null
},
"code":1,
"message":"Successful",
"result":true,
"version":"1.0",
"timestamp":1701935390666,
"requestId":"21050b8317019353900811098d1827"
}
2. 考勤打卡统计数据导出(天维度)
请求地址
parameters代表的参数为“url 请求参数”,包括必填参数和可选参数。所有参数均使用字符"&"进行分隔。下面的列表枚举了这些参数及其使用规则。
url 请求参数
示例代码(以java为例)
import com.amap.wia.openapi.test.lib.MyHttpUtils;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/demo-lib
import com.amap.wia.openapi.test.lib.SignatureHelper;//见 https://lbs.amap.com/api/wia-openapi/guide/tools/biz-token-sign
/*
* 通用 import 内容等暂略
*/
public static void main(String[] args) {
String requestUrl = "https://restwia.amap.com/api/v1/wia/attendance/stats/day/export";
//公共参数
Map<String, Object> params = new HashMap<>();
params.put("key", "在高德开放平台申请的key");
params.put("openId", "当前操作用户的openId");
params.put("bizToken", "在高德开放平台申请的bizToken");
//计算bizSign
String[] signArgs = new String[]{"工作地图id","openid"};
params.put("bizSign", SignatureHelper.calcSign("在高德开放平台申请的bizSecret", signArgs));//业务签名
params.put("startTime","开始时间戳");
params.put("endTime","结束时间戳");
params.put("pageSize",10);
params.put("pageNum",1);
String response = MyHttpUtils.postFormUrlencoded(requestUrl,params);
System.out.println(response);
}
返回参数
响应结果的格式为 JSON 形式。
以下是返回参数说明:
返回结果示例
{
"code":1,
"message":"Successful",
"timestamp":1671509034000,
"data":{
"attendDayStatsList":[
{
"dateStr":"2023-11-21 星期二",
"userNickName":"ljy30",
"attendGroupName":"测试考勤组",
"attendPeriodOfTime":"灵活上下班",
"attendPunchStatsExportDayInnerDTOList":[
{
"onWorkPunchTime":"17:14",
"onWorkPunchResult":"正常上班",
"offWorkPunchTime":"-",
"offWorkPunchResult":"缺卡"
}
],
"attendCount":"1",
"restCount":"0",
"attendValidTime":"0.0",
"lateCount":"0",
"lateTime":"0.0",
"earlyCount":"0",
"earlyTime":"0.0",
"absentCountOn":"0",
"absentCountOff":"1",
"neglectWork":"0",
"anormalStatus":"-",
"workMapName":"-"
},
{
"dateStr":"2023-11-20 星期一",
"userNickName":"ljy30",
"attendGroupName":"测试考勤组",
"attendPeriodOfTime":"灵活上下班",
"attendPunchStatsExportDayInnerDTOList":[
{
"onWorkPunchTime":"19:30",
"onWorkPunchResult":"正常上班",
"offWorkPunchTime":"-",
"offWorkPunchResult":"缺卡"
}
],
"attendCount":"1",
"restCount":"0",
"attendValidTime":"0.0",
"lateCount":"0",
"lateTime":"0.0",
"earlyCount":"0",
"earlyTime":"0.0",
"absentCountOn":"0",
"absentCountOff":"1",
"neglectWork":"0",
"anormalStatus":"-",
"workMapName":"-"
}
]
}
}