开发者社区> 问答> 正文

为什么不能成功获取部门的信息,返回的都是空值


{"errcode":0,"access_token":"3d3e113c02xxxx47ba9c9be96c1750ca","errmsg":"ok","expires_in":7200}null
null

展开
收起
求再来一发 2018-06-13 14:51:00 1663 0
2 条回答
写回答
取消 提交回答
  • Re为什么不能成功获取部门的信息,返回的都是空值
    你调错接口了吧
    https://oapi.dingtalk.com/department/list?access_token=ACCESS_TOKEN
    2018-06-25 21:42:51
    赞同 展开评论 打赏
  • Re为什么不能成功获取部门的信息,返回的都是空值

    public static JSONArray getDepartment(String accessToken,String department_id,String offset,String limit){
            String recordUrl = "https://oapi.dingtalk.com/user/simplelist?access_token="+accessToken+"id="+department_id;
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("id", department_id);
            jsonObject.put("offset",offset);
            jsonObject.put("limit",limit);
            String result = test.doPost(recordUrl,jsonObject,"utf-8");
            JSONObject resutJSON = jsonObject.parseObject(result);
            String msg = (String)resutJSON.get("errmsg");
            JSONArray jsonArray = null;
            if("ok".equals(msg)){
                jsonArray = (JSONArray) resutJSON.get("recordresult");
            }
            return jsonArray;[code][/code]
    2018-06-13 14:57:08
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

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