已领取账户代码背后的 DID
GET/resolve/{handle}
与 `https://<handle>/.well-known/atproto-did` 的结果相同。仅限 `*.bluesky.bot` 账户代码。
参数
| 名称 | 位置 | 类型 | 描述 |
|---|---|---|---|
| handle (必填) | path | string | 完整的账户代码,例如 `weather.bluesky.bot`(不区分大小写)。 |
响应
| 状态码 | 描述 | 正文 |
|---|---|---|
| 200 | 账户代码及其 DID。 | Resolution |
| 400 | 不是 `*.bluesky.bot` 账户代码(代码 `invalid_handle`)。 | Error |
| 404 | 未找到。在机器人的账户代码子域名上也会返回此结果:API 仅在主站点提供。 | Error |
| 429 | 已限速(策略 `publicApi`,按 IP)。 | Error |
| 500 | 意外错误。 | Error |
示例
curl https://bluesky.bot/api/v1/resolve/weather.bluesky.bot数据结构
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` 一起返回。 |
Resolution
| 字段 | 类型 | 描述 |
|---|---|---|
| handle (必填) | string | |
| did (必填) | string |