API エラー・メッセージ
API 要求が要求エラーやサーバー・エラーで失敗すると、エラー応答メッセージが JSON 形式で返されます。
他の MIME タイプをサポートするエンドポイントの場合でも、エラー応答メッセージは JSON 形式で返されます。 エラー応答メッセージには、エラー・メッセージ自体、エラーの説明、エンドポイントの固有のエラー・コード、HTTP 応答メッセージ、および HTTP 応答コードが含まれます。
エラー応答には、以下のフィールドが含まれています。
- message: エラー・メッセージ
- details: 追加情報のフィールド (データが取り込まれている場合と取り込まれていない場合があります)
- description: 特定のエラーの説明
- code: 固有のエラー応答コード
- http_response:
- message: HTTP 応答メッセージ
- code: HTTP 応答状況コード
例えば、以下の API 要求は、「test-set」という存在しないリファレンス・セットに関する情報を取得しようとしています。
https://<host_ip>/api/reference_data/sets/test_set
アン HTTP404応答コードと以下の JSON エラー応答メッセージが返されます。
{
"message": "test_set does not exist",
"details": {},
"description": "The reference set does not exist.",
"code": 1002,
"http_response": {
"message": "We could not find the resource you requested.",
"code": 404
}
}
次の表は、REST API が返す HTTP レスポンス・エラー・カテゴリの詳細です。 IBM® QRadar® REST API によって返されるレスポンス・エラーのカテゴリの詳細を示します:
| HTTP エラー・カテゴリー | HTTP 応答コード | HTTP 応答メッセージ |
|---|---|---|
| 複数選択 (MULTIPLE CHOICES) | 300 | The requested resource corresponds to any one of a set of representations, each with its own specific location. |
| 永続的に移動 (MOVED PERMANENTLY) | 301 | The resource has moved permanently. Please refer to the documentation. |
| FOUND | 302 | The resource has moved temporarily. Please refer to the documentation. |
| 他を参照 (SEE OTHER) | 303 | The resource can be found under a different URI. |
| 変更なし (NOT MODIFIED) | 304 | The resource is available and not modified. |
| プロキシーの使用 (USE PROXY) | 305 | The requested resource must be accessed through the proxy given by the Location field. |
| 一時リダイレクト (TEMPORARY REDIRECT) | 307 | The resource resides temporarily under a different URI. |
| 誤った要求 (BAD REQUEST) | 400 | Invalid syntax for this request was provided. |
| 無許可 (UNAUTHORIZED) | 401 | You are unauthorized to access the requested resource. Please log in. |
| 禁止 | 403 | Your account is not authorized to access the requested resource. |
| 見つかりません。 | 404 | We could not find the resource you requested. Please refer to the documentation for the list of resources. |
| 許可されないメソッド (METHOD NOT ALLOWED) | 405 | This method type is not currently supported. |
| 受け入れ不可 (NOT ACCEPTABLE) | 406 | Acceptance header is invalid for this endpoint resource. |
| プロキシー認証が必要 (PROXY AUTHENTICATION REQUIRED) | 407 | Authentication with proxy is required. |
| 要求タイムアウト (REQUEST TIMEOUT) | 408 | Client did not produce a request within the time that the server was prepared to wait. |
| 競合 (CONFLICT) | 409 | The request could not be completed due to a conflict with the current state of the resource. |
| 消失 (GONE) | 410 | The requested resource is no longer available and has been permanently removed. |
| 長さが必要 (LENGTH REQUIRED) | 411 | Length of the content is required, please include it with the request. |
| 前提条件の失敗 (PRECONDITION FAILED) | 412 | The request did not match the pre-conditions of the requested resource. |
| 要求エンティティーの大きさ超過 (REQUEST ENTITY TOO LARGE) | 413 | The request entity is larger than the server is willing or able to process. |
| 要求 URI の長さ超過 (REQUEST-URI TOO LONG) | 414 | The request URI is longer than the server is willing to interpret. |
| サポートされないメディア・タイプ (UNSUPPORTED MEDIA TYPE) | 415 | The requested resource does not support the media type provided. |
| 要求された範囲が不適切 (REQUESTED RANGE NOT SATISFIABLE) | 416 | The requested range for the resource is not available. |
| 期待の失敗 (EXPECTATION FAILED) | 417 | Unable to meet the expectation given in the Expect request header. |
| 引数の欠落 (MISSING ARGUMENTS) | 419 | The requested resource is missing required arguments. |
| 無効な引数 (INVALID ARGUMENTS) | 420 | The requested resource does not support one or more of the given parameters. |
| 処理できないエンティティー (UNPROCESSABLE ENTITY) | 422 | The request was well-formed but was unable to be followed due to semantic errors. |
| 内部サーバー・エラー | 500 | Unexpected internal server error. |
| 未実装 | 501 | The requested resource is recognized but not implemented. |
| 誤ったゲートウェイ (BAD GATEWAY) | 502 | Invalid response received when acting as a proxy or gateway. |
| サービス使用不可 (SERVICE UNAVAILABLE) | 503 | The server is currently unavailable. |
| ゲートウェイ・タイムアウト (GATEWAY TIMEOUT) | 504 | Did not receive a timely response from upstream server while acting as a gateway or proxy. |
| サポートされない HTTP バージョン (HTTP VERSION NOT SUPPORTED) | 505 | The HTTP protocol version used in the request message is not supported. |
| 初期化失敗 | 550 | A failure occurred during initialization of services. API will be unavailable. |