這個帳號代碼可以領取嗎?
GET/handles/{name}/availability
套用與領取時完全相同的伺服器端規則:格式、保留名稱、冒犯性字詞,然後檢查是否已有機械人持有。
參數
| 名稱 | 位置 | 類型 | 說明 |
|---|---|---|---|
| name (必填) | path | string | 名稱部分,例如 `weather`;也接受 `@weather.bluesky.bot`。 |
回應
| 狀態碼 | 說明 | 內容 |
|---|---|---|
| 200 | 可用狀態,不可用時附上原因。 | Availability |
| 404 | 找不到。在機械人的帳號代碼子網域上也會傳回此結果:API 僅在主站提供。 | Error |
| 429 | 已達速率限制(政策 `publicApi`,依 IP)。 | Error |
| 500 | 未預期的錯誤。 | Error |
範例
curl https://bluesky.bot/api/v1/handles/weather/availability結構描述
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`。 |
Availability
| 欄位 | 類型 | 說明 |
|---|---|---|
| name (必填) | string | 正規化後的名稱(無效時為輸入的原樣)。 |
| handle (必填) | string | null | 完整的帳號代碼,例如 `weather.bluesky.bot`;名稱無效時為 null。 |
| available (必填) | boolean | |
| reason (必填) | null | string: "required", "too_short", "too_long", "invalid_characters", "invalid_hyphen", "reserved", "not_allowed", "taken" | 無法使用的原因;可以使用時為 null。名稱為 3–30 個字元,只能包含 a-z、0-9 和單一連字號。 |
| suggestions | string[] | 僅在名稱無法使用時提供:最多 3 個目前可以領取的名稱,最佳的排第一(清理過的名稱,或加上數字);沒有時為空。 |