Chuyển tới nội dung chính

Chiến dịch

Nhóm API cho phép tra cứu chiến dịchthống kê phản hồi khảo sát của cửa hàng Mini Gift.

Xác thực

Tất cả endpoint bên dưới đều yêu cầu header x-api-key. Xem chi tiết tại trang Giới thiệu Open API.


1. Lấy danh sách chiến dịch

Endpoint

🔗Endpoint Production
GET https://api.minigift.vn/api/v1/open/campaigns

Tham số truy vấn (Query Parameters)

Tham sốKiểuBắt buộcMô tả
pagenumberKhôngTrang hiện tại (mặc định 1)
limitnumberKhôngSố bản ghi mỗi trang (mặc định 10, tối đa 1000)
searchstringKhôngTìm kiếm theo tên chiến dịch
typestringKhôngLọc theo loại chiến dịch

Ví dụ request

cURL
curl -X GET "https://api.minigift.vn/api/v1/open/campaigns?page=1&limit=10" \
-H "x-api-key: sk_your_api_key_here"

Các trường trả về chính

TrườngKiểuMô tả
idstringID của chiến dịch
namestringTên chiến dịch
typestringLoại chiến dịch (minigame, receipt...)
statusstringTrạng thái chiến dịch
startDatestring (ISO 8601)Thời điểm bắt đầu
endDatestring (ISO 8601)Thời điểm kết thúc
createdAtstring (ISO 8601)Thời điểm tạo
updatedAtstring (ISO 8601)Thời điểm cập nhật gần nhất

Phản hồi (Response)

{
"data": [
{
"id": "6651aa11b2c3d4e5f6a7b8c9",
"name": "Vòng quay may mắn tháng 7",
"type": "minigame",
"status": "active",
"startDate": "2026-07-01T00:00:00.000Z",
"endDate": "2026-07-31T23:59:59.000Z",
"createdAt": "2026-06-28T04:00:00.000Z",
"updatedAt": "2026-06-30T09:20:00.000Z"
}
],
"meta": { "total": 1, "page": 1, "limit": 10 },
"success": true
}

2. Thống kê phản hồi khảo sát

Trả về danh sách câu trả lời khảo sát của một chiến dịch (dùng để phân tích, xuất báo cáo).

Endpoint

🔗Endpoint Production
GET https://api.minigift.vn/api/v1/open/campaigns/{id}/feedback-statistics

Tham số đường dẫn (Path Parameters)

Tham sốKiểuBắt buộcMô tả
idstringID của chiến dịch

Tham số truy vấn (Query Parameters)

Tham sốKiểuBắt buộcMô tả
pagenumberKhôngTrang hiện tại (mặc định 1)
limitnumberKhôngSố bản ghi mỗi trang

Ví dụ request

cURL
curl -X GET "https://api.minigift.vn/api/v1/open/campaigns/6651aa11b2c3d4e5f6a7b8c9/feedback-statistics?page=1&limit=20" \
-H "x-api-key: sk_your_api_key_here"

Cấu trúc câu trả lời

TrườngKiểuMô tả
surveyIdstringID khảo sát
userIdstringID người trả lời
answers[].questionIdstringID câu hỏi
answers[].questionTypestringLoại câu hỏi (ví dụ single-select, multi-select)
answers[].questionTextstringNội dung câu hỏi
answers[].answerstring[]Đáp án người dùng chọn

Phản hồi (Response)

{
"data": [
{
"surveyId": "6651bb22c3d4e5f6a7b8c9d0",
"userId": "6651cc33d4e5f6a7b8c9d0e1",
"answers": [
{
"questionId": "6651dd44e5f6a7b8c9d0e1f2",
"questionType": "single-select",
"questionText": "Bạn đánh giá dịch vụ như thế nào?",
"answer": ["Tốt"]
}
],
"createdAt": "2026-07-01T10:00:00.000Z"
}
],
"meta": { "total": 1, "page": 1, "limit": 20 },
"success": true
}