Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ivr-api

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ivr-api

A library to lookup IVR records recursively to produce an aggregated result.

  • 2.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

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));
});

FAQs

Package last updated on 19 Apr 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc