Skip to main content

Inventory Parameter

The Inventory Parameter API provides access to configuration parameters used throughout the inventory system. These endpoints allow you to retrieve parameter definitions, their allowed values, and group-based filtering for organizing configuration options across your inventory management workflows.

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

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Overview

The Inventory Parameter endpoints manage configuration parameters that define how inventory items are categorized, configured, and managed within the system. These parameters serve as the foundation for inventory item attributes, validation rules, and organizational structures.

Key Concepts:

  • Parameters - Configuration settings that define inventory item properties (e.g., device types, status options, location categories)
  • Groups - Logical collections of related parameters for better organization and filtering
  • Parameter Values - The allowed values or constraints for each parameter

Common Use Cases:

  • Retrieving available device types when creating new inventory items
  • Getting status options for inventory item workflows
  • Building dynamic forms with parameter-driven field options
  • Validating inventory data against defined parameter constraints
  • Organizing parameters by functional groups (hardware, software, location, etc.)

How These Endpoints Work Together: Use the list endpoint to browse all available parameters with optional group filtering, then use the detail endpoint to get comprehensive information about specific parameters including their validation rules and allowed values.


Endpoints

GET /inventory_parameter/

Description: Retrieves a paginated list of all inventory parameters with optional filtering by parameter group. This endpoint is essential for discovering available configuration options and building dynamic inventory management interfaces.

Use Cases:

  • Loading parameter options for inventory item creation forms
  • Discovering available device types, status options, or location categories
  • Building administrative interfaces for parameter management
  • Filtering parameters by functional groups (e.g., only hardware-related parameters)

Full URL Example:

https://control.zequenze.com/api/v1/inventory_parameter/?group=1&limit=20&offset=0

Parameters:

Parameter Type In Required Description
group integer query No Filter parameters by group ID to get only parameters belonging to a specific functional group
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://control.zequenze.com/api/v1/inventory_parameter/?group=1&limit=10" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Example Response:

{
  "count": 45,
  "next": "https://control.zequenze.com/api/v1/inventory_parameter/?group=1&limit=10&offset=10",
  "previous": null,
  "results": [
    {
      "id": 1,
      "name": "device_type",
      "display_name": "Device Type",
      "description": "Categorizes inventory items by device type",
      "group": {
        "id": 1,
        "name": "hardware",
        "display_name": "Hardware Parameters"
      },
      "data_type": "choice",
      "required": true,
      "allowed_values": ["laptop", "desktop", "server", "network_device", "mobile"],
      "default_value": null,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-20T14:45:00Z"
    },
    {
      "id": 2,
      "name": "device_status",
      "display_name": "Device Status",
      "description": "Current operational status of the device",
      "group": {
        "id": 1,
        "name": "hardware",
        "display_name": "Hardware Parameters"
      },
      "data_type": "choice",
      "required": true,
      "allowed_values": ["active", "inactive", "maintenance", "retired", "pending"],
      "default_value": "pending",
      "created_at": "2024-01-15T10:31:00Z",
      "updated_at": "2024-01-18T09:20:00Z"
    }
  ]
}

Response Codes:

Status Description
200 Success - Returns paginated list of inventory parameters
401 Unauthorized - Invalid or missing API token
400 Bad Request - Invalid query parameters (e.g., invalid group ID)

GET /inventory_parameter/{id}/

Description: Retrieves detailed information about a specific inventory parameter by its ID. This endpoint provides comprehensive parameter details including validation rules, allowed values, and usage constraints.

Use Cases:

  • Getting complete parameter definition before using it in inventory operations
  • Validating parameter configuration and allowed values
  • Building parameter-specific validation logic in client applications
  • Retrieving parameter metadata for administrative interfaces

Full URL Example:

https://control.zequenze.com/api/v1/inventory_parameter/1/?group=1

Parameters:

Parameter Type In Required Description
id integer path Yes Unique identifier of the inventory parameter to retrieve
group integer query No Filter parameters by group name field (additional context filtering)

cURL Example:

curl -X GET "https://control.zequenze.com/api/v1/inventory_parameter/1/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Example Response:

{
  "id": 1,
  "name": "device_type",
  "display_name": "Device Type",
  "description": "Categorizes inventory items by device type for proper management and reporting",
  "group": {
    "id": 1,
    "name": "hardware",
    "display_name": "Hardware Parameters",
    "description": "Parameters related to physical hardware configuration"
  },
  "data_type": "choice",
  "required": true,
  "allowed_values": [
    "laptop",
    "desktop", 
    "server",
    "network_device",
    "mobile",
    "tablet",
    "printer",
    "monitor"
  ],
  "default_value": null,
  "validation_rules": {
    "min_length": null,
    "max_length": null,
    "pattern": null,
    "custom_validation": "device_type_validator"
  },
  "usage_count": 1247,
  "is_active": true,
  "created_by": {
    "id": 5,
    "username": "admin",
    "email": "admin@company.com"
  },
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-20T14:45:00Z",
  "last_used": "2024-01-22T16:20:00Z"
}

Response Codes:

Status Description
200 Success - Returns detailed parameter information
401 Unauthorized - Invalid or missing API token
404 Not Found - Parameter with specified ID does not exist
400 Bad Request - Invalid parameter ID format

Common Use Cases

Use Case 1: Building Dynamic Inventory Forms

Retrieve all parameters for a specific group to populate form fields when creating new inventory items, ensuring users can only select valid parameter values.

# Get all hardware parameters for device creation form
GET https://control.zequenze.com/api/v1/inventory_parameter/?group=1&limit=50

Use Case 2: Parameter Validation

Before submitting inventory data, fetch specific parameter details to validate user input against allowed values and requirements.

# Validate device type parameter
GET https://control.zequenze.com/api/v1/inventory_parameter/1/

Use Case 3: Administrative Parameter Management

List all parameters with pagination to build administrative interfaces for managing inventory configuration options.

# Get paginated list of all parameters for admin panel
GET https://control.zequenze.com/api/v1/inventory_parameter/?limit=25&offset=0

Use Case 4: Group-Based Parameter Discovery

Filter parameters by specific groups to load only relevant configuration options for different inventory workflows.

# Get only software-related parameters
GET https://control.zequenze.com/api/v1/inventory_parameter/?group=2

Best Practices

  • Use Group Filtering: Filter by parameter groups to reduce response size and improve performance when you only need specific types of parameters
  • Implement Caching: Cache parameter lists on the client side since they change infrequently, but refresh when inventory configuration is updated
  • Validate Before Submission: Always fetch current parameter details to validate data before submitting inventory items, as allowed values may change
  • Handle Pagination: Use appropriate limit values (20-50 items) when listing parameters to balance performance and usability
  • Error Handling: Implement retry logic for network failures and graceful fallbacks when parameters are temporarily unavailable
  • Security: Never expose parameter validation logic that could reveal business rules; use these endpoints to get current constraints dynamically