This repo contains the code to use Watson conversation, tone analyzer, and language translation APIs. Please refer to youtube tutorials for full explanation of the code to use Watson APIs.
Before you get started, you'll need a couple things.
-
Free IBM Cloud Account, to create Watson Service Credentials (Username and Passwords used to authenticate your API call)
-
NPM (Node package Manager)
-
Login to IBM Cloud Dashboard
- Create your credentials for the service you want to use (Language Translator and Tone Analyzer for this tutorial).
- Add your credentials by modifiying the 'Username and Password' variables at the top of either translate.js or tones.js based on which API you want to use.
If you cloned the repository, to install all the required npm packages, run:
npm install
Otherwise, run:
npm install request
and then:
npm install http
To see the output for the Language Translator API, add the credentials and run:
node translate.js
To see the output for the Tone Analyzer API, add the credentials and run:
node tones.js
- If you get an error such as 'Error: Cannot find module 'request' simply run:
npm install request
- If you get an error such as 'Error: Cannot find module 'http' simply run:
npm install http
- If you get 404 error, usually the credentials are wrong. Check your credentials first, and if that doesn't work, try deleting the instance and then re-creating it.