Skip to content

API resources output

In case of success or managed errors, the API's REST interface resources return HTTPS status 200 OK and a response containing an UTF-8 encoded JSON object.

Success

Informative resources contexts and taxonomies have their specific output format, while all the document analysis and document classification resources share this response format:

{
    "success": true,
    "data": {
        "content": analyzed text,
        "language": language code,
        "version": technology version info,
        resource-specific output
    }
}

The Boolean property success indicates that processing was successful while the data object contains the results.

The data object has a similar structure for all the resources:

  • content is the analyzed text.
  • language is the ISO 639-1 language code.
  • version gives information about the technology for reporting purposes.

After these properties the resource-specific output follows.
For more information about the output of specific analysis and classification resources, refer to the following:

Managed errors

In case of a managed error, resources return a specific response.

Other errors

In case of unmanaged application errors or other anomalies, the API returns specific HTTP status codes.