Last Updated on : 2025-05-30 01:56:03download
| Request method | API | description |
|---|---|---|
| GET | /v1.0/osaas/rooms/{room_id}/scenes | API for Querying the Scene List. |
| POST | /v1.0/osaas/rooms/{room_id}/scenes/{scene_id}/trigger | API for Trigger a Scene. |
| GET | /v1.0/osaas/rooms/{room_id}/scene/devices | API for Querying the Support Scene Device List. |
| POST | /v1.0/osaas/rooms/{room_id}/scene | API for Adding a Scene. |
| PUT | /v1.0/osaas/rooms/{room_id}/scenes/{scene_id} | API for Modifying Scene. |
| DELETE | /v1.0/osaas/rooms/{room_id}/scenes/{scene_id} | API for Deleting a Scene. |
You can use this API to query the list of scenes.
GET /v1.0/osaas/rooms/{room_id}/scenes
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| room_id | String | URI | Unique ID of a room. | 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 | Array | List of scenes |
Parameters in result
| Parameter | Type | Description |
|---|---|---|
| scene_id | String | Scene ID |
| scene_name | String | Scene name |
| actions | Array | List of actions |
Parameters in actions
| Parameter | Type | Description |
|---|---|---|
| entity_id | String | Target ID, device ID |
| executor_property | Object | Action parameters |
| action_executor | String | Action type,Currently only supports: dpIssue |
GET {url}/v1.0/osaas/rooms/122233331111111/scenes
{
"success": true,
"t": 1541071460239,
"result": [
{
"scene_id": "53IYSXI3gE******",
"scene_name": "Test Scene",
"actions": [
{
"entity_id": "0120090568******",
"executor_property": {
"switch_led": true
},
"action_executor": "dpIssue"
}
]
}
]
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to trigger a scene.
POST /v1.0/osaas/rooms/{room_id}/scenes/{scene_id}/trigger
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| room_id | String | URI | Unique ID of a room. | Yes |
| scene_id | String | URI | Unique ID of a scene. | 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/rooms/12223333111/scenes/53IY3gEn******/trigger
{
"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 query the list of devices that support scenarios.
GET /v1.0/osaas/rooms/{room_id}/scene/devices
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| room_id | String | URI | Unique ID of a room. | 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. |
| devices | Arrays | List of devices. |
Parameters in devices
| Parameter | Type | Description |
|---|---|---|
| device_id | String | Device ID. |
| device_name | String | Device name. |
| product_id | String | Product ID. |
GET {url}/v1.0/osaas/rooms/12223******/scene/devices?page_no=1&page_size=20
{
"result": {
"total": 1,
"page_no": 1,
"page_size": 20,
"devices": [
{
"device_id": "vedo******",
"device_name": "Test Device",
"product_id": "r45675******"
}
]
},
"success": true,
"t": 1572936751228
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to add a scene.
POST /v1.0/osaas/rooms/{room_id}/scene
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| room_id | String | URI | Unique ID of a room. | Yes |
| scene_name | String | BODY | Scene name. | Yes |
| actions | Arrays | BODY | List of actions. | Yes |
Parameters in actions
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| entity_id | string | BODY | Unique ID of a device. | Yes |
| executor_property | Object | BODY | Action parameters. | Yes |
| action_executor | String | BODY | Action type , Currently only supports: dpIssue. | 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 scene |
POST {url}/v1.0/osaas/rooms/122233******/scene
{
"scene_name": "Test scene",
"actions": [
{
"executor_property": {
"work_mode": "auto"
},
"action_executor": "dpIssue",
"entity_id": "0120090568c6******"
}
]
}
{
"success": true,
"result": "1112382******",
"t": 1566053034624
}
{
"code": 500,
"msg": "system error,please contact the admin",
"success": false,
"t": 1561378856383
}
You can use this API to modify information about a space based on the unique IDs of the project and the space.
PUT /v1.0/osaas/rooms/{room_id}/scenes/{scene_id}
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| room_id | String | URI | Unique ID of a room. | Yes |
| scene_id | String | URI | Unique ID of a scene. | Yes |
| scene_name | String | BODY | Scene name. | No |
| actions | Arrays | BODY | List of actions. | No |
Parameters in actions
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| entity_id | String | BODY | Unique ID of a device. | Yes |
| executor_property | Object | BODY | Action parameters. | Yes |
| action_executor | String | BODY | Action type,Currently only supports: dpIssue. | 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. |
PUT {url}/v1.0/osaas/rooms/12223******/scenes/53IY3gE******
{
"scene_name": "Test Scene",
"actions": [
{
"executor_property": {
"work_mode": "auto"
},
"action_executor": "dpIssue",
"entity_id": "0120090568c63******"
}
]
}
{
"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 scene.
DELETE /v1.0/osaas/rooms/{room_id}/scenes/{scene_id}
| Parameter | Type | Position | Description | Mandatory |
|---|---|---|---|---|
| room_id | String | URI | Unique ID of a room. | Yes |
| scene_id | String | URI | Unique ID of a scene. | 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/rooms/12223******/scenes/53IY3gE******
{
"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