📘 API Documentation: List Tenants
Base URL
https://property.ysgcloud.com.ng
Endpoint
/api/listtenants
Authentication
No authentication required. If added later, use Authorization: Bearer <token>.
Request
- Method: GET
- Headers:
Accept: application/json
Response
Returns an array of tenant objects with the following fields:
- TenantsNo
- TenantsName
- Telephone
- Gender
- DateofBirth
Example Success Response
[
{
"TenantsNo": "T001",
"TenantsName": "Samuel Johnson",
"Telephone": "+2348012345678",
"Email": "samuel.johnson@example.com",
"Gender": "Male",
"DateofBirth": "1990-03-12"
},
{
"TenantsNo": "T002",
"TenantsName": "Mary Adams",
"Telephone": "+2348098765432",
"Email": "mary.adams@example.com",
"Gender": "Female",
"DateofBirth": "1985-07-25"
}
]
Error Response
{
"status": "error",
"message": "Invalid request or server error"
}
Example Usage
JavaScript (Browser)
<script>
fetch("https://property.ysgcloud.com.ng/api/listtenants")
.then(response => {
if (!response.ok) throw new Error("Network error");
return response.json();
})
.then(tenants => {
console.log("Retrieved tenants:", tenants);
tenants.forEach(t => {
console.log(
`No: ${t.TenantsNo}, Name: ${t.TenantsName}, Telephone: ${t.Telephone}, Email: ${t.Email},
Gender: ${t.Gender}, DOB: ${t.DateofBirth}`
);
});
})
.catch(err => console.error("Error:", err));
</script>
Postman
GET Request
- Method: GET
- URL:
https://property.ysgcloud.com.ng/api/listtenants - Headers:
Accept: application/json
Live Demo
Open your browser console to see the retrieved tenant data: