Txlog Portal
RetrieveThe Portal Transaction Log API provides access to detailed transaction records from portal access points within the Zequenze system. These endpoints allow you to retrieve andfilteranalyzePortalusertransactionaccesslogspatterns,withmonitor security events, and generate comprehensivesearchaudit reports for compliance andpaginationoperationalcapabilities.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:
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/
RetrieveDescription: Retrieves a paginatedcomprehensive list of Portalportal transactions with optionaladvanced filtering bycapabilities. type,This dateendpoint 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, user,and location,transaction type.
Use Cases:
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 |
| start_date | string | query | No | |
| end_date | string | query | No | |
| user | integer | query | No | Filter transactions by |
| page | integer | query | No | |
| access_point | integer | query | No | Filter |
| location | integer | query | No | Filter |
| cursor | string | query | No | |
| limit | integer | query | No |
ExamplecURL Request:Example:
curl -X GET "https://gate.zequenze.com/api/v1/txlog_portal/?type=loginuser=123&start_date=2024-01-0115&end_date=2024-01-3116&limit=5050" \
-H "Authorization: Bearer your-api-tokenYOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"count": 1250,247,
"next": "https://gate.zequenze.com/api/v1/txlog_portal/?cursor=eyJ0aW1lc3RhbXAiOiIyMDI0LTAxLTE1VDEwOjMwOjAwWiJ9eyJpZCI6MTIzNDU2fQ%3D%3D&limit=50",
"previous": null,
"results": [
{
"id": 12345,
"type": "login",
"timestamp": "2024-01-15T10:30:00Z",78945,
"user": {
"id": 567,123,
"username": "john.doe",
"email"first_name": "john.doe@company.com"John",
"last_name": "Doe",
"employee_id": "EMP001234"
},
"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": "BuildingMain BEntrance - 5thBuilding Floor"A",
"code": "BB-5F"BLDG-A-MAIN",
"type": "entry"
},
"success": true,
"ip_address": "192.168.1.105",
"user_agent": "Portal Client v2.1.0",
"session_duration": 7200,
"additional_data"location": {
"device_id"id": 5,
"name": "portal-scanner-005"Corporate Headquarters",
"exit_reason"address": "manual_logout"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 | |
| 400 | Bad Request - Invalid |
| 401 | Unauthorized - |
| 403 | Forbidden - |
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
Filtering: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 (cursor parameter) rather than offset-based pagination (page parameter) 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 formatformatted fordates date parameters. Includewith timezone information for preciseaccurate filtering across different timegeographical zones
cursor