Skip to main content

Inventory Device Serial Diags

Retrieve and manage device serial diagnostics data for inventory items.

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

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Endpoints

GET /inventory_device_serial_diags/

Retrieve device serial diagnostic information with optional status updates.

Parameters:

Parameter Type In Required Description
id string query No ID of the scheduled transaction
update_status boolean query No Use configured helpers to update device status before returning the information

Example Request:

GET /api/v1/inventory_device_serial_diags/?id=12345&update_status=true

Example Response:

{
  "count": 2,
  "results": [
    {
      "id": "12345",
      "device_serial": "SN001234567",
      "diagnostic_type": "connectivity",
      "status": "healthy",
      "last_check": "2024-01-15T10:30:00Z",
      "response_time": 45,
      "error_count": 0,
      "created_at": "2024-01-15T09:00:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    },
    {
      "id": "12346",
      "device_serial": "SN001234568",
      "diagnostic_type": "hardware",
      "status": "warning",
      "last_check": "2024-01-15T10:25:00Z",
      "response_time": null,
      "error_count": 2,
      "created_at": "2024-01-15T08:45:00Z",
      "updated_at": "2024-01-15T10:25:00Z"
    }
  ]
}
Status Description
200 Success
401 Unauthorized
400 Invalid parameters

POST /inventory_device_serial_diags/

Create a new device serial diagnostic entry.

Parameters:

Parameter Type In Required Description
data string body Yes JSON string containing diagnostic data

Example Request:

POST /api/v1/inventory_device_serial_diags/
Content-Type: application/json

{
  "device_serial": "SN001234569",
  "diagnostic_type": "connectivity",
  "scheduled_transaction_id": "txn_789",
  "parameters": {
    "timeout": 30,
    "retry_count": 3
  }
}

Example Response:

{
  "id": "12347",
  "device_serial": "SN001234569",
  "diagnostic_type": "connectivity",
  "status": "pending",
  "scheduled_transaction_id": "txn_789",
  "parameters": {
    "timeout": 30,
    "retry_count": 3
  },
  "created_at": "2024-01-15T11:00:00Z",
  "updated_at": "2024-01-15T11:00:00Z"
}
Status Description
201 Created successfully
400 Invalid request data
401 Unauthorized
422 Validation error

Best Practices

  • Use update_status=true when you need real-time device status information, but be aware this may increase response time
  • Filter by specific transaction IDs when tracking scheduled diagnostic operations
  • Monitor error_count values to identify devices requiring attention
  • Implement proper error handling for timeout scenarios when update_status is enabled
  • Consider pagination for large device inventories by adding limit and offset parameters
  • Use appropriate diagnostic_type values: "connectivity", "hardware", "performance", or "security"