Skip to main content

Inventory Type

The Inventory Type API endpoints allow you to retrieve information about different types of inventory devices in your system. These endpoints are essential for understanding what device types are available and their specific configurations, making them useful for building device management interfaces and reporting systems.

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 categorize and describe the various types of inventory devices managed in your system. These device types serve as templates or profiles that define common characteristics, connection requirements, and properties for similar devices.

Key Concepts:

  • Device Types: Predefined categories that classify inventory devices (e.g., "Router", "Switch", "Server")
  • Connection Profiles: Associated configurations that define how to connect to devices of this type
  • Short Names: Slug-formatted identifiers used in reports, charts, and UI elements where space is limited

Common Integration Scenarios:

  • Populating dropdown menus when adding new inventory devices
  • Generating reports and analytics grouped by device type
  • Filtering and searching inventory based on device categories
  • Understanding connection requirements before attempting device communication
  • Building dashboards that display device distribution by type

These endpoints work together to provide both list and detailed views of device types, supporting pagination for large inventories and filtering capabilities for targeted queries.


Endpoints

GET /inventory_type/

Description: Retrieves a paginated list of all inventory device types in your system. This endpoint is ideal for populating selection interfaces, generating reports, or getting an overview of all available device categories. The response includes essential information about each device type including names, connection profiles, and descriptions.

Use Cases:

  • Loading device type options for dropdown menus when creating new inventory items
  • Generating reports showing the distribution of device types in your inventory
  • Building filters for inventory management interfaces
  • Auditing available device type configurations

Full URL Example:

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

Parameters:

Parameter Type In Required Description
name string query No Filter device types by name field. Supports partial matching to find device types containing the specified text
limit integer query No Number of results to return per page. Default is typically 10-50 depending on system configuration
offset integer query No The starting index for results. Use with limit for pagination (e.g., offset=20 with limit=10 gets results 21-30)

cURL Example:

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

Example Response:

{
  "count": 25,
  "next": "https://control.zequenze.com/api/v1/inventory_type/?limit=10&offset=10",
  "previous": null,
  "results": [
    {
      "id": 1,
      "name": "Cisco Catalyst Switch",
      "short_name": "cisco-catalyst-switch",
      "connection_profile": 3,
      "description": "Enterprise-grade managed switches with advanced Layer 2/3 features"
    },
    {
      "id": 2,
      "name": "Dell PowerEdge Server",
      "short_name": "dell-poweredge-server",
      "connection_profile": 7,
      "description": "Rack-mounted servers for data center and enterprise applications"
    },
    {
      "id": 3,
      "name": "Fortinet FortiGate Firewall",
      "short_name": "fortinet-fortigate-firewall",
      "connection_profile": 12,
      "description": "Next-generation firewall with integrated security features"
    }
  ]
}

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 (e.g., negative offset)

GET /inventory_type/{id}/

Description: Retrieves detailed information about a specific inventory device type by its unique ID. This endpoint provides the complete configuration and metadata for a single device type, including all fields that might be truncated or summarized in the list view.

Use Cases:

  • Getting complete details when a user selects a specific device type
  • Validating device type configuration before creating new inventory items
  • Displaying detailed device type information in management interfaces
  • Retrieving connection profile associations for device communication setup

Full URL Example:

https://control.zequenze.com/api/v1/inventory_type/15/

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 name field (typically redundant when using ID but available for consistency)

cURL Example:

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

Example Response:

{
  "id": 15,
  "name": "HPE ProCurve Switch",
  "short_name": "hpe-procurve-switch",
  "connection_profile": 8,
  "description": "HPE networking switches designed for small to medium business environments. Features include web-based management, VLAN support, and energy-efficient operation. Compatible with HPE Intelligent Management Center for centralized configuration and monitoring."
}

Response Codes:

Status Description
200 Success - Returns the requested device type details
401 Unauthorized - Invalid or missing API token
404 Not Found - Device type with specified ID does not exist

Common Use Cases

Use Case 1: Building Device Creation Interface

When building a form to add new inventory devices, use GET /inventory_type/ to populate a dropdown menu with available device types. Users can select the appropriate type, and then use GET /inventory_type/{id}/ to display additional details or validation rules for the selected type.

Use Case 2: Inventory Reporting and Analytics

Retrieve all device types with GET /inventory_type/ to generate reports showing device distribution. The short_name field is particularly useful for chart labels and condensed report formats where space is limited.

Use Case 3: Connection Profile Management

Use these endpoints to understand which connection profiles are associated with different device types. This is essential before attempting to establish connections to inventory devices, as each type may require specific protocols, ports, or authentication methods.

Use Case 4: Device Type Filtering

Implement search functionality by using the name parameter in GET /inventory_type/ to help users quickly find specific device types when working with large inventories containing many different equipment categories.

Use Case 5: Pagination for Large Inventories

For systems with many device types, implement pagination using the limit and offset parameters. Start with offset=0 and limit=20, then use the next URL from responses to load additional pages as users navigate through the available types.


Best Practices

  • Implement Caching: Device types typically don't change frequently, so consider caching the results from GET /inventory_type/ to reduce API calls and improve performance
  • Use Pagination Wisely: Set reasonable limit values (10-50) to balance performance with user experience. Very large limits can slow down responses
  • Handle Connection Profiles: Always check if a connection_profile is associated with a device type before attempting device connections. Null values indicate manual or undefined connection methods
  • Leverage Short Names: Use the short_name field for UI elements with space constraints, file naming, or generating reports where readable but compact identifiers are needed
  • Error Handling: Always handle 404 responses gracefully when requesting specific device types, as IDs may become invalid if types are deleted or reorganized
  • Name Filtering: The name filter supports partial matching, making it useful for implementing search-as-you-type functionality in user interfaces