Last Updated on : 2025-05-30 01:56:03download
Request method | API | description |
---|---|---|
POST | /v1.0/osaas/projects/{project_id}/space | API for Adding a Space |
PUT | /v1.0/osaas/projects/{project_id}/spaces/{space_id} | API for Modifying Space Information |
DELETE | /v1.0/osaas/projects/{project_id}/spaces/{space_id} | API for Deleting a Space |
GET | /v1.0/osaas/projects/{project_id}/spaces | API for Querying the Space List |
You can use this API to add a space based on the unique ID of a project and the space name. The space name at one level is unique
POST /v1.0/osaas/projects/{project_id}/space
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
project_id | String | URI | Unique ID of a project. | Yes |
parent_space_id | String | BODY | Unique ID of the parent space. If this parameter is not set, the space level is 1. | No |
space_name | String | BODY | Name of a space, which contains a maximum of 32 characters. | Yes |
space_type | String | BODY | Code of the space type. The values are as follows: PARK BUILDING UNIT FLOOR | Yes |
sort | Integer | BODY | Subscript for sorting a space. The default value is 1 | 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 space. |
POST {url}/v1.0/osaas/projects/1160823965053******/space
{
"parent_space_id": "1236699939214******",
"space_name": "5 floor",
"space_type": "FLOOR"
}
{
"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 modify information about a space based on the unique IDs of the project and the space.
PUT /v1.0/osaas/projects/{project_id}/spaces/{space_id}
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
project_id | String | URI | Unique ID of a project. | Yes |
space_id | String | URI | Unique ID of a space | Yes |
space_name | String | BODY | Name of a space, which contains a maximum of 32 characters. | No |
sort | Integer | BODY | Subscript for sorting a space | 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/116289*******/spaces/11608239650******
{
"space_name": "5 floor"
}
{
"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 space based on the unique IDs of the project and the space. Existing rooms and space subnodes cannot be deleted.
DELETE /v1.0/osaas/projects/{project_id}/spaces/{space_id}
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
project_id | String | URI | Unique ID of a project. | Yes |
space_id | String | URI | Unique ID of a space | 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/116289xxxxx/spaces/116082305312xxxxx
{
"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 space list based on the unique ID of a project.
GET /v1.0/osaas/projects/{project_id}/spaces
Parameter | Type | Position | Description | Mandatory |
---|---|---|---|---|
project_id | String | URI | Unique ID of a project. | Yes |
parent_space_id | String | URL | Unique ID of the parent space. If this parameter is not set, the space list of level 1 under the project is queried. | No |
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 100 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. |
spaces | Arrays | Space set. |
Parameters in spaces
Parameter | Type | Description |
---|---|---|
space_id | String | Unique ID of a space. |
space_name | String | Name of a space. |
space_type | String | Type of a space |
sort | Integer | Subscript for sorting a space. |
gmt_create | Long | Creation time, which is a 13-digit timestamp |
gmt_modified | Long | Modification time, which is a 13-digit timestamp |
GET {url}/v1.0/osaas/projects/11608239650531******/spaces
{
"result": {
"total": 1,
"page_no": 1,
"page_size": 100,
"spaces": [
{
"space_id": "1160823965053******",
"space_name": "5 floor",
"space_type": "FLOOR",
"sort": 1,
"gmt_create": 1559707046000,
"gmt_modified": 1559707046000
}
]
},
"success": true,
"t": 1561381210234
}
{
"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