2.0.0 • Published 2 years ago

ivr-api v2.0.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 years ago

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
  • cd ivr-api
  • npm install
  • Open test/index.html in your browser.

Installation For Use In An Application

  • npm install -s ivr-api

Simple Application Usage in TypeScript

import { createIVRApi } from 'ivr-api';

// Create an API instance
const api = createIVRApi();

// Use it to look up a phone number
api.lookupPhoneNumber('+448000683827').then((result) => {
  console.log(JSON.stringify(result));
});

Simple Application Usage in JavaScript

const ivrapi = require('ivr-api');

// Create an API instance
const api = ivrapi.createIVRApi();

// Use it to look up a phone number
api.lookupPhoneNumber('+448000683827').then((result) => {
  console.log(JSON.stringify(result));
});

Controlling the Recursion Levels in TypeScript

import { createIVRApi, IVRApiOptions } from 'ivr-api';

// Create an API instance
const api = createIVRApi();

const options = new IVRApiOptions(
    2// The number of levels for IVR records. 0 returns no data.
  );

// Use it to look up a phone number
api.lookupPhoneNumber('+448000683827', options).then((result) => {
  console.log(JSON.stringify(result));
});

Supplying an Existing NUMClient Object in TypeScript

If you already have a NUMClient object you can re-use it.

import { createClient } from 'num-client';
import { createIVRApi } from 'ivr-api';

// (from another part of your application)
const existingClient = createClient();

// Inject the existing client when creating the API instance
const api = createIVRApi(existingClient);

// Use it to look up a phone number
api.lookupPhoneNumber('+448000683827').then((result) => {
  console.log(JSON.stringify(result));
});
2.0.0

2 years ago

1.0.5

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

0.0.22

3 years ago

0.0.23

3 years ago

0.0.20

3 years ago

0.0.21

3 years ago

0.0.18

3 years ago

0.0.19

3 years ago

0.0.16

3 years ago

0.0.17

3 years ago

0.0.14

3 years ago

0.0.15

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago