Overview
This API endpoint allows you to fetch all sites associated with your company. Sites represent the top-level locations in the Mosler hierarchy (Company → Site → Building → Floor → Room → Bed).
Endpoint Details
Method
GET
URL
https://api.mosler.in/api/v3/location/sites
Authentication
|
apikey | string | Yes | Your API key for authentication |
Content-Type | string | No | application/json |
Query Parameters
|
page | number | No | Page number for pagination (default: 1) |
limit | number | No | Number of sites 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 sites data and pagination info |
Data Object Structure
|
sites | array | Array of site objects |
pagination | object | Pagination information |
total | number | Total number of sites available |
Site Object Structure
|
name | string | The name of the site |
_id | string | The unique identifier of the site |
|
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": "Sites retrieved successfully",
"code": 7005,
"error": false,
"data": {
"sites": [
{
"name": "Delhi",
"_id": "6660745995a565fe29d81897"
},
{
"name": "Bangalore",
"_id": "6530f9dce0c1bd73ded0d1be"
}
],
"pagination": {
"currentPage": 1,
"totalPages": 1,
"hasNext": false,
"hasPrevious": false
},
"total": 2
}
}