エラーの応答には、プログラムで扱うためのコードと、そのまま人に見せられる文が入っています。
エラーの形式
エラー
{
"error": "bad_lang",
"message": "Choose the language readers should get, like en or pt-BR."
}
すべてのコード
/v1 のエンドポイントが返すコードは、以下ですべてです。キーが最初に確認されるので、有効なキーのないリクエストは、ほかにどんな問題があっても 401 になります。
| コード | ステータス | エンドポイント | メッセージと意味 |
|---|---|---|---|
unauthorized | 401 | すべて | 「Send your API key as: Authorization: Bearer wg_…」。キーがないか、間違っているか、取り消されています。 |
inactive | 403 | links、warm | 「This account is suspended, so new links can’t be made…」または「…so pages can’t be loaded ahead…」に、問い合わせ先のアドレスが続きます。アカウントが停止されています。新しいアカウントはすべて Free プランから始まるので、めったに起きません。 |
not_in_plan | 403 | すべて | 「The API and MCP are part of Starter, Pro and Premium. Choose a plan in Dashboard → Billing.」。有料プランが終わったときなど、アカウントが Free プランになっています。プランを選ぶまで、そのアカウントのキーは使えません。 |
not_in_plan | 403 | warm | 「Loading pages ahead of time is part of Pro and Premium.」(ページの先読みは Pro と Premium の機能です) |
over_quota | 403 | warm | 「This month’s translated pages are used up, so there’s nothing to load ahead for.」(今月の翻訳ページを使い切ったため、先読みする対象がありません)。翌月 1 日まで、リンクは原文を開きます。 |
warm_limit | 429 | warm | 「That’s as many pages as your plan loads ahead in a month.」(プランで 1 か月に先読みできるページ数に達しました)。上限はプランの月間ページ数と同じで、Pro は 1,000、Premium は 3,000 です。翌月 1 日にまた先読みできるようになります。 |
bad_url | 400 | links、warm | 「Enter the full address of the page, starting with https://」(warm では「Enter the full address, starting with https://」)。url フィールドがないか完全なアドレスではない、またはリクエストボディを読み取れませんでした(JSON やフォームの Content-Type がない、または JSON が不正)。 |
bad_url | 400 | links、warm | 「That address can't be translated. Use a public web page.」。翻訳サービスが読み込まないアドレスです。 |
unsafe_url | 400 | links | 「Google Safe Browsing lists this page as dangerous (phishing or malware), so Wallgone won't link to it.」。Google Web Risk で、このページがフィッシング、マルウェア、または不要なソフトウェアとして登録されています。 |
bad_lang | 400 | links | 「Choose the language readers should get, like en or pt-BR.」(読者に表示する言語を、en や pt-BR のように指定してください) |
bad_links | 400 | links/bulk | 「Send 1 to 500 links: …」。links がない、空である、リストではない、または 500 件を超えています。それより多いリンクは、複数のリクエストに分けて送ってください。 |
bad_lang_switch | 400 | links | 「lang_switch is true, false, or left out for the account’s setting.」(lang_switch には true か false を指定するか、アカウントの設定に従う場合は省略してください) |
bad_country | 400 | links、warm | 「Use a two-letter country code like jp, or leave it out.」(jp のような 2 文字の国コードを使うか、省略してください) |
blocked | 403 | warm | 「This publisher asked not to be translated, so its pages open as they are.」(このサイトの運営者が翻訳しないよう求めているため、ページはそのまま開きます) |
plan_changing | 409 | warm | 「Your plan changed a moment ago. Try again in 30 seconds.」(プランが変更された直後です。30 秒後にもう一度お試しください) |
not_found | 404 | すべて | 「No such endpoint.」。GET /v1/warm のように、パスかメソッドが間違っています。 |
server | 500 | すべて | 「Something went wrong on our side. Try again in a minute.」(当社側で問題が起きました。1 分後にもう一度お試しください) |
translator | 502 | warm | 「Couldn't reach the translator. Try again in a minute.」(翻訳サービスに接続できませんでした。1 分後にもう一度お試しください) |