📘 API Documentation: List Landlords
Base URL
https://property.ysgcloud.com.ng
Endpoint
/api/listlandlords
Authentication
No authentication required. If added later, use Authorization: Bearer <token>.
Request
- Method: GET
- Headers:
Accept: application/json
Response
Returns an array of landlord objects with the following fields:
- LandlordNo
- LandlordName
- Telephone
- ContactAddress
- Gender
- DateofBirth
Example Success Response
[
{
"LandlordNo": "L001",
"LandlordName": "John Doe",
"Telephone": "+2348012345678",
"Email": "john.doe@example.com",
"ContactAddress": "12 Broad Street, Lagos",
"Gender": "Male",
"DateofBirth": "1975-06-15"
},
{
"LandlordNo": "L002",
"LandlordName": "Jane Smith",
"Telephone": "+2348098765432",
"Email": "jane.smith@example.com",
"ContactAddress": "45 Marina Road, Abuja",
"Gender": "Female",
"DateofBirth": "1980-09-20"
}
]
Error Response
{
"status": "error",
"message": "Invalid request or server error"
}
Example Usage
JavaScript (Browser)
<script>
fetch("https://property.ysgcloud.com.ng/api/listlandlords")
.then(response => {
if (!response.ok) throw new Error("Network error");
return response.json();
})
.then(landlords => {
console.log("Retrieved landlords:", landlords);
landlords.forEach(l => {
console.log(
`No: ${l.LandlordNo}, Name: ${l.LandlordName}, Telephone: ${l.Telephone}, Email: ${l.Email},
Address: ${l.ContactAddress}, Gender: ${l.Gender}, DOB: ${l.DateofBirth}`
);
});
})
.catch(err => console.error("Error:", err));
</script>
Postman
GET Request
- Method: GET
- URL:
https://property.ysgcloud.com.ng/api/listlandlords - Headers:
Accept: application/json
Live Demo
Open your browser console to see the retrieved landlord data: