Skip to content

API 文档

NapCatOneBot11 HTTP POST 接口文档


清理流式传输临时文件

POST
/clean_stream_temp_file

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"message": "success"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

下载语音文件流

POST
/download_file_record_stream

Request Body

application/json
JSON
{
"file": "record_file_id"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"file": "temp_record_path"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

下载图片文件流

POST
/download_file_image_stream

Request Body

application/json
JSON
{
"file": "image_file_id"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"file": "temp_image_path"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

测试下载流

POST
/test_download_stream

Request Body

application/json
JSON
{
"url": "http://example.com/file"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"success": true
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

流式接口


下载文件流

POST
/download_file_stream

以流式方式从网络或本地下载文件

Request Body

application/json
JSON
{
"file": "http://example.com/file.png"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"type": "stream",
"data_type": "file_info",
"file_name": "file.png",
"file_size": 1024
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

上传文件流

POST
/upload_file_stream

以流式方式上传文件数据到机器人

Request Body

application/json
JSON
{
"stream_id": "uuid-1234-5678",
"chunk_data": "SGVsbG8gV29ybGQ=",
"chunk_index": 0,
"total_chunks": 1,
"file_size": 11
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"type": "stream",
"stream_id": "uuid-1234-5678",
"status": "chunk_received",
"received_chunks": 1,
"total_chunks": 1
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

删除群相册媒体

POST
/del_group_album_media

Request Body

application/json
JSON
{
"group_id": "123456",
"album_id": "album_id_1",
"lloc": "media_id_1"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"result": {
}
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

点赞群相册媒体

POST
/set_group_album_media_like

Request Body

application/json
JSON
{
"group_id": "123456",
"album_id": "album_id_1",
"lloc": "media_id_1",
"id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"result": {
}
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发表群相册评论

POST
/do_group_album_comment

Request Body

application/json
JSON
{
"group_id": "123456",
"album_id": "album_id_1",
"lloc": "media_id_1",
"content": "很有意思"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"result": {
}
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群相册媒体列表

POST
/get_group_album_media_list

Request Body

application/json
JSON
{
"group_id": "123456",
"album_id": "album_id_1"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"media_list": [
{
"media_id": "media_id_1",
"url": "http://example.com/1.jpg"
}
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群相册列表

POST
/get_qun_album_list

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"album_id": "album_1",
"album_name": "测试相册",
"cover_url": "http://example.com/cover.jpg",
"create_time": 1734567890
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

上传图片到群相册

POST
/upload_image_to_qun_album

Request Body

application/json
JSON
{
"group_id": "123456",
"album_id": "album_id_1",
"album_name": "相册1",
"file": "/path/to/image.jpg"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"result": null
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置群加群选项

POST
/set_group_add_option

Request Body

application/json
JSON
{
"group_id": "123456",
"add_type": 1
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置群机器人加群选项

POST
/set_group_robot_add_option

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置群搜索选项

POST
/set_group_search

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置群备注

POST
/set_group_remark

设置群备注

Request Body

application/json
JSON
{
"group_id": "123456",
"remark": "测试群备注"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群详细信息 (扩展)

POST
/get_group_info_ex

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

群打卡

POST
/set_group_sign

Request Body

application/json
JSON
{
"group_id": "123456789"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

群打卡

POST
/send_group_sign

Request Body

application/json
JSON
{
"group_id": "123456789"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置群待办

POST
/set_group_todo

将指定消息设置为群待办

Request Body

application/json
JSON
{
"group_id": "123456",
"message_id": "123456789"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送戳一戳

POST
/group_poke

在群聊或私聊中发送戳一戳动作

Request Body

application/json
JSON
{
"user_id": "123456789"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送戳一戳

POST
/friend_poke

在群聊或私聊中发送戳一戳动作

Request Body

application/json
JSON
{
"user_id": "123456789"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送戳一戳

POST
/send_poke

在群聊或私聊中发送戳一戳动作

Request Body

application/json
JSON
{
"user_id": "123456789"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群详细信息

POST
/get_group_detail_info

获取群聊的详细信息,包括成员数、最大成员数等

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"group_id": 123456,
"group_name": "测试群",
"member_count": 100,
"max_member_count": 500
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群列表

POST
/get_group_list

获取当前帐号的群聊列表

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"group_id": 123456,
"group_name": "测试群",
"member_count": 100,
"max_member_count": 500
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群信息

POST
/get_group_info

获取群聊的基本信息

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"group_id": 123456,
"group_name": "测试群",
"member_count": 100,
"max_member_count": 500
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群成员列表

POST
/get_group_member_list

获取群聊中的所有成员列表

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"group_id": 123456,
"user_id": 123456789,
"nickname": "昵称",
"card": "名片",
"role": "member"
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群成员信息

POST
/get_group_member_info

获取群聊中指定成员的信息

Request Body

application/json
JSON
{
"group_id": "123456",
"user_id": "123456789"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"group_id": 123456,
"user_id": 123456789,
"nickname": "昵称",
"card": "名片",
"role": "member"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送群消息

POST
/send_group_msg

发送群消息

Request Body

application/json
JSON
{
"group_id": "123456",
"message": "hello"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"message_id": 123456
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

处理加群请求

POST
/set_group_add_request

同意或拒绝加群请求或邀请

Request Body

application/json
JSON
{
"flag": "flag_123",
"sub_type": "add",
"approve": true
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

退出群组

POST
/set_group_leave

退出或解散指定群聊

Request Body

application/json
JSON
{
"group_id": "123456",
"is_dismiss": false
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

全员禁言

POST
/set_group_whole_ban

开启或关闭指定群聊的全员禁言

Request Body

application/json
JSON
{
"group_id": "123456",
"enable": true
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

群组禁言

POST
/set_group_ban

禁言群聊中的指定成员

Request Body

application/json
JSON
{
"group_id": "123456",
"user_id": "123456789",
"duration": 1800
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

群组踢人

POST
/set_group_kick

将指定成员踢出群聊

Request Body

application/json
JSON
{
"group_id": "123456",
"user_id": "123456789",
"reject_add_request": false
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置群管理员

POST
/set_group_admin

设置或取消群聊中的管理员

Request Body

application/json
JSON
{
"group_id": "123456",
"user_id": "123456789",
"enable": true
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置群名称

POST
/set_group_name

修改指定群聊的名称

Request Body

application/json
JSON
{
"group_id": "123456",
"group_name": "新群名"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置群名片

POST
/set_group_card

设置群聊中指定成员的群名片

Request Body

application/json
JSON
{
"group_id": "123456",
"user_id": "123456789",
"card": "新名片"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群公告

POST
/_get_group_notice

获取指定群聊中的公告列表

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"notice_id": "notice_123",
"sender_id": 123456,
"publish_time": 1710000000,
"message": {
"text": "公告内容",
"image": [
]
}
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群精华消息

POST
/get_essence_msg_list

获取指定群聊中的精华消息列表

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"message_id": 123456,
"sender_id": 123456,
"sender_nick": "昵称",
"operator_id": 123456,
"operator_nick": "昵称",
"operator_time": 1710000000,
"content": "精华内容"
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群忽略通知

POST
/get_group_ignored_notifies

获取被忽略的入群申请和邀请通知

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"invited_requests": [
],
"InvitedRequest": [
],
"join_requests": [
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

移出精华消息

POST
/delete_essence_msg

将一条消息从群精华消息列表中移出

Request Body

application/json
JSON
{
"message_id": 123456
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置精华消息

POST
/set_essence_msg

将一条消息设置为群精华消息

Request Body

application/json
JSON
{
"message_id": 123456
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

删除群公告

POST
/_del_group_notice

删除群聊中的公告

Request Body

application/json
JSON
{
"group_id": "123456",
"notice_id": "notice_123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群禁言列表

POST
/get_group_shut_list

Request Body

application/json
JSON
{
"group_id": "123456789"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"user_id": 123456789,
"nickname": "禁言用户",
"shut_up_time": 1734567890
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群被忽略的加群请求

POST
/get_group_ignore_add_request

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"request_id": 12345,
"invitor_uin": 123456789,
"invitor_nick": "邀请者",
"group_id": 123456789,
"message": "加群请求",
"group_name": "群名称",
"checked": false,
"actor": 0,
"requester_nick": "请求者"
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

批量踢出群成员

POST
/set_group_kick_members

从指定群聊中批量踢出多个成员

Request Body

application/json
JSON
{
"group_id": "123456",
"user_id": [
"123456789"
],
"reject_add_request": false
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

创建收藏

POST
/create_collection

Request Body

application/json
JSON
{
"rawData": "收藏内容",
"brief": "收藏标题"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"result": 0,
"errMsg": ""
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置个性签名

POST
/set_self_longnick

修改当前登录帐号的个性签名

Request Body

application/json
JSON
{
"longNick": "个性签名"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置QQ头像

POST
/set_qq_avatar

修改当前账号的QQ头像

Request Body

application/json
JSON
{
"file": "base64://..."
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

英文单词翻译

POST
/translate_en2zh

将英文单词列表翻译为中文

Request Body

application/json
JSON
{
"words": [
"hello"
]
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"words": [
"你好"
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取ClientKey

POST
/get_clientkey

获取当前登录帐号的ClientKey

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"clientkey": "abcdef123456"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

图片 OCR 识别

POST
/ocr_image

识别图片中的文字内容(仅Windows端支持)

Request Body

application/json
JSON
{
"image": "image_id_123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"texts": [
{
"text": "识别内容",
"coordinates": [
]
}
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

图片 OCR 识别 (内部)

POST
/.ocr_image

识别图片中的文字内容(仅Windows端支持)

Request Body

application/json
JSON
{
"image": "image_id_123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"texts": [
{
"text": "识别内容",
"coordinates": [
]
}
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置专属头衔

POST
/set_group_special_title

设置群聊中指定成员的专属头衔

Request Body

application/json
JSON
{
"group_id": "123456",
"user_id": "123456789",
"special_title": "头衔"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取AI角色列表

POST
/get_ai_characters

获取群聊中的AI角色列表

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"type": "string",
"characters": [
{
"character_id": "id",
"character_name": "name",
"preview_url": "url"
}
]
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

处理可疑好友申请

POST
/set_doubt_friends_add_request

同意或拒绝系统的可疑好友申请

Request Body

application/json
JSON
{
"flag": "12345",
"approve": true
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取可疑好友申请

POST
/get_doubt_friends_add_request

获取系统的可疑好友申请列表

Request Body

application/json
JSON
{
"count": 10
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"user_id": 123456789,
"nickname": "昵称",
"age": 20,
"sex": "male",
"reason": "申请理由",
"flag": "flag_123"
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取登录号信息

POST
/get_login_info

获取当前登录帐号的信息

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"user_id": 123456789,
"nickname": "机器人"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取版本信息

POST
/get_version_info

获取版本信息

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"app_name": "NapCat.Onebot",
"protocol_version": "v11",
"app_version": "1.0.0"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

是否可以发送语音

POST
/can_send_record

检查是否可以发送语音

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"yes": true
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

是否可以发送图片

POST
/can_send_image

检查是否可以发送图片

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"yes": true
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取运行状态

POST
/get_status

获取运行状态

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"online": true,
"good": true,
"stat": {
}
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取 CSRF Token

POST
/get_csrf_token

获取 CSRF Token

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"token": 123456789
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取登录凭证

POST
/get_credentials

获取登录凭证

Request Body

application/json
JSON
{
"domain": "qun.qq.com"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"cookies": "uin=o123456789; skey=@abc12345;",
"token": 123456789
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取Packet状态

POST
/nc_get_packet_status

获取底层Packet服务的运行状态

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

重启服务

POST
/set_restart

重启服务

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群系统消息

POST
/get_group_system_msg

获取群系统消息

Request Body

application/json
JSON
{
"count": 50
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"invited_requests": [
],
"InvitedRequest": [
],
"join_requests": [
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

清理缓存

POST
/clean_cache

清理缓存

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置好友备注

POST
/set_friend_remark

设置好友备注

Request Body

application/json
JSON
{
"user_id": "123456",
"remark": "测试备注"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

点赞

POST
/send_like

给指定用户点赞

Request Body

application/json
JSON
{
"user_id": "123456",
"times": 10
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取好友列表

POST
/get_friend_list

获取当前帐号的好友列表

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"user_id": 123456789,
"nickname": "昵称",
"remark": "备注"
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

处理加好友请求

POST
/set_friend_add_request

同意或拒绝加好友请求

Request Body

application/json
JSON
{
"flag": "flag_12345",
"approve": true,
"remark": "新朋友"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取 Cookies

POST
/get_cookies

获取指定域名的 Cookies

Request Body

application/json
JSON
{
"domain": "qun.qq.com"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"cookies": "uin=o123456789; skey=@abc12345;",
"bkn": "123456789"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取最近会话

POST
/get_recent_contact

获取最近会话

Request Body

application/json
JSON
{
"count": 10
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"peerUin": "123456",
"peerName": "测试",
"msgTime": "1734567890",
"msgId": "12345",
"lastestMsg": {
}
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取扩展 RKey

POST
/get_rkey

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"type": "private",
"rkey": "rkey_123",
"created_at": 1734567890,
"ttl": 3600
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取 RKey 服务器

POST
/get_rkey_server

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"private_rkey": "&rkey=123456789",
"group_rkey": "&rkey=123456789",
"expired_time": 1694560000,
"name": "NapCat 4"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置在线状态

POST
/set_online_status

状态列表

在线

{ "status": 10, "ext_status": 0, "battery_status": 0; }

Q我吧

{ "status": 60, "ext_status": 0, "battery_status": 0; }

离开

{ "status": 30, "ext_status": 0, "battery_status": 0; }

忙碌

{ "status": 50, "ext_status": 0, "battery_status": 0; }

请勿打扰

{ "status": 70, "ext_status": 0, "battery_status": 0; }

隐身

{ "status": 40, "ext_status": 0, "battery_status": 0; }

听歌中

{ "status": 10, "ext_status": 1028, "battery_status": 0; }

春日限定

{ "status": 10, "ext_status": 2037, "battery_status": 0; }

一起元梦

{ "status": 10, "ext_status": 2025, "battery_status": 0; }

求星搭子

{ "status": 10, "ext_status": 2026, "battery_status": 0; }

被掏空

{ "status": 10, "ext_status": 2014, "battery_status": 0; }

今日天气

{ "status": 10, "ext_status": 1030, "battery_status": 0; }

我crash了

{ "status": 10, "ext_status": 2019, "battery_status": 0; }

爱你

{ "status": 10, "ext_status": 2006, "battery_status": 0; }

恋爱中

{ "status": 10, "ext_status": 1051, "battery_status": 0; }

好运锦鲤

{ "status": 10, "ext_status": 1071, "battery_status": 0; }

水逆退散

{ "status": 10, "ext_status": 1201, "battery_status": 0; }

嗨到飞起

{ "status": 10, "ext_status": 1056, "battery_status": 0; }

元气满满

{ "status": 10, "ext_status": 1058, "battery_status": 0; }

宝宝认证

{ "status": 10, "ext_status": 1070, "battery_status": 0; }

一言难尽

{ "status": 10, "ext_status": 1063, "battery_status": 0; }

难得糊涂

{ "status": 10, "ext_status": 2001, "battery_status": 0; }

emo中

{ "status": 10, "ext_status": 1401, "battery_status": 0; }

我太难了

{ "status": 10, "ext_status": 1062, "battery_status": 0; }

我想开了

{ "status": 10, "ext_status": 2013, "battery_status": 0; }

我没事

{ "status": 10, "ext_status": 1052, "battery_status": 0; }

想静静

{ "status": 10, "ext_status": 1061, "battery_status": 0; }

悠哉哉

{ "status": 10, "ext_status": 1059, "battery_status": 0; }

去旅行

{ "status": 10, "ext_status": 2015, "battery_status": 0; }

信号弱

{ "status": 10, "ext_status": 1011, "battery_status": 0; }

出去浪

{ "status": 10, "ext_status": 2003, "battery_status": 0; }

肝作业

{ "status": 10, "ext_status": 2012, "battery_status": 0; }

学习中

{ "status": 10, "ext_status": 1018, "battery_status": 0; }

搬砖中

{ "status": 10, "ext_status": 2023, "battery_status": 0; }

摸鱼中

{ "status": 10, "ext_status": 1300, "battery_status": 0; }

无聊中

{ "status": 10, "ext_status": 1060, "battery_status": 0; }

timi中

{ "status": 10, "ext_status": 1027, "battery_status": 0; }

睡觉中

{ "status": 10, "ext_status": 1016, "battery_status": 0; }

熬夜中

{ "status": 10, "ext_status": 1032, "battery_status": 0; }

追剧中

{ "status": 10, "ext_status": 1021, "battery_status": 0; }

我的电量

{
  "status": 10,
    "ext_status": 1000,
      "battery_status": 0;
}

Request Body

application/json
JSON
{
"status": 11,
"ext_status": 0,
"battery_status": 100
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取机器人 UIN 范围

POST
/get_robot_uin_range

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"minUin": "12345678",
"maxUin": "87654321"
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取自定义表情

POST
/fetch_custom_face

Request Body

application/json
JSON
{
"count": 10
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
"http://example.com/face1.png"
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置输入状态

POST
/set_input_status

Request Body

application/json
JSON
{
"user_id": "123456789",
"event_type": 1
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取用户在线状态

POST
/nc_get_user_status

Request Body

application/json
JSON
{
"user_id": "123456789"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"status": 10,
"ext_status": 0
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取 RKey

POST
/nc_get_rkey

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"key": "rkey_value",
"expired": 1734567890
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取小程序 Ark

POST
/get_mini_app_ark

Request Body

application/json
JSON
{
"type": "bili",
"title": "测试标题",
"desc": "测试描述",
"picUrl": "http://example.com/pic.jpg",
"jumpUrl": "http://example.com"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"data": {
"ark": "ark_content"
}
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送原始数据包

POST
/send_packet

Request Body

application/json
JSON
{
"cmd": "Example.Cmd",
"data": "123456",
"rsp": true
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": "123456",
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

退出登录

POST
/bot_exit

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取收藏列表

POST
/get_collection_list

Request Body

application/json
JSON
{
"category": "0",
"count": "50"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"errCode": 0,
"errMsg": "",
"collectionSearchList": {
"collectionItemList": [
{
"cid": "123456",
"type": 8,
"status": 1,
"author": {
"type": 2,
"numId": "123456",
"strId": "昵称",
"groupId": "123456",
"groupName": "群名",
"uid": "123456"
},
"bid": 1,
"category": 1,
"createTime": "1769169157000",
"collectTime": "1769413477691",
"modifyTime": "1769413477691",
"sequence": "1769413476735",
"shareUrl": "",
"customGroupId": 0,
"securityBeat": false,
"summary": {
"textSummary": null,
"linkSummary": null,
"gallerySummary": null,
"audioSummary": null,
"videoSummary": null,
"fileSummary": null,
"locationSummary": null,
"richMediaSummary": {
"title": "",
"subTitle": "",
"brief": "text",
"picList": [
],
"contentType": 1,
"originalUri": "",
"publisher": "",
"richMediaVersion": 0
}
}
}
],
"hasMore": false,
"bottomTimeStamp": "1769413477691"
}
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取表情点赞详情

POST
/fetch_emoji_like

Request Body

application/json
JSON
{
"message_id": 12345,
"emojiId": "123",
"emojiType": 1,
"count": 10,
"cookie": ""
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"emojiLikesList": [
{
"tinyId": "123456",
"nickName": "测试用户",
"headUrl": "http://example.com/avatar.png"
}
],
"cookie": "",
"isLastPage": true,
"isFirstPage": true,
"result": 0,
"errMsg": ""
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取消息表情点赞列表

POST
/get_emoji_likes

Request Body

application/json
JSON
{
"message_id": "12345",
"emoji_id": "123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"emoji_like_list": [
{
"user_id": "654321",
"nick_name": "测试用户"
}
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

分享群 (Ark)

POST
/ArkShareGroup

获取群分享的 Ark 内容

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": "{"app": "com.tencent.structmsg", ...}",
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

分享用户 (Ark)

POST
/ArkSharePeer

获取用户推荐的 Ark 内容

Request Body

application/json
JSON
{
"user_id": "123456",
"phone_number": ""
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"ark": "..."
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

分享群 (Ark)

POST
/send_group_ark_share

获取群分享的 Ark 内容

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": "{"app": "com.tencent.structmsg", ...}",
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

分享用户 (Ark)

POST
/send_ark_share

获取用户推荐的 Ark 内容

Request Body

application/json
JSON
{
"user_id": "123456",
"phone_number": ""
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"ark": "..."
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置消息表情点赞

POST
/set_msg_emoji_like

Request Body

application/json
JSON
{
"message_id": 12345,
"emoji_id": "123",
"set": true
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"result": true
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

点击内联键盘按钮

POST
/click_inline_keyboard_button

Request Body

application/json
JSON
{
"group_id": "123456",
"bot_appid": "1234567890",
"button_id": "btn_1",
"callback_data": "",
"msg_seq": "10086"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

文件接口


获取文件

POST
/get_file

获取指定文件的详细信息及下载路径

Request Body

application/json
JSON
{
"file": "file_id_123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"file": "/path/to/file",
"url": "http://...",
"file_size": 1024,
"file_name": "test.jpg"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取图片

POST
/get_image

获取指定图片的信息及路径

Request Body

application/json
JSON
{
"file": "image_id_123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"file": "/path/to/image",
"url": "http://..."
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取语音

POST
/get_record

获取指定语音文件的信息,并支持格式转换

Request Body

application/json
JSON
{
"file": "record_id_123",
"out_format": "mp3"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"file": "/path/to/record",
"url": "http://..."
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群文件URL

POST
/get_group_file_url

获取指定群文件的下载链接

Request Body

application/json
JSON
{
"group_id": "123456",
"file_id": "file_id_123",
"busid": 102
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"url": "http://..."
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取私聊文件URL

POST
/get_private_file_url

获取指定私聊文件的下载链接

Request Body

application/json
JSON
{
"user_id": "123456789",
"file_id": "file_id_123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"url": "http://..."
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置QQ资料

POST
/set_qq_profile

修改当前账号的昵称、个性签名等资料

Request Body

application/json
JSON
{
"nickname": "新昵称",
"personal_note": "个性签名"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群根目录文件列表

POST
/get_group_root_files

获取群文件根目录下的所有文件和文件夹

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"files": [
],
"folders": [
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

删除好友

POST
/delete_friend

从好友列表中删除指定用户

Request Body

application/json
JSON
{
"user_id": "123456789"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

检查URL安全性

POST
/check_url_safely

检查指定URL的安全等级

Request Body

application/json
JSON
{
"url": "https://example.com"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"level": 1
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取在线客户端

POST
/get_online_clients

获取当前登录账号的在线客户端列表

Request Body

application/json
JSON
{
"no_cache": false
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群荣誉信息

POST
/get_group_honor_info

获取指定群聊的荣誉信息,如龙王等

Request Body

application/json
JSON
{
"group_id": "123456",
"type": "all"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"group_id": 123456,
"current_talkative": {
},
"talkative_list": [
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送群公告

POST
/_send_group_notice

在指定群聊中发布新的公告

Request Body

application/json
JSON
{
"group_id": "123456",
"content": "公告内容",
"image": "base64://..."
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群艾特全体剩余次数

POST
/get_group_at_all_remain

获取指定群聊中艾特全体成员的剩余次数

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"can_at_all": true,
"remain_at_all_count_for_group": 10,
"remain_at_all_count_for_self": 10
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送合并转发消息

POST
/send_forward_msg

发送合并转发消息

Request Body

application/json
JSON
{
"group_id": "123456789",
"messages": [
]
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"message_id": 123456
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送群合并转发消息

POST
/send_group_forward_msg

Request Body

application/json
JSON
{
"group_id": "123456789",
"messages": [
]
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"message_id": 123456
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送私聊合并转发消息

POST
/send_private_forward_msg

Request Body

application/json
JSON
{
"user_id": "123456789",
"messages": [
]
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"message_id": 123456
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取陌生人信息

POST
/get_stranger_info

获取指定非好友用户的信息

Request Body

application/json
JSON
{
"user_id": "123456789"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"user_id": 123456789,
"nickname": "昵称",
"sex": "unknown"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

下载文件

POST
/download_file

下载网络文件到本地临时目录

Request Body

application/json
JSON
{
"url": "https://example.com/file.png",
"thread_count": 1,
"headers": "User-Agent: NapCat"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"file": "/path/to/downloaded/file"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

上传群文件

POST
/upload_group_file

上传资源路径或URL指定的文件到指定群聊的文件系统中

Request Body

application/json
JSON
{
"group_id": "123456",
"file": "/path/to/file",
"name": "test.txt"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"file_id": "file_uuid_123"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群历史消息

POST
/get_group_msg_history

获取指定群聊的历史聊天记录

Request Body

application/json
JSON
{
"group_id": "123456",
"message_seq": 0,
"count": 20
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"messages": [
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取合并转发消息

POST
/get_forward_msg

获取合并转发消息的具体内容

Request Body

application/json
JSON
{
"message_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"messages": [
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取好友历史消息

POST
/get_friend_msg_history

获取指定好友的历史聊天记录

Request Body

application/json
JSON
{
"user_id": "123456789",
"message_seq": 0,
"count": 20
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"messages": [
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

处理快速操作

POST
/.handle_quick_operation

处理来自事件上报的快速操作请求

Request Body

application/json
JSON
{
"context": {
},
"operation": {
}
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置群头像

POST
/set_group_portrait

修改指定群聊的头像

Request Body

application/json
JSON
{
"group_id": "123456",
"file": "base64://..."
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"result": 0,
"errMsg": ""
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

上传私聊文件

POST
/upload_private_file

上传本地文件到指定私聊会话中

Request Body

application/json
JSON
{
"user_id": "123456789",
"file": "/path/to/file",
"name": "test.txt"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"file_id": "file_uuid_123"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取机型显示

POST
/_get_model_show

获取当前账号可用的设备机型显示名称列表

Request Body

application/json
JSON
{
"model": "iPhone 13"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"variants": [
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置机型

POST
/_set_model_show

设置当前账号的设备机型名称

Request Body

application/json
JSON
{
"model": "iPhone 13",
"model_show": "iPhone 13"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

删除群文件

POST
/delete_group_file

在群文件系统中删除指定的文件

Request Body

application/json
JSON
{
"group_id": "123456",
"file_id": "file_uuid_123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

创建群文件目录

POST
/create_group_file_folder

在群文件系统中创建新的文件夹

Request Body

application/json
JSON
{
"group_id": "123456789",
"folder_name": "新建文件夹"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"result": {
},
"groupItem": {
}
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

删除群文件目录

POST
/delete_group_folder

在群文件系统中删除指定的文件夹

Request Body

application/json
JSON
{
"group_id": "123456",
"folder_id": "folder_uuid_123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群文件系统信息

POST
/get_group_file_system_info

获取群聊文件系统的空间及状态信息

Request Body

application/json
JSON
{
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"file_count": 10,
"limit_count": 10000,
"used_space": 1024,
"total_space": 10737418240
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取群文件夹文件列表

POST
/get_group_files_by_folder

获取指定群文件夹下的文件及子文件夹列表

Request Body

application/json
JSON
{
"group_id": "123456",
"folder_id": "folder_id"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"files": [
],
"folders": [
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

转发单条消息

POST
/forward_friend_single_msg

转发单条消息

Request Body

application/json
JSON
{
"message_id": 12345,
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

转发单条消息

POST
/forward_group_single_msg

转发单条消息

Request Body

application/json
JSON
{
"message_id": 12345,
"group_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

标记群聊已读

POST
/mark_group_msg_as_read

标记指定渠道的消息为已读

Request Body

application/json
JSON
{
"message_id": 12345
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

标记私聊已读

POST
/mark_private_msg_as_read

标记指定渠道的消息为已读

Request Body

application/json
JSON
{
"message_id": 12345
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取消息

POST
/get_msg

根据消息 ID 获取消息详细信息

Request Body

application/json
JSON
{
"message_id": 123456
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"time": 1710000000,
"message_type": "group",
"message_id": 123456,
"real_id": 123456,
"sender": {
"user_id": 123456789,
"nickname": "昵称"
},
"message": "hello"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送私聊消息

POST
/send_private_msg

发送私聊消息

Request Body

application/json
JSON
{
"user_id": "123456789",
"message": "hello"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"message_id": 123456
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送消息

POST
/send_msg

发送私聊或群聊消息

Request Body

application/json
JSON
{
"message_type": "group",
"group_id": "123456",
"message": "hello"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"message_id": 123456
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

撤回消息

POST
/delete_msg

撤回已发送的消息

Request Body

application/json
JSON
{
"message_id": 12345
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

标记消息已读 (Go-CQHTTP)

POST
/mark_msg_as_read

标记指定渠道的消息为已读

Request Body

application/json
JSON
{
"message_id": 12345
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

标记所有消息已读

POST
/_mark_all_as_read

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

移动群文件

POST
/move_group_file

Request Body

application/json
JSON
{
"group_id": "123456",
"file_id": "/file_id",
"current_parent_directory": "/current_folder_id",
"target_parent_directory": "/target_folder_id"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"ok": true
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

重命名群文件

POST
/rename_group_file

Request Body

application/json
JSON
{
"group_id": "123456",
"file_id": "/file_id",
"current_parent_directory": "/",
"new_name": "new_name.jpg"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"ok": true
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

传输群文件

POST
/trans_group_file

Request Body

application/json
JSON
{
"group_id": "123456",
"file_id": "/file_id"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"ok": true
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

创建闪传任务

POST
/create_flash_task

Request Body

application/json
JSON
{
"files": "C:\test.jpg",
"name": "test_task"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"task_id": "task_123"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取闪传文件列表

POST
/get_flash_file_list

Request Body

application/json
JSON
{
"fileset_id": "set_123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"file_name": "test.jpg",
"size": 1024
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取闪传文件链接

POST
/get_flash_file_url

Request Body

application/json
JSON
{
"fileset_id": "set_123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"url": "http://example.com/flash.jpg"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送闪传消息

POST
/send_flash_msg

Request Body

application/json
JSON
{
"fileset_id": "set_123",
"user_id": "123456789"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"message_id": 123456
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取文件分享链接

POST
/get_share_link

Request Body

application/json
JSON
{
"fileset_id": "set_123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": "http://example.com/share",
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取文件集信息

POST
/get_fileset_info

Request Body

application/json
JSON
{
"fileset_id": "set_123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"fileset_id": "set_123",
"file_list": [
]
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取在线文件消息

POST
/get_online_file_msg

Request Body

application/json
JSON
{
"user_id": "123456789"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送在线文件

POST
/send_online_file

Request Body

application/json
JSON
{
"user_id": "123456789",
"file_path": "C:\path\to\file.txt",
"file_name": "test.txt"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送在线文件夹

POST
/send_online_folder

Request Body

application/json
JSON
{
"user_id": "123456789",
"folder_path": "C:\path\to\folder"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

接收在线文件

POST
/receive_online_file

Request Body

application/json
JSON
{
"user_id": "123456789",
"msg_id": "123",
"save_path": "C:\save"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

拒绝在线文件

POST
/refuse_online_file

Request Body

application/json
JSON
{
"user_id": "123456789",
"msg_id": "123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

取消在线文件

POST
/cancel_online_file

Request Body

application/json
JSON
{
"user_id": "123456789",
"msg_id": "123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

下载文件集

POST
/download_fileset

Request Body

application/json
JSON
{
"fileset_id": "set_123"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取文件集 ID

POST
/get_fileset_id

Request Body

application/json
JSON
{
"share_code": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"fileset_id": "set_123"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取带分组的好友列表

POST
/get_friends_with_category

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"categoryId": 1,
"categoryName": "我的好友",
"categoryMbCount": 1,
"buddyList": [
]
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取资料点赞

POST
/get_profile_like

Request Body

application/json
JSON
{
"user_id": "123456789",
"start": 0,
"count": 10
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"uid": "u_123",
"time": "1734567890",
"favoriteInfo": {
"userInfos": [
],
"total_count": 10,
"last_time": 1734567890,
"today_count": 5
},
"voteInfo": {
"total_count": 100,
"new_count": 2,
"new_nearby_count": 0,
"last_visit_time": 1734567890,
"userInfos": [
]
}
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

设置自定义在线状态

POST
/set_diy_online_status

设置自定义在线状态

Request Body

application/json
JSON
{
"face_id": "123",
"face_type": "1",
"wording": "自定义状态"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取单向好友列表

POST
/get_unidirectional_friend_list

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"uin": 123456789,
"uid": "u_123",
"nick_name": "单向好友",
"age": 20,
"source": "来源"
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

频道接口


获取频道列表

POST
/get_guild_list

获取当前帐号已加入的频道列表

Request Body

application/json
JSON
{
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": [
{
"guild_id": "123456",
"guild_name": "测试频道"
}
],
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

获取频道个人信息

POST
/get_guild_service_profile

获取当前帐号在频道中的个人资料

Request Body

application/json
JSON
{
"guild_id": "123456"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
"guild_id": "123456",
"guild_name": "测试频道",
"guild_display_id": "123"
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

AI 扩展


获取 AI 语音

POST
/get_ai_record

通过 AI 语音引擎获取指定文本的语音 URL

Request Body

application/json
JSON
{
"character": "ai_char_1",
"group_id": "123456",
"text": "你好"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": "http://example.com/ai_voice.silk",
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

发送群 AI 语音

POST
/send_group_ai_record

发送 AI 生成的语音到指定群聊

Request Body

application/json
JSON
{
"character": "ai_char_1",
"group_id": "123456",
"text": "你好"
}

Responses

业务响应

application/json
JSON
{
"status": "ok",
"retcode": 0,
"data": {
},
"message": "",
"wording": "",
"stream": "normal-action"
}

Playground

Body

Samples

cURL
JavaScript
PHP
Python

Powered by VitePress OpenAPI