Skip to main content

Inventory Type

Retrieve and manage inventory device type definitions used for categorizing devices in the system.

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

Authentication: All endpoints require a Bearer token:

Authorization: Bearer <your-api-token>

Endpoints

GET /inventory_type/

Retrieve a paginated list of all inventory device types with optional filtering by name.

Parameters:

Parameter Type In Required Description
name string query No Filter device types by device profile 'name' field
limit integer query No Number of results to return per page
offset integer query No The initial index from which to return the results

Example Request:

GET /api/v1/inventory_type/?name=router&limit=10&offset=0

Example Response:

{
  "count": 25,
  "next": "https://control.zequenze.com/api/v1/inventory_type/?limit=10&offset=10",
  "previous": null,
  "results": [
    {
      "id": 1,
      "name": "Router",
      "description": "Network routing devices",
      "category": "networking",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    },
    {
      "id": 2,
      "name": "Switch",
      "description": "Network switching devices",
      "category": "networking",
      "created_at": "2024-01-15T10:35:00Z",
      "updated_at": "2024-01-15T10:35:00Z"
    }
  ]
}
Status Description
200 Success
401 Unauthorized - Invalid or missing Bearer token

GET /inventory_type/{id}/

Retrieve detailed information about a specific inventory device type by its unique identifier.

Parameters:

Parameter Type In Required Description
id integer path Yes Unique identifier of the inventory device type
name string query No Filter device by device profile 'name' field

Example Request:

GET /api/v1/inventory_type/1/

Example Response:

{
  "id": 1,
  "name": "Router",
  "description": "Network routing devices for managing traffic between networks",
  "category": "networking",
  "specifications": {
    "port_count": "variable",
    "management_interface": "required",
    "power_consumption": "varies"
  },
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z",
  "device_count": 15
}
Status Description
200 Success
401 Unauthorized - Invalid or missing Bearer token
404 Not Found - Inventory type with specified ID does not exist

Best Practices

  • Use the name parameter to quickly locate specific device types without retrieving the full list
  • Implement pagination using limit and offset parameters when dealing with large inventories
  • Cache device type information locally as these typically change infrequently
  • Handle 404 errors gracefully when requesting specific device types that may have been removed
  • Consider the device_count field in individual responses to understand usage before making changes