Skip to main content

Inventory Device Serial Setting

Manage device-specific settings and parameters for inventory devices by serial number.

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_setting/

Retrieve device settings for a specific device identified by serial number. Supports filtering by various parameter attributes and includes pagination options.

Parameters:

Parameter Type In Required Description
parent__serial_number string query Yes Parent device serial number
parameter_id string query No Filter by specific parameter ID
parameter__variable_name string query No Filter setting by parameter variable name field
parameter__name string query No Filter setting by parameter name field
parameter__short_name string query No Filter setting by parameter short name field
limit integer query No Number of results to return per page
offset integer query No The initial index from which to return the results
pending boolean query No Report if the device has pending settings

Example Request:

GET /api/v1/inventory_device_serial_setting/?parent__serial_number=DEV001&parameter__name=temperature&limit=20

Example Response:

{
  "count": 5,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": 1,
      "parameter_id": "temp_001",
      "parameter": {
        "variable_name": "temp_threshold",
        "name": "Temperature Threshold",
        "short_name": "TempTh"
      },
      "value": "75.5",
      "pending": false,
      "last_updated": "2024-01-15T10:30:00Z"
    }
  ]
}
Status Description
200 Success
400 Bad Request - Missing required serial number
401 Unauthorized
404 Device not found

PUT /inventory_device_serial_setting/{parent__serial_number}/

Update all device settings for the specified device serial number. This performs a complete replacement of the device settings.

Parameters:

Parameter Type In Required Description
parent__serial_number string path Yes Parent device serial number
data object body Yes Complete device settings data

Example Request:

PUT /api/v1/inventory_device_serial_setting/DEV001/
Content-Type: application/json

{
  "settings": [
    {
      "parameter_id": "temp_001",
      "value": "80.0"
    },
    {
      "parameter_id": "voltage_001",
      "value": "12.5"
    }
  ]
}

Example Response:

{
  "id": "DEV001",
  "settings": [
    {
      "parameter_id": "temp_001",
      "value": "80.0",
      "pending": true,
      "last_updated": "2024-01-15T11:45:00Z"
    },
    {
      "parameter_id": "voltage_001",
      "value": "12.5",
      "pending": true,
      "last_updated": "2024-01-15T11:45:00Z"
    }
  ]
}
Status Description
200 Success
400 Bad Request - Invalid data format
401 Unauthorized
404 Device not found

PATCH /inventory_device_serial_setting/{parent__serial_number}/

Partially update specific device settings for the specified device serial number. Only the provided settings will be modified.

Parameters:

Parameter Type In Required Description
parent__serial_number string path Yes Parent device serial number
data object body Yes Partial device settings data

Example Request:

PATCH /api/v1/inventory_device_serial_setting/DEV001/
Content-Type: application/json

{
  "settings": [
    {
      "parameter_id": "temp_001",
      "value": "82.0"
    }
  ]
}

Example Response:

{
  "updated_settings": [
    {
      "parameter_id": "temp_001",
      "value": "82.0",
      "pending": true,
      "last_updated": "2024-01-15T12:00:00Z"
    }
  ]
}
Status Description
200 Success
400 Bad Request - Invalid data format
401 Unauthorized
404 Device not found

Best Practices

  • Always include the parent__serial_number parameter when listing device settings
  • Use the pending parameter to check for uncommitted configuration changes
  • Implement proper error handling for devices that may not exist
  • When updating settings, verify the parameter IDs are valid for the device type
  • Use pagination parameters (limit and offset) for devices with many settings
  • Monitor the pending status to track configuration deployment progress
  • Use PATCH for single setting updates and PUT for complete configuration replacement