Import the Grapevine Download CSV export into this survey. Each response row is matched to a question & option by their text/label. The DB is backed up before import. Column mapping is confirmed against the real export.
Base URL: · Header: X-Api-Key: <DASHBOARD_API_KEY> (in .env on the VPS). In Admin the UI uses the session token automatically.
| Method | Path | Description |
|---|---|---|
| GET | /api/surveys | List all surveys (nested questions/options) |
| GET | /api/surveys/{id} | One survey config |
| POST | /api/surveys | Create survey |
| PATCH | /api/surveys/{id} | Update config / questions |
| DELETE | /api/surveys/{id} | Delete survey + responses |
| GET | /api/report/{id}?range=&channel= | KPIs, funnel, per-answer revenue/AOV |
| GET | /api/responses/{id}?range=&channel=&limit=&offset= | Individual responses (order, revenue, answers) |
| POST | /api/import/{id} | {rows:[…]} bulk import responses |
| DELETE | /api/responses/purge?order_id=&customer_id= | GDPR erasure (backs up db first) |
Ghi chú doanh thu: order_value chốt tại thời điểm khách trả lời (đơn hoàn tiền/huỷ sau đó không tự cập nhật); đơn trên Order-status cũ hơn 60 ngày có thể không lấy được tổng (quyền read_orders 60 ngày) → doanh thu 0.
Public (checkout extension, extension session token):
| GET | /api/public/survey?surface=thank_you|order_status | Active survey config |
| POST | /api/public/impression | {survey_id,order_id,surface} |
| POST | /api/public/response | {survey_id,order_id,answers,completed} (revenue fetched server-side) |