Overview
This API endpoint allows you to fetch all buildings under a specific site in your company.
Endpoint Details
Method
GET
URL
https://api.mosler.in/api/v3/location/buildings
Authentication
|
apikey | string | Yes | Your API key for authentication |
Content-Type | string | No | application/json |
Query Parameters
|
site_id | string | Yes | The unique identifier of the site |
page | number | No | Page number for pagination (default: 1) |
limit | number | No | Number of buildings per page (default: 100, max: 100) |
Response Format
Success Response
|
message | string | Success message describing the operation |
code | number | Status code indicating successful operation |
error | boolean | Always false for successful responses |
data | object | Object containing buildings data and pagination info |
Data Object Structure
|
buildings | array | Array of building objects |
pagination | object | Pagination information |
total | number | Total number of buildings available |
Building Object Structure
|
name | string | The name of the building |
_id | string | The unique id of building |
|
currentPage | number | Current page number |
totalPages | number | Total number of pages available |
hasNext | boolean | Whether there are more pages |
hasPrevious | boolean | Whether there are previous pages |
Response Examples
Successful Response
{
"message": "Buildings retrieved successfully",
"code": 7006,
"error": false,
"data": {
"buildings": [
{ "name": "Main Tower", "_id": "6660745995a565fe29d81897" },
{ "name": "Annex", "_id": "53dcs9dce0c1bd73ded0d1be" }
],
"pagination": {
"currentPage": 1,
"totalPages": 1,
"hasNext": false,
"hasPrevious": false
},
"total": 2
}
}