Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vobiz.ai/llms.txt

Use this file to discover all available pages before exploring further.

Outbound 3-question DTMF survey with results API and CSV export. XML elements used: <Speak>, <Gather inputType=dtmf numDigits=1>, <Redirect>, <Hangup>

View on GitHub

Clone and run the full working example

Getting started

git clone https://github.com/vobiz-ai/Vobiz-Call-Survey-XML-Python.git
cd Vobiz-Call-Survey-XML-Python
cp .env.example .env
pip install -r requirements.txt
python server.py

Overview

Your system triggers an outbound survey call to a phone number. The caller answers three DTMF questions in sequence - rating (1–5), recommendation (yes/no), and overall experience (1–3). All responses are stored and exportable as CSV. You can also view aggregated stats via the API.

Call flow

Your system
  └── POST /surveys/trigger {"phone": "+91XXXXXXXXXX"}
        └── Vobiz outbound call triggered
              └── /answer  → Survey intro
                    └── /survey-q1  → "Rate our service: press 1 (poor) to 5 (excellent)"
                          └── /survey-q1-result  → Saves Q1 → routes to Q2
                                └── /survey-q2  → "Would you recommend us? Press 1=Yes, 2=No"
                                      └── /survey-q2-result  → Saves Q2 → routes to Q3
                                            └── /survey-q3  → "Overall experience: 1=Good, 2=Neutral, 3=Poor"
                                                  └── /survey-q3-result  → Saves Q3 → done
                                                        └── /survey-done  → "Thank you!" → Hangup

  └── GET /surveys/summary   → aggregated results
  └── GET /surveys/export.csv → download all responses

Vobiz webhooks

Set /answer as the Answer URL in your Vobiz application.
MethodPathDescription
POST/answerSurvey intro
POST/survey-q1Q1: rate service 1–5
POST/survey-q1-resultSaves Q1 → routes to Q2
POST/survey-q2Q2: recommend yes/no
POST/survey-q2-resultSaves Q2 → routes to Q3
POST/survey-q3Q3: overall experience
POST/survey-q3-resultSaves Q3 → routes to done
POST/survey-doneFinalizes survey, logs full result
POST/hangupCleanup

App API

MethodPathDescription
POST/surveys/triggerTrigger a survey call
GET/surveys/resultsList all completed responses
GET/surveys/results/{id}Single response detail
GET/surveys/export.csvDownload all results as CSV
GET/surveys/summaryAggregated stats

Environment variables

VariableRequiredDescription
VOBIZ_AUTH_IDYesVobiz account auth ID
VOBIZ_AUTH_TOKENYesVobiz account auth token
FROM_NUMBERYesYour Vobiz DID
HTTP_PORTNoServer port (default: 8000)
PUBLIC_URLNoProduction URL - skips ngrok if set
NGROK_AUTH_TOKENNongrok auth token for local dev