Room Drawings API
Manage floor plans and elevations for project rooms.
GET /api/v1/rooms/{roomId}/drawings
Get drawings for a room.
Response
{
"success": true,
"data": {
"roomId": 1,
"roomName": "Conference Room A",
"drawings": [
{
"id": 1,
"roomId": 1,
"hasFloorPlan": true,
"hasSourceImage": true,
"hasData": true,
"createdAt": "2024-12-10T09:00:00Z",
"updatedAt": "2024-12-15T14:30:00Z"
}
],
"hasDrawing": true
}
}
POST /api/v1/rooms/{roomId}/drawings
Create a drawing for a room.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
dataJson |
string | No | JSON string containing drawing measurement data |
floorPlanImageKey |
string | No | S3 key for floor plan image |
sourceImageKey |
string | No | S3 key for source image/PDF |
Example Request
{
"dataJson": "{...drawing data...}"
}
Response (201 Created)
{
"success": true,
"data": {
"drawingId": 1,
"roomId": 1,
"message": "Drawing created successfully"
}
}
One Drawing Per Room
Each room can have at most one drawing. Use PUT to update an existing drawing.
GET /api/v1/drawings/{id}
Get drawing details including image keys and data.
Response
{
"success": true,
"data": {
"drawing": {
"id": 1,
"roomId": 1,
"roomName": "Conference Room A",
"floorPlanImageKey": "drawings/fp_abc123.png",
"sourceImageKey": "drawings/src_abc123.pdf",
"dataJson": "{...measurement data...}",
"createdAt": "2024-12-10T09:00:00Z",
"updatedAt": "2024-12-15T14:30:00Z"
}
}
}
PUT /api/v1/drawings/{id}
Update a drawing's data or image keys. All fields are optional.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
dataJson |
string | No | JSON string containing drawing measurement data |
floorPlanImageKey |
string | No | S3 key for floor plan image |
sourceImageKey |
string | No | S3 key for source image/PDF |
Example Request
{
"dataJson": "{...updated measurement data...}",
"floorPlanImageKey": "drawings/fp_updated.png",
"sourceImageKey": "drawings/src_updated.pdf"
}
DELETE /api/v1/drawings/{id}
Delete a room drawing.
Response
{
"success": true,
"data": {
"drawingId": 1,
"roomId": 1,
"message": "Drawing deleted successfully"
}
}