AAA Accounting
The AAA Accounting endpoints provide access to authentication, authorization, and accounting transaction records from network access points. These endpoints allow you to retrieve detailed session information including user connections, data usage, session duration, and network access patterns for monitoring, reporting, and compliance purposes.
Base URL: https://gate.zequenze.com/api/v1
Authentication: All endpoints require a Bearer token:
Authorization: Bearer <your-api-token>
Overview
The AAA Accounting API category provides comprehensive access to network accounting records that track user sessions, data usage, and connection details across your network infrastructure. These endpoints are essential for:
- Network Monitoring: Track active and historical user sessions across access points
- Usage Analytics: Monitor data consumption patterns and session durations
- Compliance Reporting: Generate detailed reports for regulatory requirements
- Billing Integration: Access session data for usage-based billing systems
- Security Auditing: Review connection logs and identify anomalous network activity
The accounting records follow the RADIUS accounting standard, capturing detailed information about user sessions including start/stop times, data transfer volumes, client devices, and termination reasons. This data is automatically collected from network access points and made available through these read-only endpoints.
Key concepts:
- Session Records: Each record represents a user's network session with comprehensive connection details
- Real-time Data: Access both active sessions and historical records with flexible filtering
- Multi-dimensional Filtering: Filter by user, location, access point, time ranges, and session status
- Pagination Support: Efficiently handle large datasets with cursor-based pagination
Endpoints
GET /aaa_accounting/
Description: Retrieves a paginated list of AAA accounting records with flexible filtering options. This endpoint is your primary tool for accessing session data, whether you need to monitor active sessions, analyze historical usage patterns, or generate compliance reports. The response includes comprehensive session details from RADIUS accounting data.
Use Cases:
- Monitor current active user sessions across all access points
- Generate usage reports for specific time periods or locations
- Track data consumption patterns for capacity planning
- Export session data for external billing or analytics systems
- Audit network access for security compliance
Full URL Example:
https://gate.zequenze.com/api/v1/aaa_accounting/?start_date=2024-01-01&end_date=2024-01-31&session_status=active&limit=50
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| start_date | string | query | No | Filter records from this date/time. Accepts 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 | Filter records until this date/time. Accepts 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 records by specific user ID to see sessions for a particular user |
| access_point | integer | query | No | Filter records by access point ID to see sessions from specific hardware |
| location | integer | query | No | Filter records by location ID to see sessions from specific sites or buildings |
| client | integer | query | No | Filter records by client organization ID for multi-tenant environments |
| session_status | string | query | No | Filter by session state. Values: all (default), active (ongoing sessions), inactive (completed sessions) |
| cursor | string | query | No | Pagination cursor for retrieving the next page of results |
| limit | integer | query | No | Number of records per page (default varies, recommended: 10-100) |
cURL Example:
curl -X GET "https://gate.zequenze.com/api/v1/aaa_accounting/?start_date=2024-01-01&session_status=active&limit=25" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"next": "https://gate.zequenze.com/api/v1/aaa_accounting/?cursor=xyz123&limit=25",
"previous": null,
"results": [
{
"radacctid": 12345,
"acctsessionid": "sess_abc123",
"acctuniqueid": "unique_456def",
"username": "john.doe@company.com",
"groupname": "employees",
"realm": "company.com",
"nasipaddress": "192.168.1.10",
"nasportid": "wifi0",
"nasporttype": "Wireless-802.11",
"acctstarttime": "2024-01-15T09:30:00Z",
"acctupdatetime": "2024-01-15T10:15:00Z",
"acctstoptime": null,
"acctinterval": 600,
"acctsessiontime": 2700,
"acctauthentic": "RADIUS",
"connectinfo_start": "CONNECT 54Mbps 802.11n",
"connectinfo_stop": null,
"acctinputoctets": 15728640,
"acctoutputoctets": 52428800,
"calledstationid": "00:1A:2B:3C:4D:5E",
"callingstationid": "AA:BB:CC:DD:EE:FF",
"acctterminatecause": null,
"servicetype": "Framed-User",
"framedprotocol": "PPP",
"framedipaddress": "10.0.1.45",
"organization_id": "org_789",
"user_id": "user_456",
"user_transaction_id": "txn_321",
"client_id": "client_123",
"client_short_name": "HQ-Office",
"location_id": "loc_987",
"access_point_id": "ap_654",
"access_point_name": "AP-Floor2-East",
"location_name": "Headquarters Building",
"nasidentifier": "ap-hq-f2e-01",
"klass": "premium",
"access_point_mac_addr": "00:1A:2B:3C:4D:5E",
"ssid": "CorpWiFi-Secure"
}
]
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns paginated accounting records |
| 401 | Unauthorized - Invalid or missing API token |
| 400 | Bad Request - Invalid date format or parameter values |
GET /aaa_accounting/{radacctid}/
Description: Retrieves detailed information for a specific AAA accounting record by its unique radacctid. This endpoint provides complete session details for individual accounting transactions, useful for detailed analysis, troubleshooting specific user issues, or generating detailed session reports.
Use Cases:
- Investigate specific user connection issues or session problems
- Retrieve complete session details for billing or audit purposes
- Analyze detailed connection parameters for network optimization
- Export individual session records for compliance documentation
Full URL Example:
https://gate.zequenze.com/api/v1/aaa_accounting/12345/
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| radacctid | integer | path | Yes | The unique accounting record ID to retrieve |
cURL Example:
curl -X GET "https://gate.zequenze.com/api/v1/aaa_accounting/12345/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Example Response:
{
"radacctid": 12345,
"acctsessionid": "sess_abc123",
"acctuniqueid": "unique_456def",
"username": "jane.smith@company.com",
"groupname": "managers",
"realm": "company.com",
"nasipaddress": "192.168.1.15",
"nasportid": "wifi1",
"nasporttype": "Wireless-802.11",
"acctstarttime": "2024-01-15T14:20:00Z",
"acctupdatetime": "2024-01-15T16:45:00Z",
"acctstoptime": "2024-01-15T17:30:00Z",
"acctinterval": 300,
"acctsessiontime": 11400,
"acctauthentic": "RADIUS",
"connectinfo_start": "CONNECT 300Mbps 802.11ac",
"connectinfo_stop": "User-Request",
"acctinputoctets": 234567890,
"acctoutputoctets": 876543210,
"calledstationid": "00:1A:2B:3C:4D:5F",
"callingstationid": "BB:CC:DD:EE:FF:AA",
"acctterminatecause": "User-Request",
"servicetype": "Framed-User",
"framedprotocol": "PPP",
"framedipaddress": "10.0.1.78",
"organization_id": "org_789",
"user_id": "user_789",
"user_transaction_id": "txn_456",
"client_id": "client_123",
"client_short_name": "HQ-Office",
"location_id": "loc_987",
"access_point_id": "ap_655",
"access_point_name": "AP-Floor3-West",
"location_name": "Headquarters Building",
"nasidentifier": "ap-hq-f3w-02",
"klass": "standard",
"access_point_mac_addr": "00:1A:2B:3C:4D:5F",
"ssid": "CorpWiFi-Guest"
}
Response Codes:
| Status | Description |
|---|---|
| 200 | Success - Returns the specific accounting record |
| 401 | Unauthorized - Invalid or missing API token |
| 404 | Not Found - Accounting record with specified ID does not exist |
Common Use Cases
Use Case 1: Active Session Monitoring Dashboard
Retrieve all currently active sessions to display real-time network usage. Use the session_status=active filter to show only ongoing connections, perfect for network operations centers or IT dashboards.
Use Case 2: Monthly Usage Reporting
Generate monthly reports by filtering with start_date and end_date parameters. Combine with location or access_point filters to create detailed usage reports for specific sites or network segments.
Use Case 3: User Behavior Analysis
Track specific user patterns by filtering with the user parameter, then analyze session durations, data usage, and connection frequency to optimize network resources or identify training needs.
Use Case 4: Billing Data Export
Extract session data for usage-based billing by querying records within billing periods and calculating total session time and data transfer volumes per user or organization.
Use Case 5: Security Incident Investigation
When investigating security incidents, use the specific record endpoint to get complete session details including IP addresses, MAC addresses, connection times, and termination causes for forensic analysis.
Best Practices
- Use Date Filters Effectively: Always use start_date and end_date parameters when querying historical data to improve performance and reduce response times
- Implement Proper Pagination: Use the cursor-based pagination for large datasets rather than trying to retrieve all records at once
- Cache Responses: Accounting data is generally immutable once sessions complete, making it suitable for caching to reduce API calls
- Monitor Rate Limits: Be mindful of API rate limits when building automated reporting systems or real-time dashboards
- Handle Timezones: All timestamps are in UTC; convert to local timezone in your application as needed
- Filter by Organization: In multi-tenant environments, always filter by client parameter to ensure proper data isolation
- Use Session Status Appropriately: Filter by session_status=active for monitoring dashboards, and session_status=inactive for historical reporting
- Error Handling: Implement retry logic for network timeouts and handle 404 responses gracefully when querying specific record IDs
No comments to display
No comments to display