List Vacant Units API Documentation

📘 API Documentation: List Vacant Units

Base URL

https://property.ysgcloud.com.ng

Endpoint

/api/listvacantunits

Authentication

No authentication required. If added later, use Authorization: Bearer <token>.

Request

Response

Returns an array of vacant unit objects with the following fields:

Example Success Response

[
  {
    "PropertyNo": "P001",
    "UnitNo": "U003",
    "UnitName": "Flat C",
    "UnitDescription": "2-Bedroom Apartment",
    "RentCost": 120000
  },
  {
    "PropertyNo": "P002",
    "UnitNo": "U005",
    "UnitName": "Studio",
    "UnitDescription": "Self-contained studio apartment",
    "RentCost": 80000
  }
]

Error Response

{
  "status": "error",
  "message": "Invalid request or server error"
}

Example Usage

JavaScript (Browser)

<script>
fetch("https://property.ysgcloud.com.ng/api/listvacantunits")
  .then(response => {
      if (!response.ok) throw new Error("Network error");
      return response.json();
  })
  .then(vacantUnits => {
      console.log("Retrieved vacant units:", vacantUnits);
      vacantUnits.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

Live Demo

Open your browser console to see the retrieved vacant unit data: