HTTP Request and Response Examples

SOAP 1.1

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values. When calling the service, the content text must not be URL encoded.

POST /enlighten/calais.asmx HTTP/1.1
Host: api.opencalais.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://clearforest.com/Enlighten"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
 <Enlighten xmlns="http://clearforest.com/">
 <licenseID>string </licenseID>
 <content>string</content>
 <paramsXML>string </paramsXML>
 </Enlighten>
 </soap:Body>
</soap:Envelope>

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body>
 <EnlightenResponse xmlns="http://clearforest.com/">
 <EnlightenResult>string</EnlightenResult>
 </EnlightenResponse>
 </soap:Body>
</soap:Envelope>

Back to Top

SOAP 1.2

The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values. When calling the service, the content text must not be URL encoded.

POST /enlighten/calais.asmx HTTP/1.1
Host: api.opencalais.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<Enlighten xmlns="http://clearforest.com/">
<licenseID>string</licenseID>
<content>string</content>
<paramsXML>string</paramsXML>
</Enlighten>
</soap12:Body>
</soap12:Envelope>

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
<soap12:Body>
<EnlightenResponse xmlns="http://clearforest.com/">
<EnlightenResult>string</EnlightenResult>
</EnlightenResponse>
</soap12:Body>
</soap12:Envelope>

Back to Top

REST via HTTP POST

The following is a sample REST API call via HTTP POST request and response. The placeholders shown need to be replaced with actual values. Please note that the content sent using this method needs to be escaped. Please also note that all of the arguments sent using this method must be URL-encoded. 

POST /enlighten/rest HTTP/1.1
Host: api.opencalais.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

licenseID=string&content=string&/paramsXML=string
HTTP/1.1 200 OK
Content-Type: text/xml;charset=utf-8
Content-Length: length

string

To make POST requests to Open Calais using CURL, please refer to this post.

Back to Top

HTTP POST

The following is a sample HTTP POST request and response. The placeholders
shown need to be replaced with actual values. Please note that the content sent using this method needs to be escaped. Please note that paramsXML must be sent without HTTP encoding (escaping) and the input content must be URL encoded.

POST /enlighten/calais.asmx/Enlighten HTTP/1.1
Host: api.opencalais.com
Content-Type: application/x-www-form-urlencoded
Content-Length: length

licenseID=string&content=string&paramsXML=string

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://clearforest.com/">string</string>

Back to Top