List Units API Documentation

📘 API Documentation: List Units

Base URL

https://property.ysgcloud.com.ng

Endpoint

/api/listunits

Authentication

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

Request

Response

Returns an array of unit objects with the following fields:

Example Success Response

[
  {
    "PropertyNo": "P001",
    "UnitNo": "U001",
    "UnitName": "Flat A",
    "UnitDescriptio": "2-Bedroom Apartment",
    "RentCost": 150000
  },
  {
    "PropertyNo": "P001",
    "UnitNo": "U002",
    "UnitName": "Flat B",
    "UnitDescriptio": "3-Bedroom Apartment",
    "RentCost": 200000
  }
]

Error Response

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

Example Usage

JavaScript (Browser)

<script>
fetch("https://property.ysgcloud.com.ng/api/listunits")
  .then(response => {
      if (!response.ok) throw new Error("Network error");
      return response.json();
  })
  .then(units => {
      console.log("Retrieved units:", units);
      units.forEach(u => {
          console.log(
              `PropertyNo: ${u.PropertyNo}, UnitNo: ${u.UnitNo}, UnitName: ${u.UnitName}, Description: ${u.UnitDescriptio}, RentCost: ${u.RentCost}`
          );
      });
  })
  .catch(err => console.error("Error:", err));
</script>

Postman

GET Request

Live Demo

Open your browser console to see the retrieved data: