Skip to content


Folders and files

Last commit message
Last commit date

Latest commit



41 Commits

Repository files navigation


This Node.js library is an open source tool built to simplify interaction with the Avaya CPaaS telephony platform. Avaya CPaaS makes adding voice and SMS to applications fun and easy.

For more information about Avaya CPaaS, please visit: Avaya OneCloud™️ CPaaS

To read the official documentation visit Avaya CPaaS Docs


$ npm install @avaya/cpaas



See the Avaya CPaaS REST API documentation for more information.

Normally you'll want to just set your Avaya CPaaS Platform AccountSid and AuthToken in config object. But you can also change the base API URL. The default value of base API URL is "".

The base API URL and api versions for US(new) and EU deployments are: US: EU:

Set Base URL and API Version Example

To change base url to EU deployment

    const defaultConfiguration = {
        accountSid: {AccountSid},
        authToken: {AuthToken},
        baseUrl: ''

Send SMS Example

var cpaas = require('@avaya/cpaas');
var enums = cpaas.enums;

var connector = new cpaas.SmsConnector({
    accountSid: '{AccountSid}',
    authToken: '{AuthToken}'

//send sms message
    to: '+123456',
    from: '+654321',
    body: 'Hello from Avaya CPaaS!',
    statusCallback: '',
    statusCallbackMethod: enums.HttpMethod.GET,
    allowMultiple: true
}).then(function (data) {


First a configuration must be defined by specifying your Avaya CPaaS credentials. This configuration is passed to cpaas.Connectors from which you can then access all of the specific connectors:

var cpaas = require('@avaya/cpaas');
var connectors = new cpaas.Connectors({
    accountSid: '{AccountSid}',
    authToken: '{AuthToken}'
var smsConnector = connectors.sms;
var conferencesConnector = connectors.conferences;

Alternatively you can instantiate a single connector directly like this:

var cpaas = require('@avaya/cpaas');
var callsConnector = new cpaas.CallsConnector({
    accountSid: '{AccountSid}',
    authToken: '{AuthToken}'

All of the REST API requests are implemented as promises:

    /* makeCall parameters */
}).then(function(result) { 
    /* do something with result */
    /* handle errors */

Request parameters

Request parameters are passed as parameters to connector object methods as shown previously. All of the connector methods have an optional parameter called accountSid which you can specify per request. If not specified, the accountSid defined in the configuration is used automatically.

var cpaas = require('@avaya/cpaas');
var usagesConnector = new cpaas.UsagesConnector({
    accountSid: '{AccountSid}',
    authToken: '{AuthToken}'
//explicit accountSid
var usage = usagesConnector.viewUsage({
    accountSid: '{ExplicitAccountSid}',
    usageSid: '{UsageSid}'

//accountSid from configuration used automatically
var usage = usagesConnector.viewUsage({
    usageSid: '{UsageSid}'

Response data

Visit the Avaya CPaaS Docs page for more information about the returned data.


InboundXML is an XML dialect which enables you to control phone call flow. For more information please visit the Avaya CPaaS InboundXML documentation.

This library helps you generate InboundXML with a set of functions located under cpaas.inboundXml. Valid InboundXML documents have only one <Response> element at the root level and the rest of the instructions are contained inside.

InboundXML is generated by calling, which returns a promise, on an XML definition object creating by using the other methods. The generated XML is automatically checked against a schema. The schema checking will be done only if the libxml-xsd library is present (included as an optional dependency).

<Say> Example
var cpaas = require('@avaya/cpaas');
var ix = cpaas.inboundXml;
var enums = cpaas.enums;

var xmlDefinition = ix.response({content: [
        language: enums.Language.EN,
        loop: 3,
        text: 'Welcome to Avaya CPaaS!',
        voice: enums.Voice.FEMALE
    console.log('The generated XML is not valid!', err);

will render

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Say loop="3" voice="female" language="en">Welcome to Avaya CPaaS!</Say>


No description, website, or topics provided.







No releases published


No packages published