Lấy lịch sử gửi tin nhắn
API này giúp bạn lấy lịch sử gửi tin nhắn của các Official Account (OA) có trong hệ thống.
Endpoint
🔗Endpoint Staging
GET https://staging-manage.api.miniai.vn/api/external/zns-message/history
🔗Endpoint Production
GET https://manage-api.miniap.vn/api/external/zns-message/history
Tham số truy vấn (Query Parameters)
Kết quả được phân trang và sắp xếp theo thời gian gửi mới nhất.
| Tham số | Kiểu | Bắt buộc | Mặc định | Mô tả |
|---|---|---|---|---|
page | number | Không | 1 | Trang cần lấy. |
offset | number | Không | 20 | Số bản ghi trên mỗi trang. |
Example
GET https://manage-api.miniap.vn/api/external/zns-message/history?page=1&offset=20
Phản hồi (Response)
- Response
{
"histories": [
{
"_id": "68c8ee9a7a307c3674e986d0",
"phone": "0335214562",
"templateId": "462666",
"status": "RECEIVED",
"reason": "",
"sessionId": "cfcd208495d565ef66e7dff9f98764da",
"deliveryTime": "1726465200000",
"createdAt": "2025-09-16T05:00:00.000Z",
"updatedAt": "2025-09-16T05:00:42.000Z",
"id": "68c8ee9a7a307c3674e986d0"
},
{
"_id": "68c8ee047a307c3674e986c7",
"phone": "0335214562",
"templateId": "462666",
"status": "ERROR",
"reason": "{\"error\":\"Request failed with status code 401\",\"params\":{\"customer_fullname\":\"Lê Quốc An\",\"customer_phone\":\"0335214562\",\"order_code\":\"M0WHXJVU9L\"}}",
"sessionId": "",
"createdAt": "2025-09-16T04:56:36.717Z",
"updatedAt": "2025-09-16T04:56:36.717Z",
"id": "68c8ee047a307c3674e986c7"
},
{
"_id": "68c8ed287a307c3674e986c6",
"phone": "0335214562",
"templateId": "462666",
"status": "ERROR",
"reason": "{\"error\":\"Request failed with status code 401\",\"params\":{\"customer_fullname\":\"Lê Quốc An\",\"customer_phone\":\"0335214562\",\"order_code\":\"PJDMZ31UNS\"}}",
"sessionId": "",
"createdAt": "2025-09-16T04:52:56.010Z",
"updatedAt": "2025-09-16T04:52:56.010Z",
"id": "68c8ed287a307c3674e986c6"
},
{
"_id": "68c8ea80e08f8bdbb6a5998a",
"phone": "0335214562",
"templateId": "392688",
"status": "ERROR",
"reason": "{\"error\":\"Request failed with status code 401\",\"params\":{\"customer_name\":\"Lê Quốc An\",\"customer_id\":\"61BB35FA62\",\"event_name\":\"Invalid Date\",\"subtitle_event\":\"Invalid Date\",\"time_event\":\"Invalid Date\"}}",
"sessionId": "",
"createdAt": "2025-09-16T04:41:36.521Z",
"updatedAt": "2025-09-16T04:41:36.521Z",
"id": "68c8ea80e08f8bdbb6a5998a"
},
{
"_id": "68c8ea6ae08f8bdbb6a59989",
"phone": "0335214562",
"templateId": "438650",
"status": "ERROR",
"reason": "{\"error\":\"Request failed with status code 401\",\"params\":{\"customer_fullname\":\"Lê Quốc An\",\"order_code\":\"M0WHXJVU9L\",\"order_createdat\":\"16/09/2025\",\"order_price\":\"338400\",\"customer_id\":\"61BB35FA62\"}}",
"sessionId": "",
"createdAt": "2025-09-16T04:41:14.341Z",
"updatedAt": "2025-09-16T04:41:14.341Z",
"id": "68c8ea6ae08f8bdbb6a59989"
}
]
}
ghi chú
deliveryTime là thời điểm Zalo xác nhận đã gửi tin nhắn (dạng chuỗi epoch milliseconds). Trường này chỉ có giá trị khi tin nhắn ở trạng thái RECEIVED.