机器人的目录信息
GET/me/bots/{did}/listing
控制台的“目录”“链接”和“信息披露”标签页所编辑的内容,可通过 HTTP 和需要身份验证的 MCP 工具获取。原样作为 `PATCH` 发回时,通常不会改变任何内容(规则变更前保存的值可能会被拒绝)。需要 `listing` 范围。拟议中的外部命令 `bsbot listing get` 并不存在于已记录的 npm CLI 0.1.0 中。
参数
| 名称 | 位置 | 类型 | 描述 |
|---|---|---|---|
| did (必填) | path | string | 机器人的 DID,与 `GET /me/bots` 列出的一致。 |
响应
| 状态码 | 描述 | 正文 |
|---|---|---|
| 200 | 目录信息。 | BotListingResult |
| 401 | 令牌缺失、已过期或已撤销(代码 `unauthorized`)。请重新运行 `bsbot login`。 | Error |
| 403 | 令牌缺少 `listing` 范围(`insufficient_scope`,附带 `scope` 和 `WWW-Authenticate` 质询):这是在该范围出现之前签发的 CLI 令牌。请重新运行 `bsbot login`。 | Error |
| 404 | 你的账户中没有这个机器人,或这是机器人的账户代码子域名(API 仅在主站点提供)。 | Error |
| 429 | 已限速:按 IP 的 `publicApi`、按账户的 `creatorApi`,以及针对领取、切换、检查和释放的按账户 `handleChange`(与控制台共享)。 | Error |
| 500 | 意外错误。 | Error |
示例
curl \
-H "Authorization: Bearer $BLUESKY_BOT_TOKEN" \
https://bluesky.bot/api/v1/me/bots/did:plc:yourbot/listing数据结构
Error
| 字段 | 类型 | 描述 |
|---|---|---|
| error (必填) | object | |
| error.code (必填) | string: "bad_request", "invalid_handle", "not_found", "rate_limited", "internal_error", "unauthorized", "forbidden", "conflict", "invalid_grant", "upstream_error", "insufficient_scope", "invalid_listing", "consent_required" | |
| error.message (必填) | string | |
| error.reason | string | 用于 `invalid_handle`、`invalid_listing`、`conflict` 和 `forbidden`:例如 `reserved`、`taken`、`too_long`、`no_handle`、`suspended`。 |
| error.url | string, uri | 用于 consent_required:打开此控制台页面以授权编辑个人资料。 |
| error.field | string | 用于 `invalid_listing`:被拒绝的字段。 |
| error.scope | string | 用于 `insufficient_scope`:令牌缺少的范围。 |
| error.parameter | string | 无效的查询参数。 |
| error.retryAfterSeconds | integer (1–) | 与 `rate_limited` 一起返回。 |
BotUsageLine
| 字段 | 类型 | 描述 |
|---|---|---|
| kind (必填) | string: "mention", "follow", "dm" | `mention`:用 `example` 提及机器人;`follow`:关注机器人;`dm`:给它发送私信。 |
| description (必填) | string | 机器人的用途,一行纯文本。 |
| example | string | 仅用于提及行(提及行始终有此字段):帖文中跟在 `@handle` 后面的文字。绝不是链接或其他提及。 |
BotListing
| 字段 | 类型 | 描述 |
|---|---|---|
| listed (必填) | boolean | 显示在公开目录中。 |
| category (必填) | string | null: "news", "art", "utility", "fun", "weather", "dev", "ai", "other", null | |
| description (必填) | string | null | 简短的公开摘要。发布时必须提供非空白的描述;已列入目录时清除描述会被拒绝(required_for_listing)。如需清除,请在同一次修改中将其移出目录。 |
| languages (必填) | string: "en", "ja", "pt", "es", "fr", "de", "it", "nl", "ko", "zh", "ru", "uk", "pl", "tr", "ar", "fa", "he", "hi", "id", "th", "vi", "sv", "ca", "eo"[] | 创作者声明的语言,主要语言排在第一位(BCP-47 主语言代码)。 |
| showRecentPosts (必填) | boolean | 机器人页面显示其最新帖文。 |
| operator (必填) | object | 运营者信息行及其是否显示。 |
| operator.name (必填) | string | null | |
| operator.shown (必填) | boolean | |
| usage (必填) | BotUsageLine[] | |
| sourceUrl (必填) | string | null | |
| openSource (必填) | boolean | |
| supportUrl (必填) | string | null | |
| disclosure (必填) | object | |
| disclosure.purpose (必填) | string | null | |
| disclosure.contact (必填) | string | null | 一个 https 链接、写成 `@handle` 的 Bluesky 账户代码,或一个电子邮箱地址。这个需要身份验证的端点返回可编辑的地址,绝不返回经过混淆处理的公开显示内容。 |
| disclosure.contactEmailPublic (必填) | boolean | 明确同意公开电子邮箱联系方式;设置新地址时必须为 true。清除 contact 即可撤回同意。 |
| disclosure.usesGenerativeAi (必填) | boolean | null | 选择 AI 分类或发布 AI 目录信息时,必须设为 true 或 false。false 是有效值;过去未知的回答保持为 null。分类和信息披露的变更会在同一次操作中一并检查。 |
| disclosure.automationLevel (必填) | string | null: "automated", "collaborative", "assisted", null | |
| disclosure.activities (必填) | string: "scheduled_posts", "event_posts", "replies_to_mentions"[] |
BotListingResult
| 字段 | 类型 | 描述 |
|---|---|---|
| listing (必填) | BotListing |