Skip to main content

Txlog Portal

Retrieve and filter Portal transaction logs with comprehensive search and pagination capabilities.

Base URL: https://gate.zequenze.com/api/v1

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Endpoints

GET /txlog_portal/

Retrieve a paginated list of Portal transactions with optional filtering by type, date range, user, location, and access point.

Parameters:

Parameter Type In Required Description
type string query No Filter transactions by type field
start_date string query No Filter by start datetime in ISO format (2000-01-01, 2000-01-01 00:01:00, 2000-01-01 00:01:00+00:00)
end_date string query No Filter by end datetime in ISO format (2000-01-01, 2000-01-01 00:01:00, 2000-01-01 00:01:00+00:00)
user integer query No Filter transactions by username field
page integer query No Filter transactions by page field
access_point integer query No Filter transactions by access point ID
location integer query No Filter transactions by location ID
cursor string query No Pagination cursor value for navigating results
limit integer query No Number of results to return per page (default varies)

Example Request:

GET /api/v1/txlog_portal/?type=login&start_date=2024-01-01&end_date=2024-01-31&limit=50
Authorization: Bearer your-api-token

Example Response:

{
  "count": 1250,
  "next": "https://gate.zequenze.com/api/v1/txlog_portal/?cursor=eyJ0aW1lc3RhbXAiOiIyMDI0LTAxLTE1VDEwOjMwOjAwWiJ9&limit=50",
  "previous": null,
  "results": [
    {
      "id": 12345,
      "type": "login",
      "timestamp": "2024-01-15T10:30:00Z",
      "user": {
        "id": 567,
        "username": "john.doe",
        "email": "john.doe@company.com"
      },
      "access_point": {
        "id": 89,
        "name": "Main Entrance Portal",
        "identifier": "AP-MAIN-01"
      },
      "location": {
        "id": 12,
        "name": "Building A - Ground Floor",
        "code": "BA-GF"
      },
      "success": true,
      "ip_address": "192.168.1.100",
      "user_agent": "Portal Client v2.1.0",
      "session_duration": 3600,
      "additional_data": {
        "device_id": "portal-scanner-001",
        "card_number": "****1234"
      }
    },
    {
      "id": 12344,
      "type": "logout",
      "timestamp": "2024-01-15T09:45:00Z",
      "user": {
        "id": 568,
        "username": "jane.smith",
        "email": "jane.smith@company.com"
      },
      "access_point": {
        "id": 91,
        "name": "Executive Floor Portal",
        "identifier": "AP-EXEC-02"
      },
      "location": {
        "id": 15,
        "name": "Building B - 5th Floor",
        "code": "BB-5F"
      },
      "success": true,
      "ip_address": "192.168.1.105",
      "user_agent": "Portal Client v2.1.0",
      "session_duration": 7200,
      "additional_data": {
        "device_id": "portal-scanner-005",
        "exit_reason": "manual_logout"
      }
    }
  ]
}
Status Description
200 Successfully retrieved transaction logs
400 Invalid parameters (e.g., malformed date format)
401 Unauthorized - invalid or missing Bearer token
403 Forbidden - insufficient permissions to access transaction logs
429 Too many requests - rate limit exceeded

Best Practices

  • Date Filtering: Use ISO 8601 format for date parameters. Include timezone information for precise filtering across different time zones
  • Pagination: Use the cursor parameter for efficient pagination through large datasets rather than relying on page numbers
  • Rate Limiting: Implement appropriate delays between requests when processing large date ranges to avoid hitting rate limits
  • Filtering Optimization: Combine multiple filters (type, location, access_point) to reduce response size and improve performance
  • Error Handling: Always check the response status and handle potential network timeouts when querying large transaction logs
  • Data Retention: Be aware that transaction logs may have retention policies - older records might not be available