Last Updated on : 2025-05-30 01:56:03download
Construction template management, used to create template construction tasks, template can be configured to install equipment category and location.
| Request method | API | description |
|---|---|---|
| GET | /v1.0/osaas/projects/{project_id}/construction/templates | API for Querying the Construction Template List. |
| GET | /v1.0/osaas/projects/{project_id}/construction/templates/{template_id} | API for Obtaining Construction Template Details. |
| POST | /v1.0/osaas/projects/{project_id}/construction/template | API for Adding a Construction Template. |
| PUT | /v1.0/osaas/projects/{project_id}/construction/templates/{template_id} | API for Modifying Project Construction template. |
| POST | /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/replication | API for copy Project Construction Template. |
| DELETE | /v1.0/osaas/projects/{project_id}/construction/templates/{template_id} | API for Deleting a Construction Template. |
| POST | /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/area | API for Adding a Construction Template Area. |
| PUT | /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id} | API for Modifying Construction Template Area Information. |
| DELETE | /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id} | API for Deleting a Construction Template Area. |
| POST | /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}/position | API for Adding a Construction Template Device Installation Position. |
| PUT | /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}/positions/{position_id} | API for Modifying Construction Template Device Installation Position. |
| DELETE | /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}/positions/{position_id} | API for Deleting a Construction Template Device Installation Position. |
API for Querying the Construction Template List.
GET /v1.0/osaas/projects/{project_id}/construction/templates
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| project_id | String | URI | Unique ID of a project | Yes |
| page_no | Integer | URL | Page number. | No |
| page_size | Integer | URL | Number of records on a page, which is greater than 0 and less than 100. | No |
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code.Null indicates success. |
| success | Boolean | Request result. true: success false: failure |
| msg | String | Exception message.It is null when the request result is success. |
| t | Long | Response time, which is a 13-digit timestamp. |
| result | Object | Result object. |
| Parameter | Type | Description |
|---|---|---|
| total | Integer | Number of records on a page. |
| page_no | Integer | Total number of records. |
| page_size | Integer | Page number. |
| templates | Arrays | construction template set. |
Parameters in templates
| Parameter | Type | Description |
|---|---|---|
| template_id | String | Unique ID of a template. |
| template_name | String | Template name. |
| description | String | description |
| has_binding | Boolean | Whether to bind. true:bound false:unbound |
GET {url}/v1.0/osaas/projects/1239896663221xx/construction/templates
{
"success": true,
"t": 1539776581583,
"result": {
"page_no": 1,
"page_size": 20,
"total": 1,
"templates": [
{
"template_id": "1429018",
"template_name": "Test Template",
"description": "Test",
"has_binding": true
}
]
}
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
API for Obtaining Construction Template Details.
GET /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| project_id | String | URI | Unique ID of a project. | Yes |
| template_id | String | URI | Unique ID of a template. | Yes |
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code.Null indicates success. |
| success | Boolean | Request result. true: success false: failure |
| msg | String | Exception message.It is null when the request result is success. |
| t | Long | Response time, which is a 13-digit timestamp. |
| result | Object | Construction template details. |
| Parameter | Type | Description |
|---|---|---|
| template_id | String | Unique ID of a template. |
| template_name | String | Template name. |
| description | String | description. |
| has_binding | Boolean | Whether to bind. true:bound false:unbound |
| areas | Array | List of areas. |
Parameters in areas
| Parameter | Type | Description |
|---|---|---|
| template_id | String | Unique ID of a area. |
| area_name | String | Area name. |
| positions | Arrays | List of positions. |
Parameters in positions
| Parameter | Type | Description |
|---|---|---|
| position_id | String | Unique ID of a position. |
| position_name | String | Position name. |
| custom_device_name | String | Custom device name. |
| construction_category | Array | List of split devices. |
| infrared_devices | Arrays | List of infrared devices. |
Parameters in split_devices
| Parameter | Type | Description |
|---|---|---|
| category_code | String | Split device category code. |
| custom_device_name | String | Custom device name. |
Parameters in infrared_devices
| Parameter | Type | Description |
|---|---|---|
| category_id | String | Unique ID of a infrared device category. |
| custom_device_name | String | Custom device name. |
| brand_id | String | Unique ID of a infrared brand. |
| operator_id | String | Unique ID of a operator. |
| remote | String | Remote control index. |
GET {url}/v1.0/osaas/projects/1239896663221xx/construction/templates/1239xx
{
"result": {
"areas": [
{
"area_id": "6UN******",
"area_name": "Living room",
"positions": [
{
"construction_category": "wf_wnykq",
"custom_device_name": "Universal remote control",
"infrared_devices": [
{
"area_id": "120116",
"brand_id": "2",
"category_id": "1",
"operator_id": "3170",
"remote": "4469"
}
],
"position_id": "************",
"position_name": "position 1"
},
{
"construction_category": "zig_kg_1",
"custom_device_name": "Switch",
"position_id": "************",
"position_name": "position 2",
"split_devices": [
{
"category_code": "dj",
"custom_device_name": "Lamp"
}
]
}
]
}
],
"description": "Test",
"has_binding": false,
"template_id": "************",
"template_name": "Test Template"
}
"success": true,
"t": 1600670418686
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
API for Adding a Construction Template
POST /v1.0/osaas/projects/{project_id}/construction/template
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| project_id | String | URI | Unique ID of a project | Yes |
| template_name | String | BODY | Template name. | Yes |
| description | String | BODY | description. | No |
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code.Null indicates success. |
| success | Boolean | Request result. true: success false: failure |
| msg | String | Exception message.It is null when the request result is success. |
| t | Long | Response time, which is a 13-digit timestamp. |
| result | String | Construction Unique ID of a template. |
POST {url}/v1.0/osaas/projects/12398966******/construction/template
{
"template_name": "Template name.",
"description": "description.",
}
{
"success": true,
"result":"142******",
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
API for Modifying Project Construction template
PUT /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| project_id | String | URI | Unique ID of a project | Yes |
| template_id | String | URI | Unique ID of a template. | Yes |
| template_name | String | BODY | Template name. | No |
| description | String | BODY | description. | No |
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code.Null indicates success. |
| success | Boolean | Request result. true: success false: failure |
| msg | String | Exception message.It is null when the request result is success. |
| t | Long | Response time, which is a 13-digit timestamp. |
| result | Boolean | Operation result. |
PUT {url}/v1.0/osaas/projects/123989666******/construction/templates/151xx
{
"template_name": "Template name.",
"description": "description."
}
{
"success": true,
"result": true,
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
API for copy Project Construction Template
POST /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/replication
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| project_id | string | URI | Unique ID of a project | Yes |
| template_id | string | URI | Unique ID of a template. | Yes |
| template_name | string | BODY | Template name. | Yes |
| description | string | BODY | description. | No |
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code.Null indicates success. |
| success | Boolean | Request result. true: success false: failure |
| msg | String | Exception message.It is null when the request result is success. |
| t | Long | Response time, which is a 13-digit timestamp. |
| result | Boolean | Operation result. |
POST {url}/v1.0/osaas/projects/12398966******/construction/templates/157******/replication
{
"description": "Test",
"template_name": "Test Template 2"
}
{
"success": true,
"result": true,
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
API for Deleting a Construction Template
DELETE /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| project_id | String | URI | Unique ID of a project | Yes |
| template_id | String | URI | Unique ID of a template. | Yes |
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code.Null indicates success. |
| success | Boolean | Request result. true: success false: failure |
| msg | String | Exception message.It is null when the request result is success. |
| t | Long | Response time, which is a 13-digit timestamp. |
| result | Boolean | Operation result. |
DELETE {url}/v1.0/osaas/projects/1239896******/construction/templates/157***
{
"success": true,
"result": true,
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to add a construction template area.
POST /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/area
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| project_id | String | URI | Unique ID of a project | Yes |
| template_id | String | URI | Unique ID of a template. | Yes |
| area_name | String | BODY | Area name. | Yes |
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code.Null indicates success. |
| success | Boolean | Request result. true: success false: failure |
| msg | String | Exception message.It is null when the request result is success. |
| t | Long | Response time, which is a 13-digit timestamp. |
| result | Object | Unique ID of a template. |
POST /v1.0/osaas/projects/12398966******/construction/templates/142***/area
{
"areaName": "Area name.",
"templateId": "Unique ID of a template.",
"projectId": "Unique ID of a project"
}
{
"success": true,
"result": "ifNS***",
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
API for Modifying Construction Template Area Information.
PUT /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| project_id | String | URI | Unique ID of a project. | Yes |
| template_id | String | URI | Unique ID of a template. | Yes |
| area_id | String | URI | Unique ID of a area. | Yes |
| area_name | String | BODY | Area name. | Yes |
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code.Null indicates success. |
| success | Boolean | Request result. true: success false: failure |
| msg | String | Exception message.It is null when the request result is success. |
| t | Long | Response time, which is a 13-digit timestamp. |
| result | Boolean | Operation result. |
PUT {url}/v1.0/osaas/projects/123989666***/construction/templates/142***/areas/ifNS***
{
"area_name": "Area name."
}
{
"success": true,
"result": true,
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
API for Deleting a Construction Template Area
DELETE /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| project_id | String | URI | Unique ID of a project. | Yes |
| template_id | String | URI | Unique ID of a template. | Yes |
| area_id | String | URI | Unique ID of a area. | Yes |
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code.Null indicates success. |
| success | Boolean | Request result. true: success false: failure |
| msg | String | Exception message.It is null when the request result is success. |
| t | Long | Response time, which is a 13-digit timestamp. |
| result | Boolean | Operation result. |
DELETE {url}/v1.0/osaas/projects/1239896******/construction/templates/142***/areas/ifNS***
{
"success": true,
"result": true,
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
API for Adding a Construction Template Device Installation Position
POST /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}/position
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| project_id | String | URI | Unique ID of a project. | Yes |
| template_id | String | URI | Unique ID of a template. | Yes |
| area_id | String | URI | Unique ID of a area. | Yes |
| position_name | String | BODY | Position name. | Yes |
| construction_category | String | BODY | Construction category. | Yes |
| custom_device_name | String | BODY | Custom device name. | Yes |
| split_devices | Arrays | BODY | List of split devices. | No |
| infrared_devices | Arrays | BODY | List of infrared devices. | No |
Parameters in split_devices
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| category_code | String | BODY | Split device category code(refer to construction category chapter). | Yes |
| custom_device_name | String | BODY | Custom device name. | Yes |
Parameters in infrared_devices
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| category_id | String | BODY | Unique ID of a infrared device category(Refer to the Construction Category chapter). | Yes |
| custom_device_name | String | BODY | Custom device name. | Yes |
| brand_id | String | BODY | Unique ID of a infrared device brand(Refer to the Universal Infrared chapter). | Yes |
| remote | String | BODY | Custom device name. | Yes |
| area_id | String | BODY | Unique ID of a area. | No |
| operator_id | String | BODY | Unique ID of a operator. | No |
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code.Null indicates success. |
| success | Boolean | Request result. true: success false: failure |
| msg | String | Exception message.It is null when the request result is success. |
| t | Long | Response time, which is a 13-digit timestamp. |
| result | String | Unique ID of a position. |
POST {url}/v1.0/osaas/projects/1239896******/construction/templates/157***/areas/7Xh4g***/position
{
"construction_category": "zig_kg_1",
"custom_device_name": "Switch",
"position_name": "position 2",
"split_devices": [
{
"custom_device_name": "Lamp",
"category_code": "dj"
}
]
}
{
"success": true,
"result":"233******",
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
API for Modifying Construction Template Device Installation Position
PUT /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}/positions/{position_id}
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| project_id | String | URI | Unique ID of a project. | Yes |
| template_id | String | URI | Unique ID of a template. | Yes |
| area_id | String | URI | Unique ID of a area. | Yes |
| position_id | String | URI | Unique ID of a position. | Yes |
| position_name | String | BODY | Position name. | Yes |
| construction_category | String | BODY | Construction category. | Yes |
| custom_device_name | String | BODY | Custom device name | Yes |
| split_devices | Arrays | BODY | List of split devices. | No |
| construction_category | Arrays | BODY | List of infrared devices. | No |
Parameters in split_devices
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| category_code | String | BODY | Split device category code(refer to construction category chapter). | Yes |
| custom_device_name | String | BODY | Custom device name | Yes |
Parameters in infrared_devices
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| category_id | String | BODY | Unique ID of a infrared device category(Refer to the Construction Category chapter). | Yes |
| custom_device_name | String | BODY | Custom device name. | Yes |
| brand_id | String | BODY | Unique ID of a infrared device brand(Refer to the Universal Infrared chapter). | Yes |
| remote | String | BODY | Custom device name. | Yes |
| area_id | String | BODY | Unique ID of a area. | No |
| operator_id | String | BODY | Unique ID of a operator. | No |
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code.Null indicates success. |
| success | Boolean | Request result. true: success false: failure |
| msg | String | Exception message.It is null when the request result is success. |
| t | Long | Response time, which is a 13-digit timestamp. |
| result | Boolean | Operation result. |
PUT {url}/v1.0/osaas/projects/123989666******/construction/templates/157 ***/areas/7Xh4g***/positions/1316367637******
{
"construction_category": "zig_kg_1",
"custom_device_name": "Switch",
"position_name": "position 2",
"split_devices": [
{
"custom_device_name": "Lamp",
"category_code": "dj"
}
]
}
{
"success": true,
"result": true,
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
API for Deleting a Construction Template Device Installation Position
DELETE /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/areas/{area_id}/positions/{position_id}
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| project_id | String | URI | Unique ID of a project. | Yes |
| template_id | String | URI | Unique ID of a template. | Yes |
| area_id | String | URI | Unique ID of a area. | Yes |
| position_id | String | URI | Unique ID of a position. | Yes |
| Parameter | Type | Description |
|---|---|---|
| code | Integer | Response code.Null indicates success. |
| success | Boolean | Request result. true: success false: failure |
| msg | String | Exception message.It is null when the request result is success. |
| t | Long | Response time, which is a 13-digit timestamp. |
| result | Boolean | Operation result. |
{
"success": true,
"result": true,
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
DELETE {url}/v1.0/osaas/projects/123989666******/construction/templates/157***/areas/7Xh4g***/positions/1316367637******
{
"success": true,
"result": true,
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
The following are common business exceptions for this interface. For more exception errors, see Global Error Codes.
| error code | explain |
|---|---|
| 500 | system error |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback