The <Response> Element

The root element for all Vobiz XML documents. Every XML response must be wrapped in a single Response element.

Purpose

The Response element acts as the container for all XML verb elements that control call behavior. It tells Vobiz that the XML document contains valid call instructions and marks the beginning and end of your call flow logic.

Attributes

AttributeTypeRequiredDescription
The Response element has no attributes.

Nesting Rules

Allowed Child Elements

The Response element can contain the following verb elements:

  • <Speak>
  • <Play>
  • <Dial>
  • <Record>
  • <Gather>
  • <Hangup>
  • <Redirect>
  • <Wait>
  • <Conference>
  • <DTMF>
  • <PreAnswer>
  • <AudioStream>
  • <MultiPartyCall>

Parent Elements

The Response element has no parent - it is always the root element.

Important: Every XML document must have exactly one Response element. Multiple Response elements or missing Response elements will result in an XML parsing error.

Examples

Basic Usage

Simple Response with Speak
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Speak>Hello! This is a basic XML response.</Speak>
</Response>

Multiple Actions

Response with Multiple Verbs
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Speak>Thank you for calling Vobiz support.</Speak>
    <Play>https://yourcdn.com/hold-music.mp3</Play>
    <Dial>+14155551234</Dial>
</Response>

Verb elements are executed in the order they appear. In this example, Vobiz will first speak the message, then play the hold music, and finally dial the number.

IVR Flow

Response with Input Collection
<?xml version="1.0" encoding="UTF-8"?>
<Response>
    <Gather numDigits="1" timeout="10" action="https://yourapp.com/handle-input">
        <Speak>Press 1 for sales, press 2 for support.</Speak>
    </Gather>
    <Speak>We didn't receive your input. Goodbye!</Speak>
    <Hangup/>
</Response>

This response collects one digit from the user. If no input is received within 10 seconds, it speaks a goodbye message and hangs up.

Empty Response

Valid Empty Response
<?xml version="1.0" encoding="UTF-8"?>
<Response>
</Response>

An empty Response element is valid but doesn't perform any actions. The call will simply continue without any instructions. Typically, you'd use this for call events where no action is needed.

Best Practices

Always Include XML Declaration

Start your XML documents with <?xml version="1.0" encoding="UTF-8"?> to ensure proper parsing and character encoding.

Validate Your XML

Use an XML validator or linter during development to catch syntax errors before deploying to production. Malformed XML will cause call failures.

Set Proper Content-Type

When your application responds to Vobiz webhooks, set the HTTP Content-Type header to application/xml or text/xml.