Sentiment Analysis

FREEMIUM
Verified
By Twinword API | Updated il y a 8 jours | Text Analysis
Popularity

9.6 / 10

Latency

227ms

Service Level

100%

Health Check

N/A

Back to All Discussions

Keep getting {'result_code': '415', 'result_msg': 'Does not look like a valid request'}

Rapid account: Mansi 9931
mansi9931
il y a 4 ans

Hi, here is my python code:
body = “text=” + text
url = “https://api.twinword.com/api/v4/sentiment/analyze/

headers = {
“Content-Type” : “application/json”,
“Host” : app_config.AWS_PRO_API_HOST,
“X-Twaip-Key” : app_config.AWS_PRO_SUBSCRIPTION_KEY
}

response = requests.request(“POST”, url, data=body, headers=headers)

response = json.loads(response.text)

This gives me the error: {‘result_code’: ‘415’, ‘result_msg’: ‘Does not look like a valid request’}

I am not using “params=body” as I have a long body of text to analyse so I get error 414 (too long URL)

Twinword, in an email, told me that I can send text within 75,000 characters. So how do I resolve this?

Rapid account: Twinword
twinword Commented il y a 4 ans

Hi Mansi9931, thank you for using Twinword API! Unfortunately, we can’t help you with coding issues. However, in case you haven’t noticed, RapidAPI provides you with a code input sample that might be helpful. Please check the code snippet box at the bottom right, under the ‘Endpoints’ tab. You can choose the code type accordingly.

I hope this helps!

Best,
Team Twinword

Join in the discussion - add comment below:

Login / Signup to post new comments