Text Analysis

חינם
על ידי Bhavya Gaur | מְעוּדכָּן לפני 6 חודשים | Text Analysis
פּוֹפּוּלָרִיוּת

9.8 / 10

חֶבִיוֹן

432ms

רמת שירות

100%

חזרה לכל הדיונים

"validation error, incorrect data passed to the server"

avatar
discoverearth
לפני 6 חודשים

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…"

avatar
gaurmanojkumar530 commented לפני 6 חודשים

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)

avatar
discoverearth commented לפני 6 חודשים

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

avatar
gaurmanojkumar530 commented לפני 6 חודשים

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”

avatar
gaurmanojkumar530 commented לפני 6 חודשים

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

avatar
daivalin-HYLb2ZTM_XF commented לפני 6 חודשים

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.

הצטרף לדיון - הוסף תגובה למטה:

התחבר / הירשם כדי לפרסם תגובות חדשות
דירוג: 1 - הצבעות: 1