获取指定机器人
检索应用程序内指定机器人列表。
请求方法
POST: https://数据中心域名/v3/bot/get.json
频率限制: 每秒钟限 100 次
签名规则: 所有服务端 API 请求均需要进行规则校验,详见 API 请求签名。
正文参数
HTTP 请求正文数据格式为 application/json
,支持以下 HTTP 请求参数:
参数 | 类型 | 必传 | 说明 |
---|---|---|---|
userIds | Array<String> | 是 | 机器人用户 ID 列表,最多 20 个。 |
请求示例
HTTP
POST /v3/bot/get.json HTTP/1.1
Host: api.rong-api.com
App-Key: e0x9wycxx2qdq
Nonce: 83682
Timestamp: 1726627371000
Signature: 81be659c74fccb5be993d553c51f5e26c13e6825
Content-Type: application/json
{
"userIds": ["BOT-001","BOT-02"]
}
返回结果
HTTP 响应正文包含具有以下结构的 JSON 对象:
返回值 | 返回类型 | 说明 |
---|---|---|
code | Int | 返回码,200 表示处理成功。 |
bots[] | Array<Object> | 机器人列表。 |
bots[].userId | String | 机器人的唯一 ID。 |
bots[].name | String | 机器人的昵称。 |
bots[].type | String | 机器人的类型。 |
bots[].profileUrl | String | 机器人头像的 URL。 |
bots[].integrations[] | Array<Object> | 集成平台配置列表。 |
bots[].integrations[].enabled | Boolean | 是否启用该集成项。 |
bots[].integrations[].type | String | 集成类型。 |
bots[].integrations[].callbackUrl | String | 平台回调地址。 |
bots[].integrations[].objectNames | Array<String> | 监听的消息类型。 |
bots[].integrations[].events | Array<String> | 触发事件类型。 |
bots[].integrations[].stream | Boolean | 是否启用流式响应。 |
bots[].integrations[].handleResponse | Boolean | 是否处理 第三方返回结果。 |
bots[].integrations[].auth.apiKey | String | 第三方平台认证信息。 |
bots[].metadata | Map<String, String> | 自定义键值对。 |
返回结果示例
HTTP
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
X-Request-ID: XXXXXXXXXXXXXXXXXXXXXXXXXXXX
{
"code": 200,
"total": 2,
"hasNext": false,
"bots": [
{
"userId": "bot-10001",
"name": "助手A",
"profileUrl": "https://example.com/avatarA.png",
"type": "AI",
"metadata": {
"creator": "运营团队",
"version": "1.0"
},
"integrations": [],
"createdAt": 1680000000000,
"updatedAt": 1680003600000
},
{
"userId": "bot-10002",
"name": "助手B",
"profileUrl": "https://example.com/avatarB.png",
"type": "AI",
"metadata": {
"creator": "研发团队",
"version": "1.1"
},
"integrations": [
{
"enabled": true,
"type": "webhook",
"callbackUrl": "https://webhook.example.com/callback",
"objectNames": ["RC:Text"],
"events": ["message:private"]
}
],
"createdAt": 1680007200000,
"updatedAt": 1680010800000
}
]
}