IM
ZH-TW
文件首頁
選單
指南

審計日誌和操作

查詢提供者操作、作業執行和故障排除的操作記錄。

inbox-manager client-flow

審計日誌和操作

目的:查詢提供者操作、作業執行和故障排除的操作記錄。

使用者介面流程

  1. UI 載入每個帳戶的最新日誌。
  2. 使用者按任務/作業/電子郵件/憑證事件過濾日誌。
  3. UI 公開每個日誌的範圍詳細資訊頁面。
  4. UI 可以先使用搜尋刪除乾運行對舊日誌進行受控清理。

客戶端庫流程

const logs = await api.logs.list(accountId, { limit: 50, offset: 0 });
const filtered = await api.logs.search(accountId, {
  query: "smtp_send_message",
  limit: 20,
});
if (filtered.data.length > 0) {
  await api.logs.get(filtered.data[0].id);
}

HTTP/curl 流程

API_BASE_URL="https://api.inbox-manager.com"

curl -sS "${API_BASE_URL}/api/accounts/${ACCOUNT_ID}/logs?limit=20&offset=0" \
  -H "authorization: Bearer ${BEARER_TOKEN}"

curl -sS -X POST "${API_BASE_URL}/api/accounts/${ACCOUNT_ID}/logs/search" \
  -H "authorization: Bearer ${BEARER_TOKEN}" \
  -H "content-type: application/json" \
  --data '{"query":"imap_fetch_body","limit":20,"offset":0}'

curl -sS "${API_BASE_URL}/api/logs/${LOG_ID}" \
  -H "authorization: Bearer ${BEARER_TOKEN}"

curl -sS -X POST "${API_BASE_URL}/api/accounts/${ACCOUNT_ID}/logs/search-delete" \
  -H "authorization: Bearer ${BEARER_TOKEN}" \
  -H "content-type: application/json" \
  --data '{"query":"debug","dry_run":true,"limit":100,"older_than":"2026-01-01T00:00:00.000Z"}'

註釋

  • 日誌是帳戶和應用程式範圍內的。
  • 安全性原則從日誌中排除憑證明文件。
  • search-delete 需要 older_than