Skip to main content

Device App Connection Log

The device app connection log API provides functionality to register network connection events between devices and applications. This endpoint is essential for tracking connectivity patterns, monitoring device activity, and maintaining audit trails for security 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 Device App Connection Log API allows you to record and track network connection events between devices and applications within your system. This logging mechanism is crucial for:

  • Security Monitoring: Track when devices connect to applications and identify unusual connection patterns
  • Compliance Auditing: Maintain detailed logs of device-application interactions for regulatory requirements
  • Network Analytics: Analyze connection patterns to optimize network performance and identify bottlenecks
  • Troubleshooting: Diagnose connectivity issues by reviewing historical connection data

This API is typically used by network monitoring tools, security applications, and device management systems that need to maintain comprehensive logs of device connectivity events. The logged data can be used for generating reports, triggering alerts, or feeding into analytics systems.


Endpoints

POST /device_app_connection_log/

Description: Registers a new network connection log entry between a device and an application. This endpoint captures connection events in real-time, allowing you to build a comprehensive audit trail of device-application interactions. Use this endpoint whenever a device establishes or terminates a connection with an application to maintain accurate connectivity records.

Use Cases:

  • Log device authentication events to applications
  • Record connection attempts for security monitoring
  • Track application usage patterns across devices
  • Maintain compliance logs for auditing purposes
  • Monitor network connectivity for troubleshooting

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 connection log details including device ID, application ID, connection timestamp, status, and metadata

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 '{
    "device_id": "DEV-001-XR7H9",
    "application_id": "APP-MOBILE-001",
    "connection_type": "established",
    "timestamp": "2024-01-15T14:30:25Z",
    "ip_address": "192.168.1.105",
    "user_agent": "MobileApp/2.1.0 (iOS 17.0)",
    "status": "success",
    "duration": null,
    "metadata": {
      "location": "Building A - Floor 2",
      "network_type": "WiFi",
      "signal_strength": -45
    }
  }'

Example Request Body:

{
  "device_id": "DEV-001-XR7H9",
  "application_id": "APP-MOBILE-001", 
  "connection_type": "established",
  "timestamp": "2024-01-15T14:30:25Z",
  "ip_address": "192.168.1.105",
  "user_agent": "MobileApp/2.1.0 (iOS 17.0)",
  "status": "success",
  "duration": null,
  "metadata": {
    "location": "Building A - Floor 2",
    "network_type": "WiFi",
    "signal_strength": -45,
    "session_id": "sess_abc123xyz",
    "protocol": "HTTPS"
  }
}

Example Response:

{
  "id": 12847,
  "device_id": "DEV-001-XR7H9",
  "application_id": "APP-MOBILE-001",
  "connection_type": "established",
  "timestamp": "2024-01-15T14:30:25Z",
  "ip_address": "192.168.1.105",
  "user_agent": "MobileApp/2.1.0 (iOS 17.0)",
  "status": "success",
  "duration": null,
  "created_at": "2024-01-15T14:30:26Z",
  "metadata": {
    "location": "Building A - Floor 2",
    "network_type": "WiFi",
    "signal_strength": -45,
    "session_id": "sess_abc123xyz",
    "protocol": "HTTPS"
  }
}

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 API token
422 Unprocessable Entity - Valid format but invalid data values
500 Internal Server Error - Server processing error

Common Use Cases

Use Case 1: Real-time Security Monitoring

Monitor device connections in real-time to detect unauthorized access attempts or unusual connection patterns. Log every connection attempt with device details, timestamps, and connection outcomes to feed into security monitoring dashboards.

Use Case 2: Compliance Audit Trail

Maintain detailed logs of all device-application connections for regulatory compliance requirements. Record connection events with timestamps, user context, and session details to support audit processes and compliance reporting.

Use Case 3: Network Performance Analytics

Track connection patterns and durations to analyze network performance and identify bottlenecks. Use connection logs to understand peak usage times, popular applications, and connection quality metrics.

Use Case 4: Troubleshooting Connectivity Issues

Create detailed connection logs to assist with diagnosing connectivity problems. Include metadata such as signal strength, network type, and error codes to help technical teams quickly identify and resolve issues.

Use Case 5: Usage Analytics and Reporting

Generate reports on application usage patterns, device activity, and connection statistics. Use the logged data to understand user behavior, optimize resource allocation, and plan network capacity.


Best Practices

  • Batch Logging: For high-volume environments, consider batching multiple connection events into single API calls to improve performance
  • Error Handling: Implement retry logic for failed log submissions, especially for critical security events that must be recorded
  • Data Retention: Plan for log data retention and archival strategies, as connection logs can accumulate quickly in active environments
  • Sensitive Data: Avoid logging sensitive information like passwords or personal data in the metadata fields - focus on connection and technical details
  • Timestamp Accuracy: Ensure timestamps are in UTC format and accurately reflect the actual connection time for proper chronological ordering
  • Rate Limiting: Be aware of potential rate limits and implement appropriate queuing mechanisms for high-frequency logging scenarios
  • Monitoring: Set up alerts for failed log submissions to ensure your audit trail remains complete and reliable