Inventory Type
RetrieveThe Inventory Type API endpoints allow you to retrieve and manageinventorydevice type definitionsusedwithin your inventory system. These endpoints help you categorize and organize different types of devices, providing essential metadata forcategorizingdevicedevicesclassificationinandthemanagementsystem.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:
Common Use Cases:
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:
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 |
| limit | integer | query | No | Number of results to return per |
| offset | integer | query | No | The initial index from which to return |
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 |
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:
Full URL Example:
https://control.zequenze.com/api/v1/inventory_type/1/?name=server
Parameters:
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
| id | integer | path | Yes | |
| name | string | query | No |
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 |
| 404 | Not Found - |
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 nameparametercriteria.
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.
Security usingConsiderations: Ensure API tokens are stored securely and limitnever offsetparametersexposed whenin dealingclient-side withcode. largeConsider inventoriesimplementing token refresh mechanisms for long-running applications.
Performance Optimization: For applications that frequently access device type informationdetails, locallyconsider asbatching theserequests typicallyor changeimplementing infrequently
device_count