v3/Location API's

Get Floors

Overview

This API endpoint allows you to fetch all floors under a specific building in your company.

Endpoint Details

Method

GET

URL

https://api.mosler.in/api/v3/location/floors

Authentication

Headers

NameTypeRequiredDescription
apikeystringYesYour API key for authentication
Content-TypestringNoapplication/json

Query Parameters

NameTypeRequiredDescription
building_idstringYesThe unique identifier of the building
pagenumberNoPage number for pagination (default: 1)
limitnumberNoNumber of floors 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 floors data and pagination info

Data Object Structure

NameTypeDescription
floorsarrayArray of floor objects
paginationobjectPagination information
totalnumberTotal number of floors available

Floor Object Structure

NameTypeDescription
namestringThe name of the floor
_idstringThe unique id of floor

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": "Floors retrieved successfully",
    "code": 7007,
    "error": false,
    "data": {
        "floors": [
            { "name": "1", "_id": "53dcs9dce0c1bd73ded0d1be" },
            { "name": "2", "_id": "2523ddce0c1bd73ded0d1be" }
        ],
        "pagination": {
            "currentPage": 1,
            "totalPages": 1,
            "hasNext": false,
            "hasPrevious": false
        },
        "total": 2
    }
}