v3/Location API's

Get Sites

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

Headers

NameTypeRequiredDescription
apikeystringYesYour API key for authentication
Content-TypestringNoapplication/json

Query Parameters

NameTypeRequiredDescription
pagenumberNoPage number for pagination (default: 1)
limitnumberNoNumber of sites per page (default: 100, max: 100)

Response Format

Success Response

NameTypeDescription
messagestringSuccess message describing the operation
codenumberStatus code indicating successful operation
errorbooleanAlways false for successful responses
dataobjectObject containing sites data and pagination info

Data Object Structure

NameTypeDescription
sitesarrayArray of site objects
paginationobjectPagination information
totalnumberTotal number of sites available

Site Object Structure

NameTypeDescription
namestringThe name of the site
_idstringThe unique identifier of the site

Pagination Object Structure

NameTypeDescription
currentPagenumberCurrent page number
totalPagesnumberTotal number of pages available
hasNextbooleanWhether there are more pages
hasPreviousbooleanWhether 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
    }
}