rdgkb-json
v0.9.1
Published
JSON Interface for the RDG Knowledgebase APIs. To access the API's you will require a valid username and password.
Downloads
4
Maintainers
Readme
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 = "[email protected]"; // 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);
});
}
});