Txlog Portal
The Portal Transaction Log API provides access to detailed transaction records from portal access points within the Zequenze system. These endpoints allow you to retrieve and analyze user access patterns, monitor security events, and generate comprehensive audit reports for compliance and operational purposes.
Base URL: https://gate.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Overview
The Portal Transaction Log API enables comprehensive monitoring and auditing of all portal-based transactions within your Zequenze infrastructure. This API is essential for security teams, facility managers, and compliance officers who need to track user access patterns, investigate security incidents, and maintain detailed audit trails.
Portal transactions represent real-time events occurring at physical or virtual access points throughout your organization. Each transaction captures critical information including user identity, access point location, timestamp, transaction type, and outcome. This data is invaluable for:
- Security Monitoring: Track unauthorized access attempts, unusual activity patterns, and security breaches
- Compliance Reporting: Generate detailed audit trails required by regulatory frameworks
- Operational Analytics: Understand facility usage patterns, peak access times, and resource utilization
- Incident Investigation: Reconstruct event timelines and identify security incidents
The API supports flexible filtering options allowing you to query transactions by user, location, access point, time range, and transaction type. Results are paginated for optimal performance when dealing with large datasets spanning extended time periods.
Endpoints
GET /txlog_portal/
Description: Retrieves a comprehensive list of portal transactions with advanced filtering capabilities. This endpoint is the primary method for accessing historical transaction data and supports multiple filter parameters to narrow results based on specific criteria such as user identity, location, time range, and transaction type.
Use Cases:
- Generate security audit reports for specific time periods and locations
- Investigate suspicious access patterns or security incidents
- Monitor user access frequency and timing patterns
- Create compliance reports showing detailed access logs
- Analyze facility usage patterns across different access points
Full URL Example:
https://gate.zequenze.com/api/v1/txlog_portal/?user=123&start_date=2024-01-01&end_date=2024-01-31&type=access&limit=50
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| type | string | query | No | Filter transactions by type (e.g., 'access', 'exit', 'denied', 'maintenance') |
| start_date | string | query | No | Start date/time filter in ISO format: 2000-01-01, 2000-01-01 00:01:00, or 2000-01-01 00:01:00+00:00 |
| end_date | string | query | No | End date/time filter in ISO format: 2000-01-01, 2000-01-01 00:01:00, or 2000-01-01 00:01:00+00:00 |
| user | integer | query | No | Filter transactions by user ID to show activity for a specific user |
| page | integer | query | No | Page number for pagination (alternative to cursor-based pagination) |
| access_point | integer | query | No | Filter by specific access point ID to show transactions for a particular entry/exit |
| location | integer | query | No | Filter by location ID to show transactions within a specific facility or area |
| cursor | string | query | No | Cursor-based pagination token for efficient navigation through large result sets |
| limit | integer | query | No | Maximum number of results per page (default varies, recommended: 50-100) |
cURL Example:
curl -X GET "https://gate.zequenze.com/api/v1/txlog_portal/?user=123&start_date=2024-01-15&end_date=2024-01-16&limit=50" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"count": 247,
"next": "https://gate.zequenze.com/api/v1/txlog_portal/?cursor=eyJpZCI6MTIzNDU2fQ%3D%3D&limit=50",
"previous": null,
"results": [
{
"id": 78945,
"user": {
"id": 123,
"username": "john.doe",
"first_name": "John",
"last_name": "Doe",
"employee_id": "EMP001234"
},
"access_point": {
"id": 15,
"name": "Main Entrance - Building A",
"code": "BLDG-A-MAIN",
"type": "entry"
},
"location": {
"id": 5,
"name": "Corporate Headquarters",
"address": "123 Business Plaza",
"timezone": "America/New_York"
},
"type": "access",
"status": "granted",
"timestamp": "2024-01-15T08:42:15Z",
"method": "card_swipe",
"device_info": {
"reader_id": "RDR-001",
"firmware_version": "2.1.3"
},
"metadata": {
"card_number": "****1234",
"response_time_ms": 250,
"additional_verification": false
}
},
{
"id": 78944,
"user": {
"id": 456,
"username": "jane.smith",
"first_name": "Jane",
"last_name": "Smith",
"employee_id": "EMP001235"
},
"access_point": {
"id": 22,
"name": "Secure Lab - Level 3",
"code": "LAB-L3-001",
"type": "restricted"
},
"location": {
"id": 7,
"name": "Research Facility",
"address": "456 Innovation Drive",
"timezone": "America/New_York"
},
"type": "denied",
"status": "insufficient_clearance",
"timestamp": "2024-01-15T08:35:22Z",
"method": "biometric",
"device_info": {
"reader_id": "BIO-003",
"firmware_version": "3.2.1"
},
"metadata": {
"clearance_required": "Level-3",
"user_clearance": "Level-2",
"escalation_triggered": true
}
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns paginated list of portal transactions |
| 400 | Bad Request - Invalid date format or parameter values |
| 401 | Unauthorized - Invalid or missing Bearer token |
| 403 | Forbidden - Insufficient permissions to access transaction logs |
| 422 | Unprocessable Entity - Invalid filter parameter combination |
Common Use Cases
Use Case 1: Security Incident Investigation
When investigating a security breach or unauthorized access attempt, combine multiple filters to reconstruct the incident timeline. Use date range filters with specific access points and review denied transactions to identify suspicious patterns.
https://gate.zequenze.com/api/v1/txlog_portal/?type=denied&access_point=15&start_date=2024-01-15T20:00:00&end_date=2024-01-16T06:00:00
Use Case 2: User Access Pattern Analysis
Monitor specific employee access patterns by filtering transactions for individual users across different time periods. This is useful for HR investigations, compliance audits, or understanding employee work patterns.
https://gate.zequenze.com/api/v1/txlog_portal/?user=123&start_date=2024-01-01&end_date=2024-01-31&limit=100
Use Case 3: Facility Usage Reporting
Generate comprehensive facility usage reports by filtering transactions for specific locations and time ranges. This data helps optimize facility resources and understand peak usage periods.
https://gate.zequenze.com/api/v1/txlog_portal/?location=5&type=access&start_date=2024-01-01&end_date=2024-01-31
Use Case 4: Real-time Security Monitoring
Implement real-time monitoring by repeatedly querying recent transactions with short time windows and focusing on denied access attempts or unusual activity patterns.
https://gate.zequenze.com/api/v1/txlog_portal/?start_date=2024-01-15T08:00:00&type=denied&limit=20
Use Case 5: Compliance Audit Trail Generation
Create detailed audit trails for regulatory compliance by extracting complete transaction histories for specific time periods, including all user activities and system responses.
https://gate.zequenze.com/api/v1/txlog_portal/?start_date=2024-01-01&end_date=2024-03-31&limit=1000
Best Practices
-
Optimize Date Range Queries: Use specific date ranges rather than open-ended queries to improve performance and reduce API response times. The API performs better with focused time windows.
-
Implement Proper Pagination: For large datasets, use cursor-based pagination (
cursorparameter) rather than offset-based pagination (pageparameter) for consistent results and better performance. -
Cache Transaction Data: Portal transaction logs are immutable once created. Implement local caching strategies for historical data to reduce API calls and improve application performance.
-
Filter Early, Filter Often: Apply multiple filter parameters to reduce result set size at the API level rather than filtering large datasets in your application code.
-
Handle Rate Limits Gracefully: Implement exponential backoff and retry logic for API requests, especially when processing large time ranges or generating comprehensive reports.
-
Secure Token Management: Store and rotate Bearer tokens securely. Transaction logs contain sensitive access control information that requires appropriate security measures.
-
Monitor for Anomalies: Set up automated monitoring using the API to detect unusual access patterns, such as after-hours access attempts or repeated denied transactions from the same user.
-
Use Appropriate Date Formats: Always use ISO 8601 formatted dates with timezone information for accurate filtering across different geographical locations and daylight saving time transitions.