跳转到主要内容
POST
/
api
/
v1
/
platform
/
bots
/
{bot_uuid}
/
send_message
通过机器人发送消息
curl --request POST \
  --url http://localhost:5300/api/v1/platform/bots/{bot_uuid}/send_message \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "target_type": "person",
  "target_id": "<string>",
  "message_chain": [
    {
      "type": "Plain",
      "text": "Hello, World!"
    }
  ]
}
'
{
  "code": 0,
  "data": {
    "sent": true
  }
}

授权

X-API-Key
string
header
必填

路径参数

bot_uuid
string<uuid>
必填

请求体

application/json
target_type
enum<string>
必填

目标类型

可用选项:
person,
group
target_id
string
必填

目标 ID(用户 ID 或群组 ID)

message_chain
object[]
必填

消息链

示例:
[
  { "type": "Plain", "text": "Hello, World!" }
]

响应

发送成功

code
integer
示例:

0

data
object