HTTP Method and Path
PUT /api/lockers/{lockerNo}
Path Parameters
The unique locker number of the locker to update
Request Body
The locker number (can be updated to a new value)
The employee number to assign to this locker. Set to empty string to unassign.
The physical location of the locker
Whether the locker is empty. This value is automatically calculated based on the employeeNumber field (false if employeeNumber is provided, true if empty).
Response
Returns the updated locker object.
The unique locker number identifier
The employee number assigned to this locker
The physical location of the locker
Indicates whether the locker is currently empty
Example Request
Update locker assignment
curl -X PUT https://api.example.com/api/lockers/A001 \
-H "Content-Type: application/json" \
-d '{
"lockerNo": "A001",
"employeeNumber": "EMP54321",
"size": 2,
"location": "Building A - Floor 1"
}'
Unassign employee from locker
curl -X PUT https://api.example.com/api/lockers/A001 \
-H "Content-Type: application/json" \
-d '{
"lockerNo": "A001",
"employeeNumber": "",
"size": 2,
"location": "Building A - Floor 1"
}'
Example Response
Success (200 OK)
{
"lockerNo": "A001",
"employeeNumber": "EMP54321",
"size": 2,
"location": "Building A - Floor 1",
"isEmpty": false
}
Error (404 Not Found)