Installation
Requires Go 1.21 or later. Add the SDK withgo get:
Quick start
Place an outbound call. When the call connects, Vobiz pings yourAnswerURL endpoint, and you must respond with a VobizXML payload.
Authentication
The Go client requires your Auth ID and Auth Token. Find both in the Vobiz Console. Useoption.WithAPIKey for your Auth ID (mapped to the X-Auth-ID header) and option.WithAuthToken for your Auth Token (mapped to X-Auth-Token):
VobizXML
When Vobiz calls yourAnswerURL, your handler must respond with a VobizXML document that defines the call flow. The SDK ships a typed builder in the github.com/vobiz-ai/Vobiz-Go-SDK/vobizxml subpackage — each Add* returns the created child for nesting, and vobizxml.Attr(key, value) sets attributes in order:
Prefer the builder, but you can also return a raw VobizXML string if you like. See the VobizXML reference for all verbs and attributes.
Common operations
Retrieve account balance
List Call Detail Records (CDRs)
Create a SIP trunk
Error handling
The SDK returns a standard Goerror for any non-2xx response. Always check err before using the response: