Messages d'erreur d'API
Lorsqu'une demande d'API échoue en raison d'erreurs de demande ou d'erreurs de serveur, un message de réponse d'erreur est renvoyé au format JSON.
Un message de réponse d'erreur est renvoyé au format JSON même pour les noeuds finaux qui prennent en charge d'autres types MIME. Le message de réponse d'erreur comprend le message d'erreur lui-même, une description de l'erreur, un code d'erreur unique pour le point final, un message de réponse HTTP et un code de réponse HTTP.
La réponse d'erreur inclut les zones suivantes:
- message: message d'erreur
- details: zone pour des informations supplémentaires, qui peuvent ou non être renseignées
- description: description de l'erreur spécifique
- code: code de réponse d'erreur unique
- http_response:
- messagemessage de réponse : HTTP message de réponse
- code HTTP code d'état de la réponse
Par exemple, la demande d'API suivante tente d'obtenir des informations sur un ensemble de références inexistant appelé "test-set":
https://<host_ip>/api/reference_data/sets/test_set
Un HTTP404Le code de réponse et le message de réponse d'erreur JSON suivant sont renvoyés:
{
"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
}
}
Le tableau suivant fournit plus d'informations sur les catégories d'erreurs de réponse HTTP renvoyées par l'API IBM® QRadar® REST :
| HTTP catégorie d'erreur | Code de réponse HTTP | HTTP message de réponse |
|---|---|---|
| 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. |
| Trouvé | 302 | The resource has moved temporarily. Please refer to the documentation. |
| Voir autres | 303 | The resource can be found under a different URI. |
| Not Modified | 304 | The resource is available and not modified. |
| Utiliser le proxy | 305 | The requested resource must be accessed through the proxy given by the Location field. |
| Redirection temporaire | 307 | The resource resides temporarily under a different URI. |
| Demande incorrecte | 400 | Invalid syntax for this request was provided. |
| Non autorisé | 401 | You are unauthorized to access the requested resource. Please log in. |
| Interdit | 403 | Your account is not authorized to access the requested resource. |
| Introuvable | 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. |
| Inacceptable | 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. |
| Conflit | 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. |
| Longueur requise | 411 | Length of the content is required, please include it with the request. |
| Echec de précondition | 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 de demande trop long | 414 | The request URI is longer than the server is willing to interpret. |
| Type de support non pris en charge | 415 | The requested resource does not support the media type provided. |
| Plage demandée non satisfaisante | 416 | The requested range for the resource is not available. |
| Expectation Failed | 417 | Unable to meet the expectation given in the Expect request header. |
| ARGUMENTS MANQUANTS | 419 | The requested resource is missing required arguments. |
| ARGUMENTS NON VALIDES | 420 | The requested resource does not support one or more of the given parameters. |
| Entité intraitable | 422 | The request was well-formed but was unable to be followed due to semantic errors. |
| Erreur de serveur interne | 500 | Unexpected internal server error. |
| Not Implemented | 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. |
| Version HTTP non prise en charge | 505 | The HTTP protocol version used in the request message is not supported. |
| Echec d'initialisation | 550 | A failure occurred during initialization of services. API will be unavailable. |