---
title: "Lưu tiến độ trả lời (bản nháp) - mỗi người một bản nháp cho mỗi khảo sát"
method: PUT
path: "/surveys/{surveyId}/draft"
tags: ["Surveys"]
---

# Lưu tiến độ trả lời (bản nháp) - mỗi người một bản nháp cho mỗi khảo sát

`PUT /surveys/{surveyId}/draft`

## Request

- Base URL: `https://api.fireant.vn`
- URL: `https://api.fireant.vn/surveys/{surveyId}/draft`
- Auth: none declared
- TypeScript: <https://skmtc.dev/fireant/apis/fireant-restful-api/docs/surveys/:surveyId/draft/put.ts> (a function with typed inputs; its response is checked against the schema)

Gửi toàn bộ câu trả lời hiện có (ghi đè bản nháp cũ). Chỉ kiểm tra kiểu dữ liệu, không bắt buộc câu hỏi.
Khi gọi POST responses, bản nháp sẽ được chuyển thành phản hồi hoàn thành.

## Path parameters

- `surveyId` integer, required

## Request body

- FireAntApiModelsSurveysSurveyResponseRequest: Yêu cầu gửi phản hồi khảo sát
  - `anonymousId` string: Định danh khách ẩn danh (device id) - dùng khi khảo sát cho phép ẩn danh và chưa đăng nhập
  - `platform` string: Nền tảng: ios | android | web
  - `appVersion` string: Phiên bản ứng dụng
  - `durationSeconds` integer: Thời gian hoàn thành (giây)
  - `metadata` string: Dữ liệu bổ sung dạng JSON (tùy chọn)
  - `currentQuestionId` integer: Bản nháp: câu người dùng đang làm (để vẽ phễu rơi rớt)
  - `answers` FireAntApiModelsSurveysSurveyAnswerRequest[], required: Danh sách câu trả lời (câu hỏi bị ẩn bởi điều kiện rẽ nhánh sẽ bị bỏ qua)
    - `questionId` integer: ID câu hỏi
    - `optionIds` integer[]: Các lựa chọn được chọn
    - `otherText` string: Text nhập kèm khi chọn lựa chọn "Khác"
    - `text` string: Câu trả lời tự luận
    - `number` number, double: Giá trị số (Rating/Number/Slider)
    - `boolValue` boolean: Giá trị Có/Không
    - `date` string, date-time: Giá trị ngày (Date) hoặc ngày bắt đầu (DateRange)
    - `dateTo` string, date-time: DateRange: ngày kết thúc
    - `matrix` FireAntApiModelsSurveysSurveyMatrixCellRequest[]: Matrix: mỗi phần tử là một dòng đã trả lời
      - `rowOptionId` integer: optionId của dòng (optionGroup = Choice)
      - `columnOptionId` integer: optionId của cột (optionGroup = MatrixColumn) - dùng khi ma trận có cột rời
      - `number` number, double: Điểm trong minValue..maxValue - dùng khi ma trận là thang điểm
    - `rankedOptionIds` integer[]: Ranking: các optionId theo thứ tự ưu tiên (phần tử đầu = hạng 1)
    - `fileUrls` string[]: FileUpload: URL các tệp đã upload qua endpoint /surveys/{id}/files
    - `symbols` string[]: Symbol: các mã cổ phiếu (VD: ["VNM","FPT"])
    - `numberTo` number, double: Slider chọn khoảng: đầu cuối (number là đầu đầu)
    - `points` FireAntApiModelsSurveysSurveyPointRequest[]: Hotspot: các điểm chạm (tọa độ theo tỷ lệ ảnh 0..1)
      - `x` number, double: Tỷ lệ theo bề rộng (0 = mép trái, 1 = mép phải)
      - `y` number, double: Tỷ lệ theo chiều cao (0 = mép trên, 1 = mép dưới)
    - `blanks` FireAntApiModelsSurveysSurveyBlankAnswerRequest[]: FillInBlank: câu trả lời từng ô trống
      - `optionId` integer: optionId của ô trống (optionGroup = Blank)
      - `text` string: Ô dạng chữ / mã CK
      - `number` number, double: Ô dạng số
      - `choiceOptionId` integer: Ô dạng chọn: optionId của lựa chọn (optionGroup = BlankChoice, cha là ô trống)

## Response `200`

Đã lưu nháp (responseId của bản nháp)

- FireAntApiModelsSurveysSurveySubmitResult: Kết quả sau khi gửi phản hồi khảo sát
  - `responseId` integer: ID phản hồi vừa tạo
  - `surveyId` integer: ID khảo sát
  - `submittedDate` string, date-time: Thời điểm ghi nhận
  - `thankYouMessage` string: Lời cảm ơn cấu hình trên khảo sát
  - `showResults` boolean: Khảo sát cho phép xem kết quả tổng hợp
  - `outcome` FireAntApiModelsSurveysSurveyOutcome: Hành động được chọn cho một phản hồi cụ thể (đã thay placeholder). Client hiển thị nút; người dùng bấm mới chuyển.
    - `ruleId` integer: ID quy tắc đã khớp
    - `title` string: Tiêu đề (tùy chọn)
    - `description` string: Mô tả (tùy chọn)
    - `buttonLabel` string: Nhãn nút
    - `actionType` 1 | 2 | 3 | 4: Loại hành động (1 = Url, 2 = AppRoute, 3 = Survey, 4 = Symbol)
    - `actionValue` string: Giá trị đã thay placeholder: URL / JSON route / SurveyId / mã CK
    - `openInNewTab` boolean: Mở tab mới (Url trên web)

## Other responses

- `400`: Dữ liệu không hợp lệ / khảo sát không nhận phản hồi
- `409`: Đã hoàn thành khảo sát này

## Changes

- **2026-09-25** `a481789cd81c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/fireant/apis/fireant-restful-api/changes/surveys/:surveyId/draft/put.md)

---

[API](https://skmtc.dev/fireant/apis/fireant-restful-api.md) - [All operations](https://skmtc.dev/fireant/apis/fireant-restful-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fireant/apis/fireant-restful-api/revisions/c9b3aa855f95?raw)
