Skip to content


Repository files navigation


This golang package is an open source tool built to simplify interaction with the Avaya CPaaS telephony platform. Avaya OneCloud™️ 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, please visit: Avaya CPaaS Docs.


Clone the repo, and install via go get:

$ go get -u


Authorization ----In order to authorize against Avaya OneCloud™️ CPaaS services you'll have to define authentication credentials.

export ZANG_CLOUD_ACCOUNT_SID="{YourAccountSid}"
export ZANG_CLOUD_AUTH_TOKEN="{YourAccessToken}"

You can also change the base API url in /constants.go.

The default value is set as follows:

const (
// ZangApiUrl -
ZangApiUrl = ""
// ZangApiVersion -
ZangApiVersion = "v2"
// DefaultResponseContentType -
DefaultResponseContentType = "json"

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

For example, if you want to use EU deployments:

const (
// ZangApiUrl -
ZangApiUrl = ""
// ZangApiVersion -
ZangApiVersion = "v2"
// DefaultResponseContentType -
DefaultResponseContentType = "json"

Import ----

import (
    zang ""

Logging ----

In order to use the Avaya OneCloud CPaaS library, logging must be initialized:

package main
import (
    log ""
    zang ""
func init() {
    formatter := &log.TextFormatter{
        FullTimestamp: true,


See the Avaya CPaaS REST API documentation for more information.

NOTE: Please go through tests for specific endpoint to see the example

Send SMS Example

func sendsms() {
    client, err := zang.NewClient()
    if err != nil {
        log.Errorln("Client creation failed:", err)
    log.Debugln("Sending request")
    response, err := client.SendSms(map[string]string{
        "From": "E164 From",
        "To":   "E164 To",
        "Body": "Test Body,

 func main() {
    os.Setenv("ZANG_CLOUD_ACCOUNT_SID", "{YourAccountSid}")
    os.Setenv("ZANG_CLOUD_AUTH_TOKEN", "{YourAccessToken}")


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

<Say> Example

ixml, err := New(Response{Say: &Say{
  Voice: "female",
  Value: "Welcome to Avaya CPaaS!",
  Loop:  3,


will render

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


No releases published


No packages published