I have deployed watson-developer-cloud/personality-insights-python module in to bluemix and created an APP in Bluemix. The link for my app is running absolutely fine. However, when I want to invoke /v2/profile api, with a post request I am getting an error. Here is the code I used in Python.
import requests, json
payload = {'id': 'my-id',
'userid': 'id-here',
'sourceid' : 'twitter',
'contenttype' : 'text/plain',
'language' : 'en',
'content' : 'text to analyse goes here'
}
input_data=json.dumps(payload);
r = requests.post("http://MY-APP.mybluemix.net/v2",
auth=("USERNAME", "PASSWORD"),
headers = {"content-type": "application/json"},
data=input_data)
print(r.content)
I keep getting this error.
b'{"help": "http://www.ibm.com/smarterplanet/us/en/ibmwatson/developercloud/doc/personality-insights/#overviewInput", "error": "The number of words 1 is less than the minimum number of words required for analysis: 100", "code": 400}'
If I change the url with out V2, then we are getting this error
b'{"code": 400, "error": "No text provided"}'