Skip to content

A nodejs module that interfaces to the RDG Knowledgebase Static Datafeeds and returns the output in JSON

License

Notifications You must be signed in to change notification settings

magnatronus/rdgkb-json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RDG Knowledgebase APIs (rdgkb-json)

This is a node module that will interface to RDG's Knowledgebase static data API's, see the link below for more details

It is designed to deliver the XML data returned by the API in JSON format.

A compressed PDF for the various feed specs is available here

NB: This is pre-release software

Using the module

The first step is to install the module into your node project

  • npm install -s rdgkb-json

Then to test just do the following

/**
 * Simple example code for accessing the RDG incidents API
 * NB: You will need a valid username and password
 */
const RDGKnowledgebaseAPI = require('./index');
const username = "abc@123.a"; // put a valid username here
const password = "invalidpassword" // put a valid password here


// Create the API
const api = new RDGKnowledgebaseAPI(username, password);

// validate the credentials used
api.logon().then(result => {
  if(!result) {
    console.log(api.error);
  } else {
    api.callAPI(api.methods.INCIDENTS).then(data => {
      console.log(data);
    });
  }
});