v3/Location API's

Get Rooms

Overview

This API endpoint allows you to fetch all rooms under a specific floor in your company.

Endpoint Details

Method

GET

URL

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

Authentication

Headers

NameTypeRequiredDescription
apikeystringYesYour API key for authentication
Content-TypestringNoapplication/json

Query Parameters

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

Data Object Structure

NameTypeDescription
roomsarrayArray of room objects
paginationobjectPagination information
totalnumberTotal number of rooms available

Room Object Structure

NameTypeDescription
namestringThe name of the room
_idstringThe unique id of room

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": "Rooms retrieved successfully",
    "code": 7008,
    "error": false,
    "data": {
        "rooms": [
            { "name": "101", "_id": "6530f9dce0c1bd73ded0d1be" },
            { "name": "102", "_id": "6530f9dce0c1bd73ded0d1be" }
        ],
        "pagination": {
            "currentPage": 1,
            "totalPages": 1,
            "hasNext": false,
            "hasPrevious": false
        },
        "total": 2
    }
}