ESA Semantic Relatedness

FREEMIUM
By amtera
Updated 5 months ago
Other
2.3/10
Popularity Score
59157ms
Latency
-
Success Rate
mrafiee5 years ago
ESA Semantic Relatedness not workingI am not able to get java API for ESA Semantic Relatedness work. I get the following error: {"description":"<p>The browser (or proxy) sent a request that this server could not understand.<\/p>"} Any help will be appreciated. Thanks., MR
amtera5 years ago
Glad to help you.
mrafiee5 years ago
Thanks for your response. I had actually copied and pasted the code from your java snippet. But thanks to your hint, I figured out the issue was the single quotes needed to be changed to double quotes in the json for it to work. Thanks!
amtera5 years ago
Hi, Seems the request is not well formed. First verify your json message with this tool http://jsonlint.com and make sure you're sending application/json in the Content-Type HTTP header. Let me know if you need further help. regards, Leonardo Souza
Hi Developer, feel free to post your answer:

Install SDK for NodeJS

Installing

To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

unirest.post("https://amtera.p.rapidapi.com/relatedness/en")
.header("X-RapidAPI-Host", "amtera.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/json")
.send({"t1":"car","t2":"engine"})
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication