If you use JavaScript to send the content and use ‘escape(myContent)’ function to escape the content, you will need to change it to: ‘encodeURIComponent(myContent)’
For example:
var clfsws = new XMLHttpRequest();
clfsws.open("POST", "http://api.opencalais.com/enlighten/rest/", true);
clfsws.onreadystatechange = function() { _this.swsStateChangeCallback(); };
clfsws.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
clfsws.setRequestHeader('User-Agent', 'My very very smart user agent');
clfsws.send("licenseID=thisismylicenseid&content=" + encodeURIComponent(content) + '¶msXML=' + encodeURIComponent('<c:params xmlns:c="http://s.opencalais.com/1/pred/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><c:processingDirectives c:contentType="text/txt" c:outputFormat="text/gnosis" c:discardMetadata=";"></c:processingDirectives><c:userDirectives c:allowDistribution="true" c:allowSearch="true" c:externalID="calaisbridge" c:submitter="calaisbridge"></c:userDirectives><c:externalMetadata c:caller="GnosisFirefox"/></c:params>'));
} catch (ex) {
if (getShowAlert())
alert(gnosis.stringsBundle.getString('errorSending'));
dump(ex);
}

Hi, I have written the following code to access the openCalais API through jQuery. The request works find and I can see the results in Firebug, but am unable to access the data returned. the code is as follows:
baseUrl = "http://api.opencalais.com/enlighten/rest/";
licenseID = "abcdefg12345";
content = "went snoboarding with my friend in whistler.....blah blah blah";
paramsXml = '';
var completeReqUrl = baseUrl + "?licenseID=" + licenseID + "&content=" + content + "¶msXML=" + encodeURIComponent(paramsXml);
var postData = "licenseID=" + licenseID + "&content=" + content + "¶msXML=" + encodeURIComponent(paramsXml);
var req = $.ajax(
{
url: completeReqUrl ,
type: "GET",
dataType: "script",
success: function(data, statux, xhr)
{
console.log(data);
console.log(status);
console.log(xhr);
},
error: function(error, status)
{
console.log(error);
console.log(status);
}
});
the success callback never fires, and neither does the error callback. any ideas?
Hi, I'm trying to call the OpenCalais API using jQuery's Ajax plugin. The code is similar to the below: $.ajax({ type:"GET", data:"licenseID=etc&content=etc,paramsXML=etc", success:function(result) { document.write(result); } }); The data is properly encoded and I have a valid license key but every time I try this out I receive a "Mashery" error code something along the lines of "ERR_569_SERVICE_NOT_FOUND" when debugging any calls form the page. I have also tried the simplest way of doing this using "var etc = new XMLHttpRequest();" and setting up like one of the FAQs here explained but still receive the same problem. Using an actual form and pressing submit works fine. Has anyone used Ajax to call the API before? Or even has a working example? The above returns that error message for me. Thanks, Dan"http://api.opencalais.com/enlighten/rest/" is not working, but "http://api1.opencalais.com/enlighten/rest/" is ok !