Mensajes de error de API

Cuando una solicitud de API falla debido a errores de solicitud o errores de servidor, se devuelve un mensaje de respuesta de error en formato JSON.

Se devuelve un mensaje de respuesta de error en formato JSON incluso para los puntos finales que dan soporte a otros tipos MIME. El mensaje de respuesta de error incluye el propio mensaje de error, una descripción del error, un código de error único para el endpoint, un mensaje de respuesta HTTP y un código de respuesta HTTP.

La respuesta de error incluye los campos siguientes:

  • message: el mensaje de error
  • details: un campo para información adicional, que puede o no rellenarse
  • description: descripción del error específico
  • code: código de respuesta de error exclusivo
  • http_response:
    • message: HTTP mensaje de respuesta
    • code: HTTP código de estado de la respuesta

Por ejemplo, la siguiente solicitud de API intenta obtener información sobre un conjunto de referencia no existente denominado "test-set":

https://<host_ip>/api/reference_data/sets/test_set

En HTTP404se devuelven el código de respuesta y el siguiente mensaje de respuesta de error 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
   }
}

La siguiente tabla proporciona más información sobre las categorías de error de respuesta HTTP devueltas por la IBM® QRadar® API REST:

HTTP categoría de error Código de respuesta HTTP HTTP mensaje de respuesta
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.
Encontrada 302 The resource has moved temporarily. Please refer to the documentation.
Ver otros 303 The resource can be found under a different URI.
Not Modified 304 The resource is available and not modified.
Utilizar proxy 305 The requested resource must be accessed through the proxy given by the Location field.
Redirección temporal 307 The resource resides temporarily under a different URI.
Bad Request 400 Invalid syntax for this request was provided.
No autorizado 401 You are unauthorized to access the requested resource. Please log in.
Prohibido 403 Your account is not authorized to access the requested resource.
NO SE HA ENCONTRADO 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.
No es aceptable 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.
Conflicto 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.
Longitud necesaria 411 Length of the content is required, please include it with the request.
Error de condición previa 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 solicitud demasiado largo 414 The request URI is longer than the server is willing to interpret.
Tipo de soporte no admitido 415 The requested resource does not support the media type provided.
Intervalo solicitado no satisfactorio 416 The requested range for the resource is not available.
Error de expectativa 417 Unable to meet the expectation given in the Expect request header.
FALTAN ARGUMENTOS 419 The requested resource is missing required arguments.
ARGUMENTOS NO VÁLIDOS 420 The requested resource does not support one or more of the given parameters.
Entidad no procesable 422 The request was well-formed but was unable to be followed due to semantic errors.
Error interno del servidor 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.
Versión de HTTP no soportada 505 The HTTP protocol version used in the request message is not supported.
ANOMALÍA DE INICIALIZACIÓN 550 A failure occurred during initialization of services. API will be unavailable.