发送卡片消息
开发中
POST
https://chat.xiaoheihe.cn/chatroom/v2/channel_msg/send
请求参数
Authorization
在 header 添加参数
token
示例:
token: ********************
Query 参数
client_type
string
声明请求黑盒语音
默认值:
heybox_chat
x_client_type
string
声明客户端类型
默认值:
web
os_type
string
声明客户端类型
默认值:
web
x_os_type
string
声明客户端是bot
默认值:
bot
x_app
string
声明请求黑盒语音
默认值:
heybox_chat
chat_os_type
string
声明客户端是bot
默认值:
bot
chat_version
string
必需
默认值:
1.30.0
Header 参数
Content-Type
string
必需
示例值:
application/json;charset=UTF-8
Body 参数application/json
msg
string
必需
msg_type
integer
必需
heychat_ack_id
string
必需
reply_id
string
必需
room_id
string
必需
addition
string
必需
at_user_id
string
必需
at_role_id
string
必需
mention_channel_id
string
必需
channel_id
string
必需
channel_type
integer
必需
示例
{
"addition": "{}",
"room_id": "3690042373845835xxx",
"channel_id": "3690042373983952xxx",
"channel_type": 1,
"heychat_ack_id": "0",
"msg_type": 20,
"msg": "{\"data\":[{\"type\":\"card\",\"modules\":[{\"type\":\"section\",\"paragraph\":[{\"type\":\"plain-text\",\"text\":\"黑盒语音\"}]},{\"type\":\"section\",\"paragraph\":[{\"type\":\"markdown\",\"text\":\"**黑盒语音**\"}]},{\"type\":\"section\",\"paragraph\":[{\"type\":\"plain-text\",\"text\":\"黑盒语音\"},{\"type\":\"markdown\",\"text\":\"**黑盒语音**\"},{\"type\":\"plain-text\",\"text\":\"黑盒语音\"}]},{\"type\":\"section\",\"paragraph\":[{\"type\":\"plain-text\",\"text\":\"123\"},{\"type\":\"image\",\"url\":\"https://chat.max-c.com/pic/1844295655587745795.gif\",\"size\":\"medium\",\"width\":144,\"height\":144}]},{\"type\":\"section\",\"paragraph\":[{\"type\":\"plain-text\",\"text\":\"123\"},{\"type\":\"button\",\"event\":\"link-to\",\"value\":\"https://chat.top\",\"text\":\"跳转\",\"theme\":\"success\",\"size\":\"lg\"}]}]}]}"
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://chat.xiaoheihe.cn/chatroom/v2/channel_msg/send?client_type=&x_client_type=&os_type=&x_os_type=&x_app=&chat_os_type=&chat_version=' \
--header 'Content-Type: application/json;charset=UTF-8' \
--header 'token;' \
--data-raw '{
"addition": "{}",
"room_id": "3690042373845835xxx",
"channel_id": "3690042373983952xxx",
"channel_type": 1,
"heychat_ack_id": "0",
"msg_type": 20,
"msg": "{\"data\":[{\"type\":\"card\",\"modules\":[{\"type\":\"section\",\"paragraph\":[{\"type\":\"plain-text\",\"text\":\"黑盒语音\"}]},{\"type\":\"section\",\"paragraph\":[{\"type\":\"markdown\",\"text\":\"**黑盒语音**\"}]},{\"type\":\"section\",\"paragraph\":[{\"type\":\"plain-text\",\"text\":\"黑盒语音\"},{\"type\":\"markdown\",\"text\":\"**黑盒语音**\"},{\"type\":\"plain-text\",\"text\":\"黑盒语音\"}]},{\"type\":\"section\",\"paragraph\":[{\"type\":\"plain-text\",\"text\":\"123\"},{\"type\":\"image\",\"url\":\"https://chat.max-c.com/pic/1844295655587745795.gif\",\"size\":\"medium\",\"width\":144,\"height\":144}]},{\"type\":\"section\",\"paragraph\":[{\"type\":\"plain-text\",\"text\":\"123\"},{\"type\":\"button\",\"event\":\"link-to\",\"value\":\"https://chat.top\",\"text\":\"跳转\",\"theme\":\"success\",\"size\":\"lg\"}]}]}]}"
}'
返回响应
🟢200成功
application/json
Body
msg
string
必需
result
object
必需
chatmobile_ack_id
string
必需
heychat_ack_id
string
必需
status
string
必需
示例
{
"msg": "string",
"result": {
"chatmobile_ack_id": "string",
"heychat_ack_id": "string"
},
"status": "string"
}
修改于 2024-11-21 10:00:28