Skip to main content

Inventory Device Serial Setting

ManageThe Device Serial Setting API endpoints provide access to configuration parameters and settings for specific devices in your inventory. These endpoints allow you to retrieve, update, and modify device-specific settings andusing parametersthe for inventory devices bydevice's serial number.number as the primary identifier. Common use cases include reading current device configurations, updating device parameters, and managing device-specific operational settings.

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

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The Device Serial Setting API category manages configuration parameters and operational settings for individual devices in your inventory system. Each device is uniquely identified by its serial number and can have multiple configurable parameters that control various aspects of device behavior and operation.

Key Concepts:

    Device Settings: Configuration parameters that define how a device operates Parameter Variables: Named configuration options with specific data types and validation rules Pending Settings: Configuration changes that have been submitted but not yet applied to the device Serial Number Identification: Primary method for targeting specific devices in your inventory

    Common Use Cases:

      Retrieving current configuration for a specific device Updating device operational parameters Checking for pending configuration changes Bulk configuration management across device fleets Monitoring device parameter status and compliance

      These endpoints work together to provide complete CRUD operations for device settings, with the GET endpoint for reading configurations and PUT/PATCH endpoints for updating them. The API supports filtering by various parameter attributes to help you find specific settings quickly.


      Endpoints

      GET /inventory_device_serial_setting/

      Description: Retrieves a list of configuration settings for devices based on their serial number. This endpoint allows you to query device settings with various filters to find specific parameters or check for pending configuration changes. It's essential for monitoring device configurations and ensuring devices are properly configured.

      Use Cases:

        Retrieve deviceall settings for a specific device identified by serial number.number SupportsCheck filteringif a device has pending configuration changes Find specific parameters by variousname parameteror attributesvariable andname includesMonitor paginationdevice options.configuration compliance across your fleet

        Full URL Example:

        https://control.zequenze.com/api/v1/inventory_device_serial_setting/?parent__serial_number=DEV001234&pending=true&limit=50
        

        Parameters:

        Parameter Type In Required Description
        parent__serial_number string query Yes Parent deviceThe serial number of the parent device whose settings you want to retrieve
        parameter_id string query No Filter by specific parameter ID
        parameter__variable_name string query No Filter settingsettings by parameterthe parameter's variable name field(e.g., "network_timeout")
        parameter__name string query No Filter settingsettings by parameterthe parameter's display name field(e.g., "Network Timeout")
        parameter__short_name string query No Filter settingsettings by parameterthe parameter's short name fieldabbreviation
        limit integer query No Number of results to return per page (default pagination limit applies)
        offset integer query No The initialstarting index fromfor which to return thepaginated results
        pending boolean query No ReportWhen iftrue, thereturns deviceonly hassettings with pending changes; when false, returns applied settings

        ExamplecURL Request:Example:

        curl -X GET "https://control.zequenze.com/api/v1/inventory_device_serial_setting/?parent__serial_number=DEV001DEV001234&parameter__name=temperature&limit=20parameter__variable_name=network_timeout" \
          -H "Authorization: Bearer YOUR_API_TOKEN" \
          -H "Content-Type: application/json"
        

        Example Response:

        {
          "count": 5,3,
          "next": null,
          "previous": null,
          "results": [
            {
              "id": 1,101,
              "parameter_id"parent_device_serial": "temp_001"DEV001234",
              "parameter": {
                "id": "net_timeout",
                "variable_name": "temp_threshold"network_timeout",
                "name": "TemperatureNetwork Threshold"Timeout",
                "short_name": "TempTh"NetTO",
                "data_type": "integer",
                "unit": "seconds"
              },
              "value"current_value": "75.5"30",
              "pending"pending_value": false,"45",
              "last_updated"is_pending": true,
              "last_modified": "2024-01-15T14:30:00Z",
              "applied_at": "2024-01-15T10:30:15:00Z"
            },
            {
              "id": 102,
              "parent_device_serial": "DEV001234",
              "parameter": {
                "id": "auto_backup",
                "variable_name": "automatic_backup",
                "name": "Automatic Backup",
                "short_name": "AutoBak",
                "data_type": "boolean"
              },
              "current_value": "true",
              "pending_value": null,
              "is_pending": false,
              "last_modified": "2024-01-14T09:20:00Z",
              "applied_at": "2024-01-14T09:20:00Z"
            }
          ]
        }
        

        Response Codes:

        Status Description
        200 Success - Returns the device settings data
        400 Bad Request - Missing required serialparent__serial_number numberparameter
        401 Unauthorized - Invalid or missing authentication token
        404 Not Found - Device with specified serial number not found

        PUT /inventory_device_serial_setting/{parent__serial_number}/

        UpdateDescription: allPerforms a complete update of device settings for the specified device serial number. This performsendpoint replaces all existing settings with the provided configuration data. Use this method when you need to set multiple parameters at once or perform a complete replacementconfiguration ofoverwrite.

        the

        Use Cases:

          Apply a complete configuration template to a device Reset device settings.to a known good configuration state Bulk update multiple settings simultaneously Restore device configuration from backup

          Full URL Example:

          https://control.zequenze.com/api/v1/inventory_device_serial_setting/DEV001234/
          

          Parameters:

          Parameter Type In Required Description
          parent__serial_number string path Yes Parent deviceThe serial number of the device to update (specified in the URL path)
          data objectstring body Yes CompleteJSON devicestring containing the complete settings configuration data

          ExamplecURL Request:Example:

          curl -X PUT "https://control.zequenze.com/api/v1/inventory_device_serial_setting/DEV001/DEV001234/" \
            -H "Authorization: Bearer YOUR_API_TOKEN" \
            -H "Content-Type: application/jsonjson" \
            -d '{
              "settings": [
                {
                  "parameter_id": "temp_001"network_timeout",
                  "value": "80.0"60"
                },
                {
                  "parameter_id": "voltage_001"automatic_backup",
                  "value": "12.5"true"
                },
                {
                  "parameter_id": "log_level",
                  "value": "info"
                }
              ]
            }'
          

          Example Response:

          {
            "id"device_serial": "DEV001"DEV001234",
            "settings"updated_settings": [
              {
                "parameter_id": "temp_001"network_timeout",
                "value"parameter_name": "80.0"Network Timeout",
                "pending": true,
                "last_updated"old_value": "2024-01-15T11:45:00Z"30",
                "new_value": "60",
                "status": "pending"
              },
              {
                "parameter_id": "voltage_001"automatic_backup",
                "value"parameter_name": "12.5"Automatic Backup",
                "pending"old_value": true,"true",
                "last_updated"new_value": "true",
                "status": "unchanged"
              },
              {
                "parameter_id": "log_level",
                "parameter_name": "Logging Level",
                "old_value": "debug",
                "new_value": "info",
                "status": "pending"
              }
            ],
            "pending_changes": 2,
            "updated_at": "2024-01-15T11:15T15:45:00Z"
          }
          ]
          }
          

          Response Codes:

          Status Description
          200 Success - Settings updated successfully
          400 Bad Request - Invalid JSON data formator parameter validation failed
          401 Unauthorized - Invalid or missing authentication token
          404 Not Found - Device with specified serial number not found
          422 Unprocessable Entity - Valid JSON but invalid parameter values

          PATCH /inventory_device_serial_setting/{parent__serial_number}/

          PartiallyDescription: Performs a partial update specificof device settings for the specified device serial number. OnlyThis endpoint allows you to update specific settings without affecting other existing configurations. Use this method when you only need to modify a few specific parameters while leaving the providedrest unchanged.

          Use Cases:

            Update a single device parameter Modify specific settings willwithout beaffecting modified.others Apply incremental configuration changes Fine-tune individual device parameters

            Full URL Example:

            https://control.zequenze.com/api/v1/inventory_device_serial_setting/DEV001234/
            

            Parameters:

            Parameter Type In Required Description
            parent__serial_number string path Yes Parent deviceThe serial number of the device to update (specified in the URL path)
            data objectstring body Yes PartialJSON devicestring containing only the specific settings datato update

            ExamplecURL Request:Example:

            curl -X PATCH "https://control.zequenze.com/api/v1/inventory_device_serial_setting/DEV001/DEV001234/" \
              -H "Authorization: Bearer YOUR_API_TOKEN" \
              -H "Content-Type: application/jsonjson" \
              -d '{
                "settings": [
                  {
                    "parameter_id": "temp_001"network_timeout",
                    "value": "82.0"45"
                  }
                ]
              }'
            

            Example Response:

            {
              "device_serial": "DEV001234",
              "updated_settings": [
                {
                  "parameter_id": "temp_001"network_timeout",
                  "value"parameter_name": "82.0"Network Timeout",
                  "pending"old_value": true,"30",
                  "last_updated"new_value": "45",
                  "status": "pending",
                  "change_reason": "Performance optimization"
                }
              ],
              "pending_changes": 1,
              "total_settings": 15,
              "updated_at": "2024-01-15T12:00:15T16:20:00Z"
                }
              ]
            }
            

            Response Codes:

            Status Description
            200 Success - Specific settings updated successfully
            400 Bad Request - Invalid JSON data formator parameter validation failed
            401 Unauthorized - Invalid or missing authentication token
            404 Not Found - Device or specified parameter not found
            422 Unprocessable Entity - Valid JSON but invalid parameter values

            Common Use Cases

            Use Case 1: Device Configuration Audit

            Retrieve all current settings for a device to perform a configuration audit or compliance check. Use the GET endpoint with the device serial number to get a complete overview of all parameters and their current values.

            Use Case 2: Checking for Pending Changes

            Monitor devices that have configuration changes waiting to be applied by using the GET endpoint with pending=true parameter. This helps track deployment status and ensure changes are properly applied.

            Use Case 3: Single Parameter Update

            When you need to adjust just one setting (like increasing a timeout value), use the PATCH endpoint to modify only that specific parameter without affecting other configurations.

            Use Case 4: Configuration Template Deployment

            Deploy a standard configuration template to new devices using the PUT endpoint to set all parameters at once, ensuring consistent device setup across your fleet.

            Use Case 5: Parameter Search and Filtering

            Find specific types of settings across devices by using parameter name filters, helping you identify devices with particular configuration patterns or locate specific parameters quickly.


            Best Practices

            • Use Serial Numbers Correctly: Always includeverify device serial numbers before making updates, as incorrect serial numbers will result in 404 errors or unintended device modifications.

            Handle Pending Changes: Check for pending changes before applying new settings. Consider the parent__serial_numberimpact parameterof whenoverwriting listingpending deviceconfigurations settingsthat haven't been applied yet.

            Use the

            Implement pendingProper parameterError Handling: Always check response status codes and handle validation errors appropriately. Parameter validation failures (422 status) should be clearly communicated to checkusers.

            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 paginationAppropriate parametersHTTP (limitMethods: and offset) for devices with many settings

            Monitor the pending status to track configuration deployment progress Use PATCH for single settingparameter updates and PUT for complete configuration replacementreplacements to follow REST best practices and avoid unintended side effects.

            Implement Pagination: For devices with many settings, use the limit and offset parameters to implement proper pagination and avoid performance issues with large result sets.

            Monitor Configuration Changes: Regularly audit device configurations and track pending changes to ensure your device fleet maintains proper operational parameters and security compliance.