メインコンテンツへスキップ
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