Sign Up

Log In

Text-Processing

FREEMIUM
By japerk
Updated 2 months ago
Other
9.5/10
Popularity Score
293ms
Latency
34%
Success Rate
Massblurb4 years ago
Sentiment AnalysisHi, This is Tushar I'm sending the following request from my php code $response = Unirest\Request::post("https://japerk-text-processing.p.mashape.com/sentiment/", array( "X-Mashape-Key" => <My key>, "Content-Type" => "application/x-www-form-urlencoded", "Accept" => "application/json" ), array( "language" => "english", "text" => "great movie" ) ); and getting the code 400 (Form Validation Errors text: This field is required.) in response. Can you please help?
Massblurb4 years ago
Hi, Could not use the traditional php request at that time so had resolved the problem by using a curl request as follows - $response = exec("curl -X POST --include 'https://japerk-text-processing.p.mashape.com/sentiment/' \ -H 'X-Mashape-Key: \' \ -H 'Content-Type: application/x-www-form-urlencoded' \ -H 'Accept: application/json' \ -d 'language=english' \ -d 'text=". $tweet ."'");
japerk4 years ago
I'm not familiar with PHP or the PHP Unirest API, but it looks like the second array is not being sent as the POST data. Maybe it needs to be sent as another parameter or argument.
Hi Developer, feel free to post your answer:
Log inSign up

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://japerk-text-processing.p.rapidapi.com/phrases/")
.header("X-RapidAPI-Host", "undefined")
.header("X-RapidAPI-Key", "undefined")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("language=undefined")
.send("text=<required>")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
});
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication

Sign up for free

to test this endpoint

Join the world’s largest API marketplace with over half a million developers and thousands of APIs.
DiscoverAPIs
Testfrom the browser
Connectusing code snippets
Managefrom one dashboard