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
|
apikey | string | Yes | Your API key for authentication |
Content-Type | string | No | application/json |
Query Parameters
|
room_id | string | Yes | The unique identifier of the room |
page | number | No | Page number for pagination (default: 1) |
limit | number | No | Number of beds 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 beds data and pagination info |
Data Object Structure
|
beds | array | Array of bed objects |
pagination | object | Pagination information |
total | number | Total number of beds available |
Bed Object Structure
|
name | string | The name of the bed |
_id | string | The unique id of bed |
|
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": "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
}
}