Last Updated on : 2025-05-30 01:56:03download
Maintenance task management. After creating maintenance tasks for the construction workers, the construction workers can debug and repair the damaged equipment through the Smart Engineering APP or the self-developed app with the integrated construction SDK, or they can also distribute new equipment for the house network.
Request method | API | description |
---|---|---|
POST | /v1.0/osaas/projects/{project_id}/maintenance/task | APIs Related to Maintenance Task Management. |
GET | /v1.0/osaas/projects/{project_id}/maintenance/tasks | API for Querying the Maintenance Task List. |
GET | /v1.0/osaas/projects/{project_id}/maintenance/tasks/{task_id} | API for Querying Maintenance Task Details. |
POST | /v1.0/osaas/projects/{project_id}/maintenance/tasks/{task_id}/reopen | API for Reopening Maintenance Task. |
POST | /v1.0/osaas/projects/{project_id}/maintenance/tasks/{task_id}/acceptance | API for Accepting Maintenance Task. |
DELETE | /v1.0/osaas/projects/{project_id}/maintenance/tasks/{task_id} | API for Deleting a Maintenance Task. |
You can use this API to create a maintenance task.
POST /v1.0/osaas/projects/{project_id}/maintenance/task
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
project_id | String | URI | Unique ID of a project. | Yes |
worker_id | String | BODY | Unique ID of a worker. | Yes |
room_device_relations | Arrays | BODY | List of room device relationships. | Yes |
Parameters in room_device_relations
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
room_id | String | BODY | Unique ID of a room | Yes |
device_ids | String[] | BODY | List of unique IDs of devices. | 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 | String | Unique ID of a task. |
POST {url}/v1.0/osaas/projects/123382396505******/maintenance/task
{
"worker_id": "1306411812723******",
"room_device_relations": [
{
"room_id": "14526789650531******",
"device_ids": [
"00122433******"
]
}
]
}
{
"success": true,
"result": "11123823965053******",
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to query the maintenance task list.
GET /v1.0/osaas/projects/{project_id}/maintenance/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. |
construction_ status | String | Maintenance status. PENDING_MAINTENANCE: to be maintained IN_MAINTENANCE: being maintained 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/12338239650******/maintenance/tasks?page _no=1&page_size=20
{
"result": {
"total": 1,
"page_no": 1,
"page_size": 20,
"tasks": [
{
"task_id": "1306411812723******",
"worker_username": "test@tuya.com",
"worker_nickname": "Tom",
"maintenance_status": "PENDING_ACCEPTANCE",
"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 maintenance task details.
GET /v1.0/osaas/projects/{project_id}/maintenance/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. |
maintenance_ status | String | Maintenance status. PENDING_MAINTENANCE: to be maintained IN_MAINTENANCE: being maintained 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_device_relations | Arrays | List of room device relationships. |
Parameters in room_device_relations
Parameter | Type | Description |
---|---|---|
room_id | String | Unique ID of a room. |
device_ids | Arrays | List of unique IDs of devices. |
GET {url}/v1.0/osaas/projects/123382396505******/maintenance/tasks/1267705******
{
"result": {
"task_id": "1306411812723******",
"worker_username": "test@tuya.com",
"worker_nickname": "Tom",
"construction_status": "PENDING_ACCEPTANCE",
"gmt_create": 1600766546913,
"room_device_relations": [
{
"room_id": "145267896505******",
"device_ids": [
"00122433******"
]
}
]
},
"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 maintenance task.
POST /v1.0/osaas/projects/{project_id}/maintenance/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 | Operation result. |
POST {url}/v1.0/osaas/projects/123382396505******/maintenance/tasks/12677053******/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 maintenance task.
POST /v1.0/osaas/projects/{project_id}/maintenance/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*******/maintenance/tasks/12677053******/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 maintenance task.
DELETE /v1.0/osaas/projects/{project_id}/maintenance/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 | Boolean | Operation result. |
DELETE {url}/v1.0/osaas/projects/1233823965053******/maintenance/tasks/126770532******
{
"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