I created a following shell-script:
curl -X POST -u "my username" \
"https://gateway-lon.watsonplatform.net/natural-language-understanding/api/blah-blah-blah..." \
--header "Content-Type: application/json" \
--data '{
"url": "http://.../screenplay.txt",
"features": {
"sentiment": {},
"categories": {},
"concepts": {},
"entities": {},
"keywords": {}
}
}'
Then it asked me "Enter host password for user", and I did.
Result: {"code":401, "error": "Unauthorized"}
I typed a password of an IBM account. Maybe I had to create another one just for API?
Please refer to the API Documentation - https://cloud.ibm.com/apidocs/natural-language-understanding#analyze-text
You will need a service API Key, which you can obtain from IBM Cloud. The getting started tutorial from the service documentation shows you how - https://console.bluemix.net/docs/services/natural-language-understanding/getting-started.html#getting-started-tutorial