v3/Location API's

Get Beds

Overview

This API endpoint allows you to fetch all beds under a specific room in your company.

Endpoint Details

Method

GET

URL

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

Authentication

Headers

NameTypeRequiredDescription
apikeystringYesYour API key for authentication
Content-TypestringNoapplication/json

Query Parameters

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

Data Object Structure

NameTypeDescription
bedsarrayArray of bed objects
paginationobjectPagination information
totalnumberTotal number of beds available

Bed Object Structure

NameTypeDescription
namestringThe name of the bed
_idstringThe unique id of bed

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": "Beds retrieved successfully",
    "code": 7009,
    "error": false,
    "data": {
        "beds": [
            { "name": "a", "_id": "6530f9dce0c1bd73ded0d1be" },
            { "name": "b", "_id": "6530f9dce0c1bd73ded0d1be" }
        ],
        "pagination": {
            "currentPage": 1,
            "totalPages": 1,
            "hasNext": false,
            "hasPrevious": false
        },
        "total": 2
    }
}