callable-data-objects
TypeScript icon, indicating that this package has built-in type declarations

0.2.50 • Public • Published

Callable Management API

Getting Started

const url = "https://api-dev.control.callable.io";
const apiToken = "1234" //retrieved via oauth
const api = new CallableAPI(url, apiToken);

User

const { user } = api;

//Get logged in user
const me = user.me();

Managing Accounts

const { account } = api;

//List Accounts
const accounts = await account.list();

const acc = accounts.get(0);

//List DDIs
const ddis = await account.ddi(acc.id).list();

//List Trunks
const trunks = await account.trunk(acc.id).list();

//List Devices
const devices = await account.device(acc.id).list();

Validation

We use yup for validation

const newDevice = new Device({
    name: "test",
    extension: "100",
    type: "ROUTE_START",
    routeStart: {
        ...
    }
})

//Check if valid
newDevice.isValid();

// Or validate
newDevice.validate();

Readme

Keywords

none

Package Sidebar

Install

npm i callable-data-objects

Weekly Downloads

2

Version

0.2.50

License

ISC

Unpacked Size

2.55 MB

Total Files

560

Last publish

Collaborators

  • ajukes