目录
兼容性:企业微信 3.1.8 开始支持
打开已有群聊并可选发送一条链接消息(link消息)。支持打开企业内部群、外部群、互联群。
ww.openExistedChatWithMsg({
chatId: 'chatId123',
msg: {
msgtype: 'link',
link: {
title: 'title1',
desc: 'desc1',
url: 'link1',
imgUrl: 'imgurl1'
}
}
})
本接口必须使用应用身份进行注册
属性 | 类型 | 必填 | 说明 | 最低版本 | ||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
chatId | string | 是 | 打开的群聊 ID | |||||||||||||||||||||||||||||||||||||||||||||||
msg | Object | 否 | 发送的链接消息。不传则表示仅进入群聊,不发消息 | 企业微信 iOS、Android 3.1.8,企业微信 PC、Mac 4.0.2 | ||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||
success | Function | 否 | 成功回调 | |||||||||||||||||||||||||||||||||||||||||||||||
fail | Function | 否 | 失败回调 | |||||||||||||||||||||||||||||||||||||||||||||||
cancel | Function | 否 | 取消回调 | |||||||||||||||||||||||||||||||||||||||||||||||
complete | Function | 否 | 完成回调 |
Promise<Object>
属性 | 类型 | 必填 | 说明 | |
---|---|---|---|---|
errMsg | string | 是 | 通用错误信息 | |
errCode | number | 是 | 通用错误码 |
errMsg | 说明 |
---|---|
openExistedChatWithMsg:ok | 执行成功 |
openExistedChatWithMsg:fail_unsupported_msgtype | msgtype不合法 |
openExistedChatWithMsg:fail_msg_link_missing_url | msg.link.url未传入 |
wx.invoke("openExistedChatWithMsg", {
chatId: "chatId123",
msg: {
msgtype: "link",
link: {
title: "title1",
desc: "desc1",
url: "link1",
imgUrl: "imgurl1"
}
}
},function(res){
if (res.err_msg == "openExistedChatWithMsg:ok")
{
}
}
);