> ## Documentation Index
> Fetch the complete documentation index at: https://ayrshare.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 400 Bad Requestエラーの修正方法 | Ayrshare API Docs

> Ayrshare APIがBad Request（400）エラーを返す理由、不足しているパラメータや無効なパラメータの見つけ方、およびリクエストを修正して再送信する方法を学びましょう。

JSONの代わりに「Bad Request」というHTMLレスポンスを受け取った場合、POSTボディパラメータが有効なJSONではない可能性があります。

たとえば、以下の無効なJSONを送信した場合:

```javascript theme={"system"}
{
    "post": "A "great" post"
    "platforms: ["twitter"]
}
```

「Bad Request」のレスポンスが返されます。上記のコードには3つの問題があります: `post`にカンマがない、投稿テキストにエスケープされていない二重引用符がある、そして`platform`に終わりの引用符がありません。有効なJSONは次のようになります:

```javascript theme={"system"}
{
    "post": "A \"great\" post",
    "platforms": ["twitter"]
}
```

以下のURLへPOSTすることでJSONを検証できます。Content-Typeを`text/plain`に設定してください。

[Postman](/testing/postman)で呼び出しを試すことをお勧めします。JSONフォーマットの修正に役立ちます。詳細は次のセクションを参照してください。

## JSONの検証

[https://jsonlint.com/](https://jsonlint.com/)のようなオンラインリンター、または[Postman](/testing/postman)を使用してJSONを検証できます。

`/validate/json`エンドポイントを使用することもできます:

<Card title="validate" icon="link" href="/apis/validate/overview" horizontal />
