Last Updated on : 2025-05-30 01:56:03download
Construction task management. After the construction task is created for the construction workers, the construction workers can carry out the construction network distribution equipment through the intelligent engineering APP or the self-developed app with the integrated construction SDK.
Request method | API | Description |
---|---|---|
POST | /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/task | API for Creating a Template Construction Task. |
GET | /v1.0/osaas/projects/{project_id}/construction/tasks | API for Querying the Construction Task List. |
GET | /v1.0/osaas/projects/{project_id}/construction/tasks/{task_id} | API for Querying Construction Task Details. |
POST | /v1.0/osaas/projects/{project_id}/construction/tasks/{task_id}/reopen | API for Reopening Construction Task. |
POST | /v1.0/osaas/projects/{project_id}/construction/tasks/{task_id}/acceptance | API for Accepting Construction Task. |
DELETE | /v1.0/osaas/projects/{project_id}/construction/tasks/{task_id} | API for Deleting a Construction Task. |
You can use this API to create a template construction task.
POST /v1.0/osaas/projects/{project_id}/construction/templates/{template_id}/task
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 |
room_ids | String[] | BODY | List of unique IDs of rooms. | Yes |
worker_id | String | BODY | Unique ID of a worker. | Yes |
template_constraint | Boolean | BODY | Template constraints(all template positions must be construction with device, the default is false). | 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 task. |
POST {url}/v1.0/osaas/projects/123382396505******/construction/templates/1160823******/task
{
"room_ids": [
"1160823965053******"
],
"worker_id": "15673345******",
"template_constraint": false
}
{
"success": true,
"result": "123******",
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to query the construction task list.
GET /v1.0/osaas/projects/{project_id}/construction/tasks
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
project_id | String | URI | Unique ID of a project. | Yes |
page_no | Integer | URL | Page number. The default value is 1. | No |
page_size | Integer | URL | Number of records on a page, which is greater than 0 and less than 100. If this parameter is not set, the number is 20 by default. | 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. |
Parameters in result
Parameter | Type | Description |
---|---|---|
total | Integer | Total number of records. |
page_no | Integer | Page number. |
page_size | Integer | Number of records on a page. |
tasks | Arrays | Task list. |
Parameters in tasks
Parameter | Type | Description |
---|---|---|
task_id | String | Unique ID of a task. |
template_id | String | Unique ID of a template. |
construction_ status | String | Construction status. PENDING_CONSTRUCTION: to be constructed IN_CONSTRUCTION: being constructed PENDING_ACCEPTANCE: to be accepted ACCEPTANCE_COMPLETE: accepted |
worker_username | String | Worker username. |
worker_nickname | String | Worker nickname. |
gmt_create | Long | Creation time, which is a 13-digit timestamp. |
GET {url}/v1.0/osaas/projects/1233823965053******/construction/tasks?page_no=1&page_size=20
{
"result": {
"total": 1,
"page_no": 1,
"page_size": 20,
"tasks": [
{
"task_id": "130641181272348******",
"template_id": "12554365357******",
"worker_username": "test@tuya.com",
"worker_nickname": "Tom",
"construction_status": "PENDING_CONSTRUCTION",
"gmt_create": 1600766546913
}
]
},
"success": true,
"t": 1572936751228
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to query construction task details.
GET /v1.0/osaas/projects/{project_id}/construction/tasks/{task_id}
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
project_id | String | URI | Unique ID of a project. | Yes |
task_id | String | URI | Unique ID of a task. | 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 | Task details. |
Parameters in result
Parameter | Type | Description |
---|---|---|
task_id | String | Unique ID of a task. |
template_id | String | Unique ID of a template. |
construction_ status | String | Construction status. PENDING_CONSTRUCTION: to be constructed IN_CONSTRUCTION: being constructed PENDING_ACCEPTANCE: to be accepted ACCEPTANCE_COMPLETE: accepted |
worker_username | String | Worker username. |
worker_nickname | String | Worker nickname. |
gmt_create | Long | Creation time, which is a 13-digit timestamp. |
room_ids | Arrays | List of unique IDs of rooms. |
GET {url}/v1.0/osaas/projects/12338239650******/construction/tasks/126770532******
{
"result": {
"task_id": "13064118127******",
"template_id": "12******",
"worker_username": "test@tuya.com",
"worker_nickname": "Tom",
"construction_status": "PENDING_CONSTRUCTION",
"room_ids": [
"1255436535******"
],
"gmt_create": 1600766546913
},
"success": true,
"t": 1572936751228
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to reopen a construction task.
POST /v1.0/osaas/projects/{project_id}/construction/tasks/{task_id}/reopen
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
project_id | String | URI | Unique ID of a project. | Yes |
task_id | String | URI | Unique ID of a task. | 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 | Result object. |
POST {url}/v1.0/osaas/projects/1233823965053******/construction/tasks/126770591******/reopen
{
"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 accept a construction task.
POST /v1.0/osaas/projects/{project_id}/construction/tasks/{task_id}/acceptance
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
project_id | String | URI | Unique ID of a project. | Yes |
task_id | String | URI | Unique ID of a task. | 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 | Result object. |
POST {url}/v1.0/osaas/projects/1233823965053******/construction/tasks/126770532******/acceptance
{
"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 delete a construction task.
DELETE /v1.0/osaas/projects/{project_id}/construction/tasks/{task_id}
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
project_id | String | URI | Unique ID of a project. | Yes |
task_id | String | URI | Unique ID of a task. | 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 | Result object. |
DELETE {url}/v1.0/osaas/projects/1233823965053******/construction/tasks/12677053******
{
"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