Skip to content

发送消息

https://chat-go.jwzhd.com/open-apis/v1/bot/send?token=xxxxxxxxxx

POST

curl --location --request POST 'https://chat-go.jwzhd.com/open-apis/v1/bot/send?token=xxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"recvId": "7058262",
"recvType": "user",
"contentType": "text",
"content": {
"text": "这里是消息内容"
}
}'
Content-Type: "application/json; charset=utf-8"
字段类型是否必填说明
recvIdstring接收消息对象ID
用户: userId
群: groupId
recvTypestring接收对象类型
用户: user
群: group
contentTypestring消息类型,取值如下
text\image\video\file\markdown\html (html支持标签
contentContent对象消息对象
parentIdstring引用消息 ID

contentType为text

字段类型是否必填说明
textstring消息正文
buttonsButton对象列表消息中包括button

contentType为image

字段类型是否必填说明
imageKeystring图片Key, 通过图片上传接口获得
buttonsButton对象列表消息中包括button

contentType为markdown

字段类型是否必填说明
textstringmarkdown字符串
buttonsButton对象列表消息中包括button

contentType为file

字段类型是否必填说明
fileKeystring文件Key, 通过文件上传接口获得
buttonsButton对象列表消息中包括button

contentType为video

字段类型是否必填说明
videoKeystring视频Key, 通过视频上传接口获得
buttonsButton对象列表消息中包括button
字段类型是否必填说明
textstring按钮上的文字
actionTypeint1: 跳转URL
2: 复制
3: 点击汇报
urlstring当actionType为1时使用
valuestring当actionType为2时,该值会复制到剪贴板
当actionType为3时,该值会发送给订阅端
字段类型说明
codeint响应代码
msgstring响应信息,包括异常信息
dataObject返回数据
{
"recvId": "7058262",
"recvType": "user",
"contentType": "text",
"content": {
"text": "这里是消息内容",
"buttons": [
[
{
"text": "复制",
"actionType": 2,
"value": "xxxx"
},
{
"text": "点击跳转",
"actionType": 1,
"url": "http://www.baidu.com"
}
]
]
}
}