Overview
The Building Floor Plan API provides comprehensive device management for building infrastructure including PCs, servers, network equipment, and security cameras. Features include interactive positioning on floor plans, encrypted credential storage, and detailed device tracking.Get All Devices
Retrieve all devices for the interactive floor plan with optional filtering.Required Permissions
ver-plano-edificio
Query Parameters
Filter by device types. Available types:
pc- Personal Computerpuesto_cecoco- CECOCO Workstationpuesto_video- Video Workstationrouter- Routerswitch- Network Switchcamara_interna- Internal Cameraservidor- Serverservidor_cecoco- CECOCO Serverservidor_nebula- Nebula Servergrabador_nebula- Nebula Recordernvr- Network Video Recorderaccess_point- Wireless Access Point
Filter by office name (partial match supported)
Filter by floor level
Filter by active status (“true” or “false”)
Response
Indicates if the request was successful
Array of device objects
Total number of devices returned
Device Object Fields
Unique device identifier
Device type code (e.g., “pc”, “router”, “servidor”)
Device name
IP address
MAC address
Device brand/manufacturer
Device model
Serial number
Office location
Floor level
X coordinate on floor plan (0-100, percentage-based)
Y coordinate on floor plan (0-100, percentage-based)
Operating system (required for PCs and servers)
Number of ports (required for routers, switches, access points)
Additional notes
Device active status
Indicates if device has stored credentials
FontAwesome icon class for the device type
Hex color code for the device type
Human-readable device type label
Creation timestamp (format: d/m/Y H:i)
Last update timestamp (format: d/m/Y H:i)
Example Request
Example Response
Get Single Device
Retrieve detailed information for a specific device.Required Permissions
ver-plano-edificiocredenciales-plano-edificio(optional, for viewing credentials)
Path Parameters
The device ID
Response
Same as device object in Get All Devices, with additional fields:Device username (only visible with
credenciales-plano-edificio permission)Device password - automatically decrypted (only visible with
credenciales-plano-edificio permission)Name of user who created the device
Name of user who last updated the device
Example Request
Create Device
Create a new device in the building floor plan.Required Permissions
crear-plano-edificiocredenciales-plano-edificio(optional, for storing credentials)
Request Body
Device type. Must be one of:
pc, puesto_cecoco, puesto_video, router, switch, camara_interna, servidor, servidor_cecoco, servidor_nebula, grabador_nebula, nvr, access_pointDevice name (max 200 characters)
Valid IP address
MAC address in format: XX:XX:XX:XX:XX:XX or XX-XX-XX-XX-XX-XX
Brand/manufacturer (max 100 characters)
Model name (max 100 characters)
Serial number (max 100 characters)
Office location (max 200 characters)
Floor level (max 50 characters)
X coordinate on floor plan (0-100)
Y coordinate on floor plan (0-100)
Operating system (max 100 characters). Required for types:
pc, servidor, servidor_cecoco, servidor_nebulaNumber of ports (1-48). Required for types:
router, switch, access_pointDevice access username (max 255 characters). Requires
credenciales-plano-edificio permission.Device access password (max 2048 characters). Automatically encrypted before storage. Requires
credenciales-plano-edificio permission.Additional notes (max 1000 characters)
Device active status
Example Request
Response
Passwords are automatically encrypted using Laravel’s
Crypt::encryptString() before storage. You cannot retrieve the plain text password later without the credenciales-plano-edificio permission.Update Device
Update an existing device.Required Permissions
editar-plano-edificiocredenciales-plano-edificio(optional, for updating credentials)
Path Parameters
The device ID to update
Request Body
Same parameters as Create Device. All fields can be updated.Example Request
Response
Update Device Position
Update only the position coordinates of a device on the floor plan.Required Permissions
posicionar-plano-edificio
Path Parameters
The device ID
Request Body
X coordinate (0-100)
Y coordinate (0-100)
Example Request
Response
This endpoint is optimized for interactive drag-and-drop functionality. It only updates the position fields and the
updated_by timestamp, making it faster than a full device update.Delete Device
Delete a device from the system.Required Permissions
borrar-plano-edificio
Path Parameters
The device ID to delete
Response
Example Request
Devices use soft deletes, so they are not permanently removed from the database. They can be restored if needed.
Get Device Credentials
Retrieve the stored credentials for a device.Required Permissions
credenciales-plano-edificio
Path Parameters
The device ID
Response
Indicates if credentials were retrieved
Object containing username and decrypted password
Example Request
Success Response
Error Response (No Credentials)
This endpoint automatically decrypts stored passwords using Laravel’s
Crypt::decryptString(). Access is restricted to users with the credenciales-plano-edificio permission.Export Devices to Excel
Export devices to an Excel file with optional filtering.Required Permissions
exportar-plano-edificio
Query Parameters
Filter by device types
Filter by office
Filter by floor
Filter by active status
Response
Downloads an Excel file namedDispositivosEdificio_{timestamp}.xlsx.
Credentials are only included in the export if the user has the
credenciales-plano-edificio permission. Otherwise, those columns will be empty.Example Request
Device Types Reference
| Type | Label | Icon | Required Fields |
|---|---|---|---|
pc | PC | fas fa-desktop | sistema_operativo |
puesto_cecoco | Puesto CECOCO | fas fa-headset | - |
puesto_video | Puesto de Video | fas fa-video | - |
router | Router | fas fa-wifi | puertos |
switch | Switch | fas fa-network-wired | puertos |
camara_interna | Cámara Interna | fas fa-video | - |
servidor | Servidor | fas fa-server | sistema_operativo |
servidor_cecoco | Servidor CECOCO | fas fa-server | sistema_operativo |
servidor_nebula | Servidor Nebula | fas fa-cloud | sistema_operativo |
grabador_nebula | Grabador Nebula | fas fa-record-vinyl | - |
nvr | NVR | fas fa-hdd | - |
access_point | Access Point | fas fa-broadcast-tower | puertos |
Operating Systems
Supported operating systems for PCs and servers:- Windows 10
- Windows 11
- Windows Server 2012 R2
- Windows Server 2019
- Windows Server 2022
- Ubuntu 20.04
- Ubuntu 22.04
- CentOS 7
- CentOS 8
- Debian 10
- Debian 11
- Otro (Other)
Error Codes
Validation failed. Common errors:
- Invalid device type
- Missing required fields based on device type
- Invalid IP or MAC format
- Position coordinates out of range (0-100)
- Ports out of range (1-48)
Missing required permission for the operation
Device not found or device has no credentials
Database transaction failed:
Security Features
Password Encryption
All device passwords are automatically encrypted before storage using Laravel’s encryption:Permission-Based Access
The API implements granular permissions:ver-plano-edificio- View devicescrear-plano-edificio- Create deviceseditar-plano-edificio- Update devicesposicionar-plano-edificio- Update device positionsborrar-plano-edificio- Delete devicescredenciales-plano-edificio- View/edit credentialsexportar-plano-edificio- Export to Excel
Audit Trail
All devices track:created_by- User who created the deviceupdated_by- User who last modified the devicecreated_at- Creation timestampupdated_at- Last modification timestamp- Soft deletes for recovery
Interactive Floor Plan
The floor plan uses a percentage-based coordinate system (0-100) for both X and Y axes:posicion_x: Horizontal position (0 = left edge, 100 = right edge)posicion_y: Vertical position (0 = top edge, 100 = bottom edge)