Get Zones
Get all zones of area.
Description
This action allows you to retrieve all zones within a area, including:
- Zone Address
- Zone Name
- Area Information
Request Topic
LYT/41e0d6b2-37de-43d8-a348-4ba94853b6cd/AREA/ACTION
Request Payload
{
"version": "v1.0",
"action": "get-zones",
"limit": 2,
"offset": 1,
"data": {
"area_uuid": "8067232e-b301-47c6-99d6-d4cf04369114"
}
}
Request Field Descriptions
| Field | Type | Required | Description |
|---|---|---|---|
| version | string | Yes | API version identifier (must be "v1.0") |
| action | string | Yes | Action to perform (must be "get-zones") |
| area_uuid | string | Yes | Area UUID should be like this : data > area_uuid |
| limit | number | No | Maximum number of records to return (default: 50) |
| offset | number | No | Number of records to skip (default: 0) |
Response Topic
LYT/41e0d6b2-37de-43d8-a348-4ba94853b6cd/AREA/E/ACTION
Response Payload
Success Response
{
"message": "success",
"version": "v1.0",
"action": "get-zones",
"data": [
{
"zone_address": 51507,
"zone_name": "102",
"area_uuid": "8067232e-b301-47c6-99d6-d4cf04369114",
"area_name": "Taj hotel 1",
"models": [
{ "type": "cct" },
{ "type": "switch" }
]
},
{
"zone_address": 52747,
"zone_name": "101",
"area_uuid": "8067232e-b301-47c6-99d6-d4cf04369114",
"area_name": "Taj hotel 1",
"models": [
{ "type": "cct" },
{ "type": "curtain" },
{ "type": "dimmer" },
{ "type": "fan" },
{ "type": "rgb" },
{ "type": "switch" }
]
}
]
}
Error Handling
1. Project Not Found Error (Code: 2002)
{
"message": "error",
"message_type": {
"code": 2002,
"message": "Project not found",
"errorCode": "PROJECT_NOT_FOUND"
}
}
When it occurs:
- The project UUID is invalid
- The project has been deleted
- The user doesn't have access to the project
How to resolve:
- Verify the project UUID is correct
- Check if you have the necessary permissions
- Ensure the project exists
- Contact system administrator if you should have access
2. Area Not Found Error (Code: 2003)
{
"message": "error",
"message_type": {
"code": 2003,
"message": "Area not found",
"errorCode": "AREA_NOT_FOUND"
}
}
When it occurs:
- The area UUID is invalid
- The area has been deleted
How to resolve:
- Verify the area UUID is correct
- Check if you have the necessary permissions
- Ensure the area exists
3. Constraint Error (Code: 3005)
a. Area UUID Error
{
"message": "error",
"message_type": {
"code": 3005,
"message": "area_uuid must be a string",
"errorCode": "CONSTRAINT_ERROR"
}
}
b. Version Error
{
"message": "error",
"message_type": {
"code": 3005,
"message": "version must be one of the following values: v1.0",
"errorCode": "CONSTRAINT_ERROR"
}
}
c. Action Error
{
"message": "error",
"message_type": {
"code": 3005,
"message": "action must be one of the following values: get, get-zones, get-nodes, get-scenes, get-groups",
"errorCode": "CONSTRAINT_ERROR"
}
}
Constraint errors occur in the following cases:
-
Area UUID Constraints:
- Area UUID must be a string
- Area UUID field should not be empty
- Area UUID field has incorrect type
-
Action Constraints:
- Action must be one of: get, get-zones, get-nodes, get-scenes, get-groups
- Action field is missing
- Action field has incorrect value
-
Version Constraints:
- Version must be exactly "v1.0"
- Version field is missing
- Version field has incorrect format
Resolution:
- Always use "v1.0" as the version value
- Use "get-zones" as the type value
- Ensure area UUID is correct
- Validate all parameters before sending
Error Code Summary
| Code | Error Code | Description | Solution |
|---|---|---|---|
| 2002 | PROJECT_NOT_FOUND | Project doesn't exists | Check project UUID valid or not |
| 2003 | AREA_NOT_FOUND | Area doesn't exists | Check area UUID valid or not |
| 3005 | CONSTRAINT_ERROR | Parameter validation failed | Check input values |