diff --git a/docs/API.md b/docs/API.md index 2379b9e..9d07cdc 100644 --- a/docs/API.md +++ b/docs/API.md @@ -183,6 +183,107 @@ This ASP API replaces the PHP api.php and provides the same functionality but ru --- +### 5. `getShopfloorPCs` + +**Purpose:** Returns list of all active shopfloor PCs for remote management + +**Method:** GET + +**Parameters:** None + +**Response:** +```json +{ + "success": true, + "count": 25, + "pcs": [ + { + "machineid": 123, + "hostname": "SHOPFLOOR-PC-01", + "machinenumber": "2001", + "serialnumber": "ABC123", + "loggedinuser": "jsmith", + "lastupdated": "2025-12-11 10:30:00", + "ipaddress": "10.134.100.50", + "pctype": "Shopfloor" + } + ] +} +``` + +--- + +### 6. `getRecordedIP` + +**Purpose:** Look up recorded primary IP (10.134.*) for a hostname + +**Method:** POST + +**Parameters:** +- `hostname` - PC hostname + +**Response:** +```json +{ + "success": true, + "hostname": "SHOPFLOOR-PC-01", + "ipaddress": "10.134.100.50" +} +``` + +--- + +### 7. `updateWinRMStatus` + +**Purpose:** Update WinRM enabled status for a PC + +**Method:** POST or GET + +**Parameters:** +- `hostname` - PC hostname +- `hasWinRM` - "1" or "0" (defaults to 1 if not specified) + +**Response:** +```json +{ + "success": true, + "message": "WinRM status updated", + "hostname": "SHOPFLOOR-PC-01", + "haswinrm": 1 +} +``` + +--- + +### 8. `updateMachinePositions` + +**Purpose:** Bulk update machine map positions (used by map editor) + +**Method:** POST + +**Parameters:** +- `changes` - JSON array of position changes + +**changes Format:** +```json +[ + {"id": 123, "newLeft": 450, "newTop": 200}, + {"id": 124, "newLeft": 500, "newTop": 250} +] +``` + +**Response:** +```json +{ + "success": true, + "message": "Updated 2 machine positions", + "updated": 2, + "errors": 0 +} +``` + +--- + ## JSON Formats ### Network Interfaces Format @@ -821,7 +922,7 @@ Monitor these metrics: --- -**Version:** 1.0 -**Last Updated:** 2025-11-13 +**Version:** 1.1 +**Last Updated:** 2025-12-11 **Maintained By:** ShopDB Development Team **Support:** Review `/logs/api.log` for troubleshooting