开发者社区> 问答> 正文

获取考勤打卡数据怎么传userIDList

IDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/attendance/list"); OapiAttendanceListRequest req = new OapiAttendanceListRequest(); req.WorkDateFrom = "2021-10-10 00:00:00"; req.WorkDateTo = "2021-10-17 00:00:00"; req.UserIdList = "011829613821850016"; req.Offset = 0L; req.Limit = 50L; OapiAttendanceListResponse rsp = client.Execute(req, access_token); Console.WriteLine(rsp.Body);

十六代码如上,在API Explorer 调试正常,复制到VS 里运行,提示req.UserIdList = "011829613821850016"不能把string 转为List ,

调整为List userIds = new List (); userIds.Add( "011829613821850016"); 代码调整为 IDingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/attendance/list"); OapiAttendanceListRequest req = new OapiAttendanceListRequest(); req.WorkDateFrom = "2021-10-10 00:00:00"; req.WorkDateTo = "2021-10-17 00:00:00"; req.UserIdList = userIds ; req.Offset = 0L; req.Limit = 50L; OapiAttendanceListResponse rsp = client.Execute(req, access_token); Console.WriteLine(rsp.Body);

报错:errmsg提示 {"errcode":40032,"errmsg":"不合法的UserID列表长度"}" 到底应该怎么写这个UserIdlist,

展开
收起
游客wx4nmxlcg4yfg 2021-11-12 17:03:06 1104 0
0 条回答
写回答
取消 提交回答
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载