📘 API Documentation: List Properties
Base URL
https://property.ysgcloud.com.ng
Endpoint
/api/listproperties
Authentication
No authentication required. If added later, use Authorization: Bearer <token>.
Request
- Method: GET
- Headers:
Accept: application/json
Response
Returns an array of property objects with the following fields:
- ID
- PropertyNo
- PropertyName
- Category
- Landlord
- Town
- City
Example Success Response
[
{
"ID": 1,
"PropertyNo": "P001",
"PropertyName": "Broad Street Apartments",
"Category": "Residential",
"Landlord": "John Doe",
"Town": "Lagos Island",
"City": "Lagos"
},
{
"ID": 2,
"PropertyNo": "P002",
"PropertyName": "Marina Towers",
"Category": "Commercial",
"Landlord": "Jane Smith",
"Town": "Victoria Island",
"City": "Lagos"
}
]
Error Response
{
"status": "error",
"message": "Invalid request or server error"
}
Example Usage
JavaScript (Browser)
<script>
fetch("https://property.ysgcloud.com.ng/api/listproperties")
.then(response => {
if (!response.ok) throw new Error("Network error");
return response.json();
})
.then(properties => {
console.log("Retrieved properties:", properties);
properties.forEach(p => {
console.log(
`ID: ${p.ID}, PropertyNo: ${p.PropertyNo}, Name: ${p.PropertyName},
Category: ${p.Category}, Landlord: ${p.Landlord}, Town: ${p.Town}, City: ${p.City}`
);
});
})
.catch(err => console.error("Error:", err));
</script>
Postman
GET Request
- Method: GET
- URL:
https://property.ysgcloud.com.ng/api/listproperties - Headers:
Accept: application/json
Live Demo
Open your browser console to see the retrieved property data: