Mensagens de erro da API

Quando uma solicitação de API falha devido a erros de solicitação ou erros do servidor, uma mensagem de resposta de erro é retornada no formato JSON.

Uma mensagem de resposta de erro é retornada no formato JSON mesmo para os endpoints que suportam outros tipos MIME. A mensagem de resposta de erro inclui a própria mensagem de erro, uma descrição do erro, um código de erro exclusivo para o endpoint, uma mensagem de resposta HTTP e um código de resposta HTTP.

A resposta de erro inclui os campos a seguir:

  • message: a mensagem de erro
  • details: um campo para informações adicionais, que pode ou não ser preenchido
  • description: descrição do erro específico
  • code: código de resposta de erro exclusivo
  • http_response:
    • message: mensagem de resposta HTTP
    • code: código de status de resposta HTTP

Por exemplo, a solicitação de API a seguir tenta obter informações sobre um conjunto de referência não existente chamado "test-set"

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

Um HTTP404código de resposta e a mensagem de resposta de erro JSON a seguir são retornados:

{
  "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
   }
}

A tabela a seguir fornece mais informações sobre as categorias de erro da resposta HTTP retornadas pela IBM® QRadar® REST API:

Categoria de erro HTTP Código de resposta HTTP Mensagem de resposta HTTP
OPÇÕES MÚLTIPLAS 300 The requested resource corresponds to any one of a set of representations, each with its own specific location.
MOVIDO PERMANENTEMENTE 301 The resource has moved permanently. Please refer to the documentation.
PERDIDO 302 The resource has moved temporarily. Please refer to the documentation.
CONSULTE OUTRO 303 The resource can be found under a different URI.
NÃO MODIFICADO 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.
REDIRECIONAMENTO TEMPORÁRIO 307 The resource resides temporarily under a different URI.
SOLICITAÇÃO INVÁLIDA 400 Invalid syntax for this request was provided.
DESAUTORIZADO 401 You are unauthorized to access the requested resource. Please log in.
PROIBIDO 403 Your account is not authorized to access the requested resource.
NÃO LOCALIZADO 404 We could not find the resource you requested. Please refer to the documentation for the list of resources.
MÉTODO NÃO PERMITIDO 405 This method type is not currently supported.
NÃO ACEITÁVEL 406 Acceptance header is invalid for this endpoint resource.
AUTENTICAÇÃO DE PROXY OBRIGATÓRIA 407 Authentication with proxy is required.
TEMPO LIMITE DE SOLICITAÇÃO 408 Client did not produce a request within the time that the server was prepared to wait.
CONFLITO 409 The request could not be completed due to a conflict with the current state of the resource.
REMOVIDO 410 The requested resource is no longer available and has been permanently removed.
COMPRIMENTO OBRIGATÓRIO 411 Length of the content is required, please include it with the request.
FALHA DE CONDIÇÃO PRÉVIA 412 The request did not match the pre-conditions of the requested resource.
ENTIDADE DE SOLICITAÇÃO MUITO GRANDE 413 The request entity is larger than the server is willing or able to process.
URI DE SOLICITAÇÃO MUITO LONGO 414 The request URI is longer than the server is willing to interpret.
TIPO DE MÍDIA NÃO SUPORTADO 415 The requested resource does not support the media type provided.
INTERVALO SOLICITADO NÃO SATISFATÓRIO 416 The requested range for the resource is not available.
FALHA DE EXPECTATIVA 417 Unable to meet the expectation given in the Expect request header.
ARGUMENTOS AUSENTES 419 The requested resource is missing required arguments.
ARGUMENTOS INVÁLIDOS 420 The requested resource does not support one or more of the given parameters.
ENTIDADE NÃO PROCESSÁVEL 422 The request was well-formed but was unable to be followed due to semantic errors.
ERRO INTERNO DO SERVIDOR 500 Unexpected internal server error.
NÃO IMPLEMENTADO 501 The requested resource is recognized but not implemented.
GATEWAY INVÁLIDO 502 Invalid response received when acting as a proxy or gateway.
SERVIÇO INDISPONÍVEL 503 The server is currently unavailable.
TEMPO LIMITE DE GATEWAY 504 Did not receive a timely response from upstream server while acting as a gateway or proxy.
VERSÃO DE HTTP NÃO SUPORTADA 505 The HTTP protocol version used in the request message is not supported.
FALHA NA INICIALIZAÇÃO 550 A failure occurred during initialization of services. API will be unavailable.