New REST

Calais’s latest release of an improved REST interface is the simplest and fastest way to submit your documents. Here’s how you can invoke request with this API.

  • Web service URL for improved REST API is located at http://api.opencalais.com/tag/rs/enrich
  • Clients should create an HTTP POST request.
  • Document content should be passed as the body of the HTTP request.
  • Submitted content should be UTF-8 encoded.
  • Your Calais license, different processing and user options are specified as HTTP headers (key-value pairs) of the request. Following headers are mandatory:
    • x-calais-licenseID: value of this header is your license key
    • content-type: value of this parameter is the content type of submitted content, whether its text/raw, text/html, etc., as documented here
    • accept or outputformat: possible values are the expected MIME types of response, e.g. xml/rdf, application/json, etc., as documented here
  • Specification of all other processing and user options is optional.

Sample Java code is here.

AttachmentSize
RESTClient.java_.txt5.35 KB