Skip to main content

Inventory Type

RetrieveThe Inventory Type API endpoints allow you to retrieve and manage inventory device type definitions usedwithin your inventory system. These endpoints help you categorize and organize different types of devices, providing essential metadata for categorizingdevice devicesclassification inand themanagement system.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/

      RetrieveDescription: Retrieves a paginated list of all available inventory device typestypes. withThis optionalendpoint supports filtering by name.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 devicepartial profileor exact match on the 'name' fieldfield. Case-insensitive search.
        limit integer query No Number of results to return per pagepage. Default is typically 20. Maximum recommended is 100.
        offset integer query No The initial index from which to return theresults. resultsUsed for pagination (e.g., offset=20 for page 2 with limit=20).

        ExamplecURL Request:Example:

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

        Example Response:

        {
          "count": 25,45,
          "next": "https://control.zequenze.com/api/v1/inventory_type/?limit=10&offset=10",
          "previous": null,
          "results": [
            {
              "id": 1,
              "name": "Router"Dell PowerEdge Server",
              "category": "server",
              "description": "NetworkEnterprise routingrack-mounted devices"server hardware",
              "category"manufacturer": "networking"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": "Switch"HP ProLiant Server",
              "category": "server",
              "description": "NetworkHigh-performance switchingserver devices"for enterprise workloads",
              "category"manufacturer": "networking"HP",
              "specifications": {
                "form_factor": "rack",
                "power_consumption": "400W",
                "dimensions": "2U"
              },
              "created_at": "2024-01-15T10:35:14T15:20:00Z",
              "updated_at": "2024-01-15T10:35:14T15:20:00Z"
            }
          ]
        }
        

        Response Codes:

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

        GET /inventory_type/{id}/

        RetrieveDescription: 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 UniqueThe unique identifier of the inventory device type to retrieve
          name string query No FilterAdditional devicefilter by device profile 'name'name field (typically used for validation or cross-reference)

          ExamplecURL Request: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": "Router"Dell PowerEdge Server",
            "category": "server",
            "description": "NetworkEnterprise routingrack-mounted devicesserver forhardware managingwith trafficredundant betweenpower networks"supplies and hot-swappable components",
            "category"manufacturer": "networking"Dell",
            "model_series": "PowerEdge R740",
            "specifications": {
              "port_count"form_factor": "variable"rack",
              "management_interface"rack_units": "required",2,
              "power_consumption": "varies"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",
            "device_count"created_by": 15{
              "id": 12,
              "username": "admin",
              "email": "admin@company.com"
            }
          }
          

          Response Codes:

          Status Description
          200 Success - Returns detailed device type information
          401 Unauthorized - Invalid or missing BearerAPI token
          404 Not Found - InventoryDevice 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 namefilter parametercriteria.

          to quickly locate

          Error Handling: Always check for 404 responses when fetching specific device types withoutby retrievingID, theas fulltypes listmay be removed or archived. Implement fallback behavior for missing types.

          Implement pagination

          Security usingConsiderations: limitEnsure API tokens are stored securely and offsetnever parametersexposed whenin dealingclient-side withcode. largeConsider inventoriesimplementing token refresh mechanisms for long-running applications.

          Cache

          Performance Optimization: For applications that frequently access device type informationdetails, locallyconsider asbatching theserequests typicallyor changeimplementing infrequently

          a Handlelocal 404cache errors gracefully when requesting specific device types that may have been removed Consider the device_count field in individual responsesstrategy to understandreduce usageAPI beforecalls. making changes