POST /api/message/send
基本信息
用户Alfresco向企业微信中发送消息(通过Alfresco应用)
请求方式:POST
请求API :/api/message/send
Body 参数(application/json)
参数 |
类型 |
说明 |
是否必填 |
touser |
string |
指定接收消息的成员,成员ID列表(多个接收者用竖线分隔,最多支持1000个)。特殊情况指定为”@all”,则向该企业应用的全部成员发送 |
|
toparty |
string |
指定接收消息的部门,部门ID列表,多个接收者用竖线分隔,最多支持100个。当touser为”@all”时忽略本参数 |
|
totag |
string |
指定接收消息的标签,标签ID列表,多个接收者用竖线分隔,最多支持100个。当touser为”@all”时忽略本参数 |
|
msgtype |
string |
消息类型,比如文本,图片,详情如下 |
是 |
注意: touser, toparty, totag 不能同时为空
文本类型参数
参数 |
类型 |
说明 |
是否必填 |
content |
string |
当发送类型为文本类型 |
是 |
msgtype |
string |
固定值:text |
是 |
文件|图片|视频类型参数
参数 |
类型 |
说明 |
是否必填 |
nodeId |
string |
当发送内容为媒体类型时 |
是 |
msgtype |
string |
文件:file/图片:image/视频:video |
是 |
图文消息(news)
参数 |
类型 |
说明 |
是否必填 |
msgtype |
string |
固定值:news |
是 |
articles |
数组 |
图文消息,一个图文消息支持1到8条图文 |
是 |
title |
string |
标题,不超过128个字节,超过会自动截断(支持id转译) |
是 |
description |
string |
描述,不超过512个字节,超过会自动截断(支持id转译) |
|
url |
string |
点击后跳转的链接。 |
是 |
picurl |
string |
图文消息的图片链接,支持JPG、PNG格式,较好的效果为大图 1068455,小图150150。此处的picurl可以参考企业微信上传图片素材api |
请求示例
{
"touser" : "UserID1|UserID2|UserID3",
"toparty" : "PartyID1 | PartyID2",
"totag" : "TagID1 | TagID2",
"msgtype" : "news",
"news" : {
"articles" : [
{
"title" : "中秋节礼品领取",
"description" : "今年中秋节公司有豪礼相送",
"url" : "URL",
"picurl" : "http://res.mail.qq.com/node/ww/wwopenmng/images/independent/doc/test_pic_msg1.png"
}
]
}
}
Copy
图文消息(mpnews)
参数 |
类型 |
说明 |
是否必填 |
msgtype |
string |
固定值:mpnews |
是 |
articles |
数组 |
图文消息,一个图文消息支持1到8条图文 |
是 |
title |
string |
标题,不超过128个字节,超过会自动截断(支持id转译) |
是 |
author |
string |
图文消息的作者,不超过64个字节 |
|
content_source_url |
string |
图文消息点击“阅读原文”之后的页面链接 |
|
content |
string |
图文消息的内容,支持html标签,不超过666 K个字节(支持id转译) |
是 |
digest |
string |
图文消息的描述,不超过512个字节,超过会自动截断(支持id转译) |
|
thumb_media_id |
string |
图片文件的nodeId |
是 |
请求示例
{
"touser" : "UserID1|UserID2|UserID3",
"toparty" : "PartyID1 | PartyID2",
"totag": "TagID1 | TagID2",
"msgtype" : "mpnews",
"mpnews" : {
"articles":[
{
"title": "Title",
"thumb_media_id": "Node_ID",
"author": "Author",
"content_source_url": "URL",
"content": "Content",
"digest": "Digest description"
}
]
}
}
Copy
公有链接
参数 |
类型 |
说明 |
是否必填 |
msgtype |
string |
固定值:publink |
V |
url |
string |
文件分享的url |
V |
dueDate |
string |
公有链接的截止日期 |
|
nodeId |
string |
文件名称 |
V |
私有链接
参数 |
类型 |
说明 |
是否必填 |
msgtype |
string |
固定值:prilink |
V |
nodeId |
string |
文件节点的id |
V |
返回结果
{
"status": {
"code": 200
},
"message": "ok"
}
Copy