Skip to content

Latest commit

 

History

History
45 lines (40 loc) · 1.03 KB

README.md

File metadata and controls

45 lines (40 loc) · 1.03 KB

BannerApi-npm

Installation

npm install banner-api

Usage

To get an instance of the API use:

var banner-api = require('banner-api')
banner-api.create("schoolCode","UserId","Pass",callback)

The passed in callback function will be called with the apiInstance once it is loaded

An apiInstance has a field apiEndpoints that is an array of apiEndpoints

An apiEndpoint has

  • A method call(callback) with the returned data from the endpoint being passed to the callback function in the format:
{
	name:EndpointName String,
	data:EndpointData Dictionary
}
  • Fields
    • apiType
    • apiName
    • urlName

For example to call and output data from all endpoints

var banner-api = require('banner-api')
banner-api.create("schoolCode","UserId","Pass", function(api) {
	for(x in api.apiEndpoints){
		var endpoint = api.apiEndpoints[x]
		endpoint.call(function(data) {
			console.log(data['name'] + '')
			console.log(data['data'])
		})
	}
})

Known School Codes

  • Wilfrid Laurier University - 757