Text Analysis

GRATIS
Door Bhavya Gaur | Bijgewerkt 4 days ago | Text Analysis
Populariteit

9.8 / 10

Latency

380ms

Serviceniveau

100%

Health Check

N/A

Terug naar alle discussies

"validation error, incorrect data passed to the server"

Rapid account: Discoverearth
discoverearth
2 years ago

I’ve used the sample parameters for summarize-text, but I get the error in the title:

var options = {
method: ‘POST’,
url: ‘https://text-analysis12.p.rapidapi.com/summarize-text/api/v1.1’,
headers: {
‘content-type’: ‘application/json’,
‘x-rapidapi-host’: ‘text-analysis12.p.rapidapi.com’,
‘x-rapidapi-key’: ‘…’
},
data: {
language: ‘english’,
summary_percent: 10,
text: 'I believe that it is fundamental to have an overview of the history the…"

Rapid account: Daivalin HY Lb 2 ZTM XF
daivalin-HYLb2ZTM_XF Commented 2 years ago

Use Array first and then convert it into json like below:

$post_fields = array (
‘language’ => ‘english’,
‘text’ => validated[inputtext]);validated['input_text']); post_fields = json_encode($post_fields);

It works for me.

Rapid account: Gaurmanojkumar 530
gaurmanojkumar530 Commented 2 years ago

I can also send you the postman snapshot if you like.

Rapid account: Gaurmanojkumar 530
gaurmanojkumar530 Commented 2 years ago

I understood the issue. Your body type is set to “Body type: x_www_form_urlencoded” this is incorrect.
Summarize text endpoint consumes JSON body.
I have no idea about how Integromat works but you need to pass JSON contents in the body.
Your headers must also contain “content-type”: “application/json”

Rapid account: Discoverearth
discoverearth Commented 2 years ago

Everything works in the RapidAPI console.

But in the environment I’m using (HTTP 'Make a request module in Integromat)

  • extract-text-from-files works.
  • But summarize-text gives the “validation error, incorrect data passed to the server” error.

These are the screenshots from the module. This may be outside of your expertise, but still Integromat is very popular… do you have any ideas on why this error is happening…?

The (Long String) is the sample text, copied and pasted from the summarize-text code snippet.
and

Rapid account: Gaurmanojkumar 530
gaurmanojkumar530 Commented 2 years ago

Could you describe your problem in more detail?
And also provide the source code.

Did you get this error while trying out in the RapidAPI console?
If yes simply refresh your browser and try again.

If you got this error while using nodejs or any other language/framework.
Prefer to use Postman’s auto-code generation (RapidAPI’s auto-code generation doesn’t
always work correctly)

If you have any more queries please feel free to ask them.
(But please create a new comment instead of replying here so
that I get notified. RapidAPI only notifies me of root comments)

Doe mee aan de discussie - voeg hieronder een opmerking toe

Log in / Schrij u in om nieuwe opmerkingen te plaatsen