Skip to main content

Inventory Device Diags

ManageThe inventory device diagnostics endpoints provide access to device diagnostic information and status updates forwithin your inventory devices.system. These endpoints allow you to retrieve diagnostic data for devices and create new diagnostic entries, with optional real-time status updates using configured helpers.

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

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The inventory device diagnostics API enables comprehensive monitoring and management of device health and status information across your organization's inventory. This API category is essential for maintaining visibility into device performance, troubleshooting issues, and ensuring optimal device operations.

Key capabilities include:

    Retrieving diagnostic data for specific devices or all devices in inventory Creating new diagnostic entries to track device issues or maintenance activities Real-time status updates using configured diagnostic helpers Monitoring device health trends and identifying potential problems before they impact operations

    These endpoints work together to provide a complete diagnostic workflow - you can query existing diagnostic information to understand current device status, then create new diagnostic entries when issues are identified or maintenance is performed. The optional status update feature ensures you always have the most current device information available.

    Common integration scenarios:

      Automated monitoring systems that periodically check device status Help desk applications that need to view device diagnostic history Maintenance management systems that create diagnostic records Dashboard applications displaying real-time device health metrics

      Endpoints

      GET /inventory_device_diags/

      RetrieveDescription: Retrieves diagnostic information for inventorydevices devices.in Optionallyyour inventory. This endpoint supports filtering by specific device IDs and can optionally update device status in real-time using configured diagnostic helpers before returning results.the data.

      Use Cases:

        Monitor the health status of all devices in your inventory Retrieve diagnostic history for a specific device during troubleshooting Build dashboard displays showing current device status across your organization Automated monitoring systems checking for device issues

        Full URL Example:

        https://control.zequenze.com/api/v1/inventory_device_diags/?id=device-12345&update_status=true
        

        Parameters:

        Parameter Type In Required Description
        id string query No ID of the scheduledspecific transactiondevice to retrieve diagnostics for. If omitted, returns diagnostics for all devices
        update_status boolean query No UseWhen true, uses configured diagnostic helpers to update device status before returning thedata. informationUseful for real-time monitoring

        ExamplecURL Request:Example:

        curl -X GET "https://control.zequenze.com/api/v1/inventory_device_diags/?id=device-12345&update_status=truetrue" \
          -H "Authorization: Bearer YOUR_API_TOKEN" \
          -H "Content-Type: application/json"
        

        Example Response:

        {
          "count": 1,2,
          "next": null,
          "previous": null,
          "results": [
            {
              "id": "12345"diag-001",
              "device_id": "dev_abc123"device-12345",
              "device_name": "Server-01"Office Printer HP-2024",
              "device_serial": "HP123456789",
              "diagnostic_type": "health_check",
              "status": "online"warning",
              "last_check": "2023-12-01T10:30:00Z",
              "diagnostics"details": {
                "cpu_usage": 45.2,45,
                "memory_usage": 67.8,78,
                "disk_usage"disk_space": 23.1,23,
                "network_status"network_connectivity": "connected"good",
                "last_ping": "2024-01-15T14:25:00Z"
              },
              "alerts"issues": [
                {
                  "severity": "medium",
                  "message": "Low disk space detected",
                  "code": "DISK_LOW"
                }
              ],
              "scheduled_transaction_id"created_at": "12345"2024-01-15T14:25:00Z",
              "updated_at": "2024-01-15T14:25:00Z",
              "next_check_due": "2024-01-15T18:25:00Z"
            }
          ]
        }
        

        Response Codes:

        Status Description
        200 DiagnosticSuccess information- retrievedReturns successfullydiagnostic data for requested devices
        401 Unauthorized - Invalid or missing API token
        404 DeviceNot Found - Specified device ID does not foundexist
        500 Server Error - Issue with diagnostic helper configuration

        POST /inventory_device_diags/

        CreateDescription: Creates a new device diagnostic entry orfor scheduleda device in your inventory. This endpoint allows you to record diagnostic transaction.information, maintenance activities, or issue reports for tracking device health over time.

        Use Cases:

          Log diagnostic results from manual device inspections Record maintenance activities performed on devices Create incident reports when device issues are discovered Integrate with automated monitoring tools to log diagnostic events

          Full URL Example:

          https://control.zequenze.com/api/v1/inventory_device_diags/
          

          Parameters:

          Parameter Type In Required Description
          data string body Yes JSON string containing the diagnostic datainformation to create. Must include device identification and diagnostic details

          ExamplecURL Request:Example:

          curl -X POST "https://control.zequenze.com/api/v1/inventory_device_diags/" \
            -H "Authorization: Bearer YOUR_API_TOKEN" \
            -H "Content-Type: application/jsonjson" \
            -d '{
              "device_id": "dev_abc123"device-12345",
              "diagnostic_type": "health_check"maintenance",
              "schedule_time"status": "2023-12-01T15:00:00Z"completed",
              "parameters"details": {
                "check_cpu"action_performed": true,"firmware_update",
                "check_memory"previous_version": true,"1.2.3",
                "check_disk"new_version": true,"1.2.4",
                "check_network"duration_minutes": true15
              },
              "notes": "Firmware update completed successfully",
              "performed_by": "tech@company.com"
            }'
          

          Example Request Body:

          {
            "device_id": "device-12345",
            "diagnostic_type": "issue_report",
            "status": "open",
            "details": {
              "issue_category": "hardware",
              "symptoms": ["intermittent_connectivity", "slow_response"],
              "error_codes": ["ERR_NETWORK_001"],
              "impact_level": "medium"
            },
            "notes": "Device experiencing intermittent network connectivity issues. Users report slow response times during peak hours.",
            "reported_by": "helpdesk@company.com",
            "priority": "high"
          }
          

          Example Response:

          {
            "id": "67890"diag-002",
            "device_id": "dev_abc123"device-12345",
            "device_name": "Office Printer HP-2024",
            "diagnostic_type": "health_check"issue_report",
            "status": "scheduled"open",
            "schedule_time"details": {
              "issue_category": "2023-12-01T15:00:00Z"hardware",
              "symptoms": ["intermittent_connectivity", "slow_response"],
              "error_codes": ["ERR_NETWORK_001"],
              "impact_level": "medium"
            },
            "notes": "Device experiencing intermittent network connectivity issues. Users report slow response times during peak hours.",
            "reported_by": "helpdesk@company.com",
            "priority": "high",
            "created_at": "2023-12-01T10:45:2024-01-15T15:30:00Z",
            "parameters"updated_at": {
              "check_cpu": true,
              "check_memory": true,
              "check_disk": true,
              "check_network": true
            }2024-01-15T15:30:00Z"
          }
          

          Response Codes:

          Status Description
          201 Created - Diagnostic entry successfully created successfully
          400 Bad Request - Invalid or missing required data provided
          401 Unauthorized - Invalid or missing API token
          404 Not Found - Referenced device ID does not exist 422 Validation errorError - Data format is incorrect

          Common Use Cases

          Use Case 1: Real-time Device Health Monitoring

          Build a monitoring dashboard that displays current device status across your organization. Use the GET endpoint with update_status=true to ensure you're always showing the latest diagnostic information, and refresh the data every few minutes to maintain real-time visibility.

          Use Case 2: Maintenance Workflow Integration

          Integrate with your maintenance management system to automatically create diagnostic entries when maintenance is performed. Use the POST endpoint to log activities like firmware updates, hardware replacements, or routine inspections, creating a complete maintenance history.

          Use Case 3: Incident Tracking and Resolution

          When users report device issues, create diagnostic entries to track the problem from identification through resolution. Start with a POST request to log the initial issue, then use GET requests to retrieve the diagnostic history during troubleshooting.

          Use Case 4: Automated Issue Detection

          Set up automated monitoring that periodically checks device status and creates diagnostic entries when issues are detected. Combine both endpoints - use GET to check current status, then POST to create issue reports when problems are identified.

          Use Case 5: Compliance and Audit Reporting

          Generate compliance reports by retrieving diagnostic history for specific devices or time periods. Use the GET endpoint with appropriate filtering to collect maintenance records and diagnostic data required for regulatory compliance or internal audits.


          Best Practices

          • StatusUse Updatespagination for large inventories: - When retrieving diagnostics for many devices, implement proper pagination using limit and offset parameters to avoid timeouts and improve performance.

          Leverage the update_status parameter judiciously - While real-time status updates provide current information, they can impact response times. Use the update_status=true parameteronly when you need real-timethe devicemost statuscurrent information,data.

          but be aware this may increase response time

          Filtering: Use the id parameter to retrieve specificStructure diagnostic transactionsdata ratherconsistently than fetching all results

          Error Handling: Always check for HTTP status codes; devices may be offline or unreachable during diagnostic operations Scheduling:- When creating diagnostic entries, ensureuse scheduleconsistent timesfield arenames and data structures in the futuredetails object to enable better searching and withinreporting reasonableacross limitsyour diagnostic history.

          RateImplement Limitingproper error handling: Avoid- frequentAlways statuscheck updateresponse requestscodes toand preventhandle overwhelmingcases devicewhere endpointsdevices might not exist or diagnostic helpers might be unavailable. Build retry logic for temporary network or service issues.

          Data Format: Ensure the data parameter contains valid JSON when creatingCache diagnostic entriesdata appropriately - For dashboard applications, consider caching diagnostic data with appropriate TTL values to reduce API calls while maintaining reasonable data freshness.

          Use meaningful diagnostic types - Establish standard diagnostic_type values (like "health_check", "maintenance", "issue_report") to enable better filtering and categorization of diagnostic data.