Installation
Requires Go 1.21 or later. Rungo get inside a Go module. If your project has no go.mod yet, create one first:
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:
Messaging (SMS, MMS and RCS)
The Go SDK includes the full Vobiz Messaging API underclient.sms. Send a message with the client you created above:
client.Sms.Messages.PreviewMessageCost and client.Sms.Numbers.ListNumbers. See Messaging in the SDKs for the full method list and error handling; each Messaging API reference page shows a complete Go example.