ivr-api
An API for retrieving IVR menu data using the NUM Protocol.
Installation For Local Testing
git clone git@github.com:NUMtechnology/ivr-api.git
npm install
webpack
- Open
test/index.html
in your browser.
Installation For Use In An Application
Simple Application Usage
import { createIVRApi } from 'ivr-api';
const api = createIVRApi();
api.lookupPhoneNumber('+448000683827').then((result) => {
console.log(JSON.stringify(result));
});
Controlling the Recursion Levels
import { createIVRApi, IVRApiOptions } from 'ivr-api';
const api = createIVRApi();
const options = new IVRApiOptions(
2
);
api.lookupPhoneNumber('+448000683827', options).then((result) => {
console.log(JSON.stringify(result));
});
Supplying an Existing NUMClient Object
If you already have a NUMClient object you can re-use it.
import { createClient } from 'num-client';
import { createIVRApi } from 'ivr-api';
const existingClient = createClient();
const api = createIVRApi(existingClient);
api.lookupPhoneNumber('+448000683827').then((result) => {
console.log(JSON.stringify(result));
});