Skip to main content
Part of the Twilio to Vobiz code snippets: each task shows the Twilio code and the equivalent Vobiz code in Python and Node - copy the Vobiz tab. The snippets use the client from Set up the client.
Set your credentials once: AUTH_ID is your Vobiz Auth ID (MA_…), AUTH_TOKEN is your Auth Token. In the Vobiz SDK, api_key is the Auth ID, and every account-scoped method takes that auth_id explicitly.

Answer a call with XML (TTS + menu)

The XML builder maps verb-for-verb: VoiceResponse() → ResponseElement(), and Gather keeps its name. On the builder, response.gather(...) → resp.add_gather(...), nested .say() → .add_speak(), and str(response) → resp.to_string(). Twilio’s input/timeout become Vobiz’s input_type/execution_timeout; num_digits carries over unchanged.
Vobiz emits the same document shape your TwiML app already returns - see the full verb table in TwiML → VobizXML, and validate the incoming request on your answer URL as shown in Webhooks.

Serve the answer URL (Flask / FastAPI / Express)

When Vobiz rings your number it fetches your answer_url over HTTP - return the VobizXML from any web framework, exactly as your Twilio voice URL returned TwiML. Just build the response with vobizxml instead of VoiceResponse, and send it as application/xml.
Building the XML is the only thing that changes - swap VoiceResponse()/str(resp) for vobizxml.ResponseElement()/resp.to_string() and keep the same route. The full verb map is in TwiML → VobizXML, and validating the signed request on this endpoint is covered in Webhooks.

More Twilio to Vobiz code snippets