Skip to main content

Create Area

Create area of a project.

Description

This action allows you to create a new area within a project with just give name of area.

Request Topic

LYT/f7bdc7e7-1847-4c54-b1d4-64d3d0a833f7/AREA/ACTION

Request Payload

{
"version":"v1.0",
"action": "create",
"data": {
"area_name": "My Sweet Home"
}
}

Request Field Descriptions

FieldTypeRequiredDescription
versionstringYesAPI version identifier (must be "v1.0")
actionstringYesAction to perform (must be "create")
area_namestringYesArea Name should be like this : data > area_name

Response Topic

LYT/f7bdc7e7-1847-4c54-b1d4-64d3d0a833f7/AREA/E/ACTION

Response Payload

Success Response

{
"message":"success",
"version":"v1.0",
"action":"create",
"data":{
"area_uuid":"6d769819-4c0d-42d0-9c92-c8ef05e86121",
"area_name":"My Sweet Home",
"project_uuid":"f7bdc7e7-1847-4c54-b1d4-64d3d0a833f7"
}
}

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

How to resolve:

  1. Verify the project UUID is correct
  2. Check if you have the necessary permissions
  3. Ensure the project exists

2. Constraint Error (Code: 3005)

a. Area UUID Error

{
"message": "error",
"message_type": {
"code": 3005,
"message": "area_name 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, create, delete, update",
"errorCode": "CONSTRAINT_ERROR"
}
}

Constraint errors occur in the following cases:

  1. Area Name Constraints:

    • Area Name must be a string
    • Area Name field should not be empty
    • Area Name field has incorrect type
  2. Action Constraints:

    • Action must be one of: get, get-zones, get-nodes, get-scenes, get-groups, create, delete, update
    • Action field is missing
    • Action field has incorrect value
  3. 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 "create" as the type value
  • Validate all parameters before sending

3. Cloud Not Activated Error (Code: 3010)

{
"message":"error",
"message_type":
{
"code":3010,
"message":"Cloud not activated",
"errorCode":"CLOUD_NOT_ACTIVATED"
}
}

When it occurs:

  • The Cloud connection is deactivated
  • The Cloud connection is disconnected

How to resolve:

  1. Verify the cloud is connected / activated.
  2. Enable cloud connection.
  3. Connect to the cloud.

Error Code Summary

CodeError CodeDescriptionSolution
2002PROJECT_NOT_FOUNDProject doesn't existsCheck project UUID valid or not
3005CONSTRAINT_ERRORParameter validation failedCheck input values
3010CLOUD_NOT_ACTIVATEDCloud not activatedCheck cloud connection