Skip to main content

Inventory Type

The Inventory Type API endpoints allow you to retrieve and manage device type definitions within your inventory system. These endpoints help you categorize and organize different types of devices, providing essential metadata for device classification and 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 Type API provides access to device type definitions that serve as templates or categories for your inventory management system. Device types define the characteristics, capabilities, and classifications that can be applied to physical devices in your inventory.

Key Concepts:

  • Device Types: Predefined categories that describe different kinds of devices (e.g., "Server", "Router", "Switch", "Laptop")
  • Type Profiles: Each type contains metadata like name, description, and configuration parameters
  • Filtering: Search and filter types by name to quickly find specific device categories

Common Use Cases:

  • Populating dropdown menus for device creation forms
  • Validating device assignments against available types
  • Building device catalogs and inventory reports
  • Managing device classification standards across your organization

These endpoints work together to provide both list views for browsing all available device types and detailed views for examining specific type configurations.


Endpoints

GET /inventory_type/

Description: Retrieves a paginated list of all available inventory device types. This endpoint supports filtering by name and pagination controls, making it ideal for building user interfaces that need to display device type options or for administrative views that manage device classifications.

Use Cases:

  • Populate dropdown menus when creating new devices
  • Build administrative interfaces for managing device types
  • Generate reports on available device categories
  • Implement search functionality for device type selection

Full URL Example:

https://control.zequenze.com/api/v1/inventory_type/?name=server&limit=20&offset=0

Parameters:

Parameter Type In Required Description
name string query No Filter device types by partial or exact match on the 'name' field. Case-insensitive search.
limit integer query No Number of results to return per page. Default is typically 20. Maximum recommended is 100.
offset integer query No The initial index from which to return results. Used for pagination (e.g., offset=20 for page 2 with limit=20).

cURL Example:

curl -X GET "https://control.zequenze.com/api/v1/inventory_type/?name=server&limit=10&offset=0" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"

Example Response:

{
  "count": 45,
  "next": "https://control.zequenze.com/api/v1/inventory_type/?limit=10&offset=10",
  "previous": null,
  "results": [
    {
      "id": 1,
      "name": "Dell PowerEdge Server",
      "category": "server",
      "description": "Enterprise rack-mounted server hardware",
      "manufacturer": "Dell",
      "specifications": {
        "form_factor": "rack",
        "power_consumption": "350W",
        "dimensions": "1U"
      },
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    },
    {
      "id": 2,
      "name": "HP ProLiant Server",
      "category": "server",
      "description": "High-performance server for enterprise workloads",
      "manufacturer": "HP",
      "specifications": {
        "form_factor": "rack",
        "power_consumption": "400W",
        "dimensions": "2U"
      },
      "created_at": "2024-01-14T15:20:00Z",
      "updated_at": "2024-01-14T15:20:00Z"
    }
  ]
}

Response Codes:

Status Description
200 Success - Returns paginated list of device types
401 Unauthorized - Invalid or missing API token
400 Bad Request - Invalid query parameters

GET /inventory_type/{id}/

Description: Retrieves detailed information about a specific inventory device type by its unique identifier. This endpoint returns comprehensive details about the device type, including all specifications, metadata, and configuration options associated with that particular type.

Use Cases:

  • Display detailed device type information in administrative panels
  • Validate device specifications before creating inventory items
  • Retrieve type-specific configuration templates
  • Build device comparison tools

Full URL Example:

https://control.zequenze.com/api/v1/inventory_type/1/?name=server

Parameters:

Parameter Type In Required Description
id integer path Yes The unique identifier of the device type to retrieve
name string query No Additional filter by device profile name field (typically used for validation or cross-reference)

cURL Example:

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

Example Response:

{
  "id": 1,
  "name": "Dell PowerEdge Server",
  "category": "server",
  "description": "Enterprise rack-mounted server hardware with redundant power supplies and hot-swappable components",
  "manufacturer": "Dell",
  "model_series": "PowerEdge R740",
  "specifications": {
    "form_factor": "rack",
    "rack_units": 2,
    "power_consumption": "350W",
    "max_power": "750W",
    "dimensions": {
      "height": "87mm",
      "width": "482mm",
      "depth": "625mm"
    },
    "weight": "18.5kg",
    "operating_temperature": "10-35°C",
    "supported_os": ["Windows Server", "Linux", "VMware ESXi"]
  },
  "default_configuration": {
    "cpu_sockets": 2,
    "max_memory": "512GB",
    "storage_bays": 8,
    "network_ports": 4
  },
  "compliance_standards": ["FCC", "CE", "ENERGY_STAR"],
  "warranty_period": "3_years",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z",
  "created_by": {
    "id": 12,
    "username": "admin",
    "email": "admin@company.com"
  }
}

Response Codes:

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

Common Use Cases

Use Case 1: Building Device Creation Forms

When building user interfaces for adding new devices to inventory, use the list endpoint to populate dropdown menus with available device types. Filter by name to implement type-ahead search functionality.

GET /inventory_type/?name=cisco&limit=10

Use Case 2: Device Type Management Dashboard

Administrative users need to browse and manage all device types. Use the list endpoint with pagination to build management interfaces, then use the detail endpoint to show comprehensive information when users select specific types.

Use Case 3: Inventory Validation and Reporting

Before creating inventory items, validate that the specified device type exists and retrieve its specifications. Use the detail endpoint to ensure compatibility and generate detailed inventory reports with type specifications.

Use Case 4: Device Catalog Generation

Generate public or internal device catalogs by combining both endpoints - use the list to get all types, then fetch details for each to build comprehensive product catalogs with full specifications.


Best Practices

  • Implement Caching: Device types typically change infrequently. Cache list responses for 15-30 minutes to improve performance, especially for dropdown populations.

  • Use Pagination Effectively: When displaying large lists of device types, implement proper pagination with reasonable page sizes (10-25 items) to maintain good user experience.

  • Handle Filtering Gracefully: When implementing search functionality, debounce user input and provide clear feedback when no results match the filter criteria.

  • Error Handling: Always check for 404 responses when fetching specific device types by ID, as types may be removed or archived. Implement fallback behavior for missing types.

  • Security Considerations: Ensure API tokens are stored securely and never exposed in client-side code. Consider implementing token refresh mechanisms for long-running applications.

  • Performance Optimization: For applications that frequently access device type details, consider batching requests or implementing a local cache strategy to reduce API calls.