1、获得appKey,appSecret,agentId
2、获取access_token
public static void getAccess_token() throws ApiException {
DingTalkClient client = new DefaultDingTalkClient("https://oapi.dingtalk.com/gettoken");
OapiGettokenRequest req = new OapiGettokenRequest();
req.setAppkey(appKey);
req.setAppsecret(appSecret);
req.setHttpMethod("GET");
OapiGettokenResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
//{"errcode":0,"access_token":"4ec91c8f213d3236bdf8eaf6ffe95b2d&