功能说明:接入道一云平台的第三方应用,可以调用发送文本消息接口向用户推送微信文本消息,可用于应用通知等场景。
请求方式:POST(HTTPS)multipart/form-data
请求地址:https://qwif.do1.com.cn/qwcgi/api/message/sendTextMessage.do?token=token&corpId=corpId
{
"agentCode":"agentCode",
"depaId":"6bcdc904-3843-4ff4-acd0-824be1304847",
"text":"只是测试啦",
"wxUserId":"15113012345"
}
|
参数名 |
释义 |
类型 |
是否必须 |
备注 |
|---|---|---|---|---|
|
wxUserId |
发送的目标用户,用户信息中的wxUserId字段,多个以“|”隔开,@all表示发送全公司 |
String |
是 |
wxUserId与depaId必填其中一项
|
|
agentCode |
发送的目标应用code |
String |
是 |
参考推送消息附录 |
|
depaId |
发送部门,使用部门信息的id字段,多个以“|”隔开 |
String |
是 |
wxUserId与depaId必填其中一项 |
|
text |
发送的消息,空字符串不行 |
String |
是 |
SendTextVO sendTextVO = new SendTextVO();
//设置应用为dynamic,即新闻公告
sendTextVO.setAgentCode("dynamic");
//设置特定部门 多个部门用|隔开
sendTextVO.setDepaId("6bcdc9");
//设置用户ID,多个用户用|隔开
sendTextVO.setWxUserId("18321215943");
sendTextVO.setText("这是一条文本消息推送测试1.0");
System.out.println(JSONUtil.stringify(sendTextVO));
ThirdpartyNewsSendApi sendNewsApi = QwSdkUtil.getInter(ThirdpartyNewsSendApi.class);
sendNewsApi.sendTextMessage(QwSdkUtil.getCacheToken(),sendTextVO);
{
"code":"0",
"desc":"成功",
"data":{
}
}