Skip to main content

Device App Locations

The Device App Locations API enables tracking and management of mobile app location data from devices within your organization. This endpoint provides access to location records with filtering capabilities based on modification timestamps and supports pagination for handling large datasets efficiently.

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

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The Device App Locations API is designed for organizations that need to track and monitor location data from mobile applications installed on managed devices. This API category serves as a central repository for location information collected from various apps across your device fleet.

Key Capabilities:

  • Retrieve location data from all monitored devices and applications
  • Filter location records by modification date to track recent changes
  • Paginate through large datasets efficiently
  • Monitor location tracking compliance and usage patterns

Common Integration Scenarios:

  • Security monitoring systems that need to verify device locations
  • Compliance reporting for devices that must remain within specific geographic boundaries
  • Asset management systems tracking the physical location of company devices
  • Analytics platforms analyzing location patterns for business intelligence

The API uses a standard REST architecture with JSON responses and supports query-based filtering to help you retrieve exactly the location data you need without unnecessary overhead.


Endpoints

GET /device_app_locations/

Description: Retrieves a paginated list of all location records from applications on monitored devices. This endpoint allows you to access historical and current location data, filter by modification timestamps, and handle large datasets through pagination controls.

Use Cases:

  • Generate compliance reports showing device locations over time
  • Monitor real-time location changes across your device fleet
  • Integrate location data into security monitoring dashboards
  • Analyze location patterns for business operations optimization

Full URL Example:

https://gate.zequenze.com/api/v1/device_app_locations/?last_change__gte=2024-01-15T10:00:00Z&limit=50&offset=0

Parameters:

Parameter Type In Required Description
last_change__gte string query No Filter results to show only location records modified on or after this timestamp (ISO 8601 format)
limit integer query No Number of results to return per page (default: 20, max: 100)
offset integer query No The initial index from which to return results for pagination

cURL Example:

curl -X GET "https://gate.zequenze.com/api/v1/device_app_locations/?last_change__gte=2024-01-15T10:00:00Z&limit=25" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Example Response:

{
  "count": 1247,
  "next": "https://gate.zequenze.com/api/v1/device_app_locations/?limit=25&offset=25",
  "previous": null,
  "results": [
    {
      "id": 15842,
      "device_id": "DEV-2024-001",
      "device_name": "iPhone 15 - John Doe",
      "app_name": "Corporate Mobile App",
      "app_package": "com.company.mobile",
      "latitude": 40.7128,
      "longitude": -74.0060,
      "accuracy": 5.2,
      "altitude": 10.5,
      "timestamp": "2024-01-15T14:23:17Z",
      "last_change": "2024-01-15T14:23:20Z",
      "location_method": "GPS",
      "address": "123 Business St, New York, NY 10001",
      "is_mock_location": false,
      "battery_level": 78,
      "network_type": "WiFi"
    },
    {
      "id": 15841,
      "device_id": "DEV-2024-002",
      "device_name": "Samsung Galaxy S24 - Jane Smith",
      "app_name": "Field Service App",
      "app_package": "com.company.fieldservice",
      "latitude": 34.0522,
      "longitude": -118.2437,
      "accuracy": 3.8,
      "altitude": 71.3,
      "timestamp": "2024-01-15T14:20:45Z",
      "last_change": "2024-01-15T14:20:48Z",
      "location_method": "GPS",
      "address": "456 Client Ave, Los Angeles, CA 90028",
      "is_mock_location": false,
      "battery_level": 92,
      "network_type": "4G"
    }
  ]
}

Response Codes:

Status Description
200 Success - Returns paginated location data
401 Unauthorized - Invalid or missing authentication token
400 Bad Request - Invalid query parameters (e.g., malformed timestamp)
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error - Server processing error

Common Use Cases

Use Case 1: Real-Time Location Monitoring

Monitor recent location changes across all devices by using the last_change__gte parameter with a recent timestamp. This is ideal for security dashboards that need to show current device positions and detect unusual movement patterns.

Use Case 2: Compliance Reporting

Generate periodic reports by fetching location data for specific time periods. Combine timestamp filtering with pagination to process large datasets efficiently for compliance documentation and audit trails.

Use Case 3: Geofence Violation Detection

Regularly poll the API for recent location updates and cross-reference coordinates against predefined geographic boundaries to identify devices that have moved outside approved areas.

Use Case 4: Asset Tracking Integration

Integrate location data into asset management systems by periodically syncing device positions, enabling better inventory management and theft prevention for mobile device fleets.

Use Case 5: Business Intelligence Analytics

Export location data for analysis of employee mobility patterns, client visit optimization, and operational efficiency improvements in field service operations.


Best Practices

  • Implement Efficient Polling: Use the last_change__gte parameter with your last successful sync timestamp to avoid retrieving duplicate data and reduce API calls.

  • Optimize Pagination: Choose appropriate limit values based on your processing capacity. Smaller batches (20-50) provide better responsiveness, while larger batches (up to 100) reduce total API calls for bulk operations.

  • Handle Rate Limits: Implement exponential backoff when receiving 429 responses, and consider caching location data locally to reduce API dependency for frequent access patterns.

  • Validate Location Accuracy: Check the accuracy field and is_mock_location flag to filter out low-quality location data that might affect your analysis or compliance reporting.

  • Monitor Data Freshness: Compare timestamp (when location was recorded) vs last_change (when record was modified) to understand data latency and ensure your monitoring systems account for potential delays.

  • Secure Token Management: Store API tokens securely and implement token rotation. Consider using environment variables or secure credential management systems rather than hardcoding tokens.