工作通知可以 参考以下几点:
1,https://debug.dingtalk.com/ 里面的 发送企业会话消息
2.代码地址
https://github.com/ddtalk/HarleyCorp 里面的 src\com\alibaba\dingtalk\openapi\demo\utils\HttpHelper.java
3 ,调用实例:
public
String sendMessage2(){
String url=DingConstant.
Send_Message_Url
.replace(
"ACCESS_TOKEN"
, AccessToken.getAccessToken().getToken());
System.
out
.println(
"----------"
+url);
JSONObject image=
new
JSONObject();
JSONObject text=
new
JSONObject();
text.put(
"content"
,
"你好测试消息接口"
);
image.put(
"text"
, text);
image.put(
"msgtype"
,
"text"
);
image.put(
"agentid"
,
""
);
image.put(
"touser"
,
""
);
System.
out
.println(image.toString());
JSONObject result=
null
;
HttpHelper h=
new
HttpHelper();
try
{
result=h.httpPost(url, image);
}
catch
(OApiException e) {
//
TODO
Auto-generated catch block
e.printStackTrace();
}
System.
out
.println(result.toString());
return
result.toString();
}