Have searched, but can't find similar issues in the past year. I'm trying to follow this tutorial, but things seem to have changed since it was published in April. I've got the PubNub Modules built and have registered a Bluemix Watson account and set up a Natural Language Understanding Service.
It when I try to run the test package in PubNub, I receive the error:
23:24:12 js:
[" TypeError: Cannot read property 'type' of undefined at Sentiment/IBM Watson.js:46:43 at process._tickCallback (internal/process/next_tick.js:109:7)"] Error at Sentiment/IBM Watson.js:76:21 at process._tickCallback (internal/process/next_tick.js:109:7)
23:24:13 js:
{ "body": "{ \"status\": \"ERROR\", \"statusInfo\": \"invalid-api-key\", \"usage\": \"By accessing AlchemyAPI or using information generated by AlchemyAPI, you are agreeing to be bound by the AlchemyAPI Terms of Use: http://www.alchemyapi.com/company/terms.html\", \"totalTransactions\": \"1\", \"language\": \"unknown\" }
The tutorial code for the api is this:
export default (request) => {
// url for sentiment analysis api
const apiUrl = 'https://gateway-a.watsonplatform.net/calls/text/TextGetTextSentiment';
// api key
const apiKey = 'Your_API_Key';
but it seems as the the API format for Bluemix has changed since the tutorial was written. The Bluemix credentials are now in the format:
{
"url": "https://gateway.watsonplatform.net/natural-language-understanding/api",
"username": "x",
"password": "y"
}
As someone who comes from using R as a statistical calculator and just programmed his first (primitive) battleship game in Python last week, any help much appreciated!
