bot チェックのシークレットを登録する
PUT
/config/botcheck-secret
import asyncioimport aiohttp
async def set_bot_check_secret(): async with aiohttp.ClientSession() as session: async with session.put( "https://cyan.qelvorn.xyz/api/auth/config/botcheck-secret", headers={ "Authorization": "Bearer cyt_…", "Content-Type": "application/json", }, json={"secret": "example"}, ) as resp: return await resp.json()
data = asyncio.run(set_bot_check_secret())print(data)const res = await fetch("https://cyan.qelvorn.xyz/api/auth/config/botcheck-secret", { method: "PUT", headers: { "Authorization": "Bearer cyt_…", "Content-Type": "application/json", }, body: JSON.stringify({ secret: "example" }),});const data = await res.json();curl -X PUT https://cyan.qelvorn.xyz/api/auth/config/botcheck-secret \ -H "Authorization: Bearer cyt_…" \ -H "Content-Type: application/json" \ -d '{"secret": "example"}'Bot チェックプロバイダのシークレットキーを登録する。平文はこのリクエストでしか受けず、暗号化して保存する。スコープ: config。
Authorizations
Section titled “Authorizations”Request Body
Section titled “Request Body”Bot チェックシークレット登録のリクエスト
Media typeapplication/json
object
secret
required
Bot チェックプロバイダのシークレットキー
string
Example generated
{ "secret": "example"}Responses
Section titled “Responses”シークレットを登録した。
Media typeapplication/json
object
ok
required
boolean
bot_check_secret_set
required
シークレットを登録した
boolean
Example
{ "ok": true, "bot_check_secret_set": true}リクエスト不正。
Media typeapplication/json
object
ok
required
boolean
code
required
エラーコード
string
Example
{ "ok": false, "code": "invalid_request"}トークンがない・無効(invalid_token)。
Media typeapplication/json
object
ok
required
boolean
code
required
エラーコード
string
Example
{ "ok": false, "code": "invalid_token"}スコープ不足・アプリ未承認・失効・停止。
Media typeapplication/json
object
ok
required
boolean
code
required
エラーコード
string
Example
{ "ok": false, "code": "insufficient_scope"}レート制限。Retry-After ヘッダー(秒)も返す。
Media typeapplication/json
object
ok
required
boolean
code
required
エラーコード
string
layer
required
制限が掛かった層。Retry-After ヘッダー(秒)も参照すること
string
Example
{ "ok": false, "code": "rate_limited", "layer": "token"}