📘 API Documentation: List Occupied Units
Base URL
https://property.ysgcloud.com.ng
Endpoint
/api/listoccupiedunits
Authentication
No authentication required. If added later, use Authorization: Bearer <token>.
Request
- Method: GET
- Headers:
Accept: application/json
Response
Returns an array of occupied unit objects with the following fields:
- PropertyNo
- UnitNo
- UnitName
- UnitDescription
- RentCost
Example Success Response
[
{
"PropertyNo": "P001",
"UnitNo": "U001",
"UnitName": "Flat A",
"UnitDescription": "3-Bedroom Apartment",
"RentCost": 180000
},
{
"PropertyNo": "P002",
"UnitNo": "U004",
"UnitName": "Penthouse",
"UnitDescription": "Luxury 4-Bedroom Penthouse",
"RentCost": 500000
}
]
Error Response
{
"status": "error",
"message": "Invalid request or server error"
}
Example Usage
JavaScript (Browser)
<script>
fetch("https://property.ysgcloud.com.ng/api/listoccupiedunits")
.then(response => {
if (!response.ok) throw new Error("Network error");
return response.json();
})
.then(occupiedUnits => {
console.log("Retrieved occupied units:", occupiedUnits);
occupiedUnits.forEach(u => {
console.log(
`PropertyNo: ${u.PropertyNo}, UnitNo: ${u.UnitNo}, UnitName: ${u.UnitName},
Description: ${u.UnitDescription}, RentCost: ${u.RentCost}`
);
});
})
.catch(err => console.error("Error:", err));
</script>
Postman
GET Request
- Method: GET
- URL:
https://property.ysgcloud.com.ng/api/listoccupiedunits - Headers:
Accept: application/json
Live Demo
Open your browser console to see the retrieved occupied unit data: