Skip to content

Request format

The document analysis and the document classification capabilities of the Natural Language API are provided by REST resources. These resources must be requested with the HTTP POST method.
The applicable REST metaphor is that if you post your text to the resource the response will contain the analysis or classification results.

The text you post must be a JSON object with the following format:

    "document": {
        "text": "Your text here."

Document text must be encoded with UTF-8.
The Content-Type header of the request must be set to:

application/json; charset=utf-8