Zang Cloud Golang API Helper
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
inboundxml
AUTHORS.rst
LICENSE
README.rst
accounts.go
accounts_test.go
applications.go
applications_test.go
calls.go
calls_test.go
carrier.go
carrier_test.go
client.go
client_test.go
common.go
conferences.go
conferences_test.go
config.go
constants.go
fraud.go
fraud_test.go
mms.go
mms_test.go
notifications.go
notifications_test.go
numbers.go
numbers_test.go
recordings.go
recordings_test.go
request.go
sip.go
sip_credentials.go
sip_credentials_test.go
sip_ipacl.go
sip_ipacl_test.go
sip_mappings.go
sip_mappings_test.go
sip_test.go
sms.go
sms_test.go
transcriptions.go
transcriptions_test.go
usage.go
usage_test.go
validation.go

README.rst

zang-go

This golang package is an open source tool built to simplify interaction with the Zang telephony platform. Zang Cloud makes adding voice and SMS to applications fun and easy.

For more information about Zang, please visit: Zang Cloud

To read the official documentation, please visit: Zang Docs.

Installation

Clone the repo, and install via go get:

$ go get -u github.com/zang-cloud/zang-go

Usage

Authorization

In order to authorize against Zang Cloud services you'll have to define authentication credentials.

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

REST

See the Zang REST API documentation for more information.

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

Send SMS Example

package example

import (
      "fmt"
      zang "github.com/zang-cloud/zang-go"
)

client, _ := zang.NewClient()

response, _ := client.SendSms(map[string]string{
  "From": "E.164 Number Format",
  "To":   "E.164 Number Format",
  "Body": "SMS Body",
})

fmt.Printf("Send sms response: %+v", response)

InboundXML

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 Zang!",
  Loop:  3,
}})

fmt.Print(ixml)

will render

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