Skip to main content

Device App Connection Log

The Device App Connection Log API enables applications to register detailed network connection logs for monitoring and analytics purposes. This endpoint captures comprehensive network connectivity data including connection types, security protocols, location information, and performance metrics, making it essential for network monitoring applications and connectivity analysis tools.

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

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The Device App Connection Log API provides a centralized way to track and log network connections from devices and applications. This API is designed for organizations that need to monitor network usage patterns, analyze connectivity performance, and maintain detailed records of device network activity.

Key Features:

  • Support for multiple network types (WiFi, Mobile, Bluetooth, Ethernet)
  • Comprehensive security protocol tracking (Open, WEP, WPA, WPA2, 3GPP)
  • Location-based logging with GPS coordinates
  • Network performance metrics including data transfer and link speeds
  • Connection quality measurements (RSSI, SINR)
  • Mobile network specifics (MCC/MNC, Cell ID, roaming status)

Common Use Cases:

  • Network performance monitoring and analytics
  • Device connectivity auditing and compliance
  • Troubleshooting network connectivity issues
  • Gathering data for network optimization
  • Security monitoring and anomaly detection

Endpoints

POST /device_app_connection_log/

Description: Registers a new network connection log entry with detailed network information, performance metrics, and location data. This endpoint is typically called when a device establishes, maintains, or terminates a network connection to create a comprehensive audit trail.

Use Cases:

  • Logging WiFi connection events with security and performance details
  • Recording mobile network connections including roaming status and cell information
  • Tracking network usage patterns for analytics and optimization
  • Creating audit trails for security and compliance monitoring

Full URL Example:

https://gate.zequenze.com/api/v1/device_app_connection_log/

Parameters:

Parameter Type In Required Description
data string body Yes JSON string containing the network connection log data

Request Body Schema:

Field Type Required Description
network_name string No Name of the current network (e.g., "Office WiFi", "Guest Network")
network_type string Yes Network type. Use: 'wi' (WiFi), 'mo' (Mobile), 'bl' (Bluetooth), 'et' (Ethernet)
network_security string Yes Security protocol. Use: 'opn' (Open), 'wep' (WEP), 'wpa' (WPA), 'wp2' (WPA2), '3gp' (3GPP)
network_mccmnc string No Mobile Country Code/Mobile Network Code for mobile networks
frequency number No Wireless network frequency in Hz (e.g., 2.4, 5.0 for WiFi)
authentication string No Authentication method. Use: 'non' (None), 'cpo' (Captive portal), 'wis' (WISPr), 'psk' (Pre-shared key), 'rad' (RADIUS MAC-based), 'eap' (EAP/802.1x), '3gp' (3GPP)
bssid string No Basic Service Set Identifier for wireless networks
cellid string No Mobile network Cell ID identifier
roaming boolean No True if device was roaming on a non-home network
latitude string No GPS latitude coordinate in decimal format
longitude string No GPS longitude coordinate in decimal format
inbytes integer No Number of bytes received during the connection
outbytes integer No Number of bytes transmitted during the connection
link_speed number No Maximum attainable link speed in Mbps
quality_metric string No Connection quality measurement type. Use: 'rssi' (RSSI), 'sinr' (SINR)
quality_value number No Numeric value for the quality metric

cURL Example:

curl -X POST "https://gate.zequenze.com/api/v1/device_app_connection_log/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "network_name": "Office WiFi 5GHz",
    "network_type": "wi",
    "network_security": "wp2",
    "frequency": 5.2,
    "authentication": "psk",
    "bssid": "aa:bb:cc:dd:ee:ff",
    "latitude": "40.7128",
    "longitude": "-74.0060",
    "inbytes": 1048576,
    "outbytes": 524288,
    "link_speed": 150.0,
    "quality_metric": "rssi",
    "quality_value": -45.0
  }'

Example Response (201 Created):

{
  "network_name": "Office WiFi 5GHz",
  "network_type": "wi",
  "network_security": "wp2",
  "network_mccmnc": null,
  "frequency": 5.2,
  "authentication": "psk",
  "bssid": "aa:bb:cc:dd:ee:ff",
  "cellid": null,
  "roaming": null,
  "latitude": "40.7128",
  "longitude": "-74.0060",
  "inbytes": 1048576,
  "outbytes": 524288,
  "link_speed": 150.0,
  "quality_metric": "rssi",
  "quality_value": -45.0
}

Mobile Network Example:

curl -X POST "https://gate.zequenze.com/api/v1/device_app_connection_log/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "network_name": "Verizon LTE",
    "network_type": "mo",
    "network_security": "3gp",
    "network_mccmnc": "310012",
    "authentication": "3gp",
    "cellid": "12345678",
    "roaming": false,
    "latitude": "37.7749",
    "longitude": "-122.4194",
    "inbytes": 2097152,
    "outbytes": 1048576,
    "quality_metric": "sinr",
    "quality_value": 15.2
  }'

Response Codes:

Status Description
201 Created - Connection log successfully registered
400 Bad Request - Invalid data format or missing required fields
401 Unauthorized - Invalid or missing authentication token
422 Unprocessable Entity - Invalid field values or constraints

Common Use Cases

Use Case 1: WiFi Connection Monitoring

Applications monitoring WiFi connectivity can log each connection event with network name, security type, signal strength, and data usage. This helps identify network performance issues and optimize WiFi deployments.

Use Case 2: Mobile Network Analytics

Mobile device management applications can track cellular connections including carrier information, roaming status, and data consumption to analyze mobile network usage patterns and costs.

Use Case 3: Location-Based Network Analysis

IoT devices and mobile applications can combine network connection data with GPS coordinates to analyze network coverage, identify dead zones, and correlate network performance with geographic locations.

Use Case 4: Security Auditing

Security applications can log network connections to detect unusual network access patterns, unauthorized network usage, or potential security threats by analyzing connection types and authentication methods.

Use Case 5: Performance Troubleshooting

Network diagnostic tools can capture detailed connection metrics including link speeds, signal quality, and data transfer volumes to help troubleshoot connectivity issues and optimize network performance.


Best Practices

  • Data Accuracy: Ensure network type and security values use the specified codes (wi, mo, bl, et for types; opn, wep, wpa, wp2, 3gp for security) to maintain data consistency
  • Location Privacy: Only include GPS coordinates when necessary for your use case and ensure compliance with privacy regulations
  • Batch Processing: For high-volume logging, consider implementing client-side batching to reduce API calls and improve performance
  • Error Handling: Implement retry logic for network failures, but avoid duplicate log entries by using client-side deduplication
  • Data Validation: Validate data locally before sending to avoid 400/422 errors, especially for numeric fields like frequency and quality values
  • Security Considerations: Use HTTPS for all requests and store API tokens securely, especially when logging sensitive network information
  • Monitoring: Track API response times and error rates to ensure reliable logging, as missing connection logs can impact analytics accuracy