GETBearer 權杖
查詢通知訊息
/api/v1/messages
查詢組織訊息與未讀數量,每頁 8 則。
API 欄位名稱、型別與程式碼在所有語言中保持原樣。
請求範例
cURL
curl "https://tovahub.com/api/v1/messages?page=1" \
-H "Authorization: Bearer $TOVAHUB_TOKEN"僅提供範例,此頁不會發送 API 請求。
回應示例
JSON
{
"userId": "507f1f77bcf86cd799439013",
"through": "2026-11-07T12:00:00.000Z",
"messages": [],
"unreadCount": 0,
"page": 1,
"pageSize": 8,
"totalCount": 0,
"totalPages": 1
}參數
page查詢字串 · 選填string
以查詢字串表示的正整數,預設為 "1"。請依 totalPages 換頁。
回應
HTTP 狀態 200
以頁碼分頁讀取組織訊息。
userIdstring (ObjectId)已驗證的使用者識別碼。
throughstring (ISO 8601)傳入 mark_messages_read 的訊息快照截止時間。
messagesarray選取欄位後的訊息記錄,不包含 serverId 或 dedupeKey。
messages[]._idstring (ObjectId)訊息識別碼。
messages[].ticketIdstring (ObjectId) | null關聯的支援工單識別碼(若有)。
messages[].typestring可為 server_expiring、server_expired、renewal_failed、balance_gift、admin_message 或 ticket_reply。
messages[].serverNamestring | null關聯的伺服器名稱(若有)。
messages[].expiresAtstring (ISO 8601) | null關聯的服務到期時間(若有)。
messages[].daysLeftnumber | null通知中的剩餘天數(若有)。
messages[].amountstring | null通知金額(若有)。
messages[].messagestring | null訊息內容(若有)。
messages[].readAtstring (ISO 8601) | null已讀時間,或 null。
messages[].createdAtstring (ISO 8601)訊息建立時間。
unreadCountnumber整個組織的未讀訊息數。
pagenumber實際頁碼,會限制在可用頁數內。
pageSizenumber (8)固定每頁筆數。
totalCountnumber訊息總數。
totalPagesnumber總頁數;即使清單為空也至少為一頁。