GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - alonsov67/oauth2-nodejs: Node.js API example

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
LICENSE
LICENSE
 
 
README.md
README.md
 
 
index.html
index.html
 
 
integration.html
integration.html
 
 
package.json
package.json
 
 
server.js
server.js
 
 

Repository files navigation

Node.js example for IBM Watson Analytics

Set up your environment

  1. Download the Node.js installer from https://nodejs.org/en/download/. We built this sample using Node.js version 0.10.33.
  2. Install Node.js.

Get and register your keys

  1. Get your Watson Analytics API key (client id and secret) from https://developer.ibm.com/api/list.
  2. Register your client id and client secret. Use "http://localhost:5447/demo/oauth2/code" as your redirect URI. You only need to call this operation once unless the client ID changes. Use the following CURL command. Replace the details with your information.
curl -v -X PUT -H "X-IBM-Client-Secret:YOUR_CLIENT_SECRET" -H "X-IBM-Client-Id:YOUR_CLIENT_ID" -H "Content-Type: application/json" -d '{"clientName": "The Sample Outdoors Company", "redirectURIs": "https://example.com:5443", "ownerName": "John Smith", "ownerEmail": "[email protected]", "ownerCompany": "example.com", "ownerPhone": "555-123-4567"}' https://api.ibm.com/watsonanalytics/run/oauth2/v1/config

Create a .json file

  1. Create a file called appkey.json that matches the following template. Enter your client id and secret. Save it in the application folder.
	{
  		"client_id": "YOUR_CLIENT_ID",
  		"client_secret": "YOUR_CLIENT_SECRET"
	}

##Install and run the application 6. To install the application, type npm install at the command line. 7. To start the application, type npm start. 8. To run the application, open a web browser and navigate to this address: https://localhost:5447.

Notes

  • For clarity, this sample application uses localhost as part of the URL for the application. However, when you create your own application, do not use localhost.
  • This sample application is simplified to emphasize the code that you need to work with Watson Analytics. For example, it contains minimal error checking.

About

Node.js API example

Resources

Readme
MIT license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.