Installation
Requires Ruby >= 3.3.0. The SDK is distributed from its GitHub repo (not RubyGems). Clone it, then reference it by path in yourGemfile:
bundle install.
Quick start
Place an outbound call. When the call connects, Vobiz queries youranswer_url webhook, which must return a valid VobizXML document.
Authentication
The Ruby client uses your Auth ID and Auth Token. Find both in the Vobiz Console. Pass your Auth ID asapi_key (mapped to the X-Auth-ID header) and your Auth Token as auth_token (mapped to X-Auth-Token). It is recommended to load credentials from environment variables:
auth_id as a parameter:
VobizXML
When Vobiz calls youranswer_url, your webhook must respond with a VobizXML document that defines the call flow. The gem ships a builder at Vobiz::XML (require "vobiz/xml") - each add_* returns the created child for nesting, and keyword args map to VobizXML attributes:
Prefer the builder, but returning a raw VobizXML string also works. See the VobizXML reference for all verbs and attributes.
Common operations
Live call text-to-speech
Recordings
DID phone management
Error handling
The SDK raises a subclass ofVobiz::Errors::ResponseError for any non-2xx response, for example Vobiz::Errors::UnauthorizedError for a 401. Inspect the exception for the status code and raw body:
Messaging (SMS, MMS and RCS)
The Ruby SDK includes the full Vobiz Messaging API underclient.sms. Send a message with the client you created above:
client.sms.messages.preview_message_cost and client.sms.numbers.list_numbers. See Messaging in the SDKs for the full method list and error handling; each Messaging API reference page shows a complete Ruby example.