Response handling

Response properties and examples.

The Content Analyzer API uses standard HTTP response codes to indicate whether a call is successful or not. A 200 code indicates success. A 202 code indicates that the file is accepted for processing. A 4xx code indicates errors that might be caused by clients input. A 5xx code indicates a server-related error. Only one document per API call is allowed. For more information about response codes, see Response Codes.

Table 1. Response properties
Property Data Type Description
code integer The status associated with the response.
messageId string Content Analyzer message code.
message string The status associated with the response.
analyzerId string The ID associated with the API call. It is used in the other requests later.
fileNameIn string Name of the uploaded file.
type array The type of file that is generated.
errorId string Content Analyzer error code.
explanation string Explanation for the error.
action string The action that is needed to correct the error.
Example of a successful response.
{
 "status": {
   "code": 202,
   "messageId": "CIWCA12001",
   "message": "Content Analyzer request was created"
 },
 "data": {
   "message": "json,pdf,utf8 processing request was created successful",
   "fileNameIn": "car.pdf",
   "analyzerId": "fe76c510-e2d8-11e8-9ee8-81a7944aa061",
   "type": [
     "json",
     "pdf",
     "utf8"
   ]
 }
}
Example of an error response.
{
  "status": {
    "code": 401,
    "messageId": "CIWCA14011",
    "message": "Authentication failed"
  },
  "errors": [
    {
      "errorId": "CIWCA16000",
      "explanation": "apiKey is undefined or invalid",
      "action": "Please provide a valid apiKey"
    }
  ]
}