Query Space List

Last Updated on : 2024-09-10 01:49:15

Based on the space ID, query a list of child nodes in the specified space. If you specify only_sub as true, you can only query direct child nodes. Otherwise, you can query all child nodes. If you do not specify a space ID, you query the list of the first-level spaces.

API address

GET: /v2.0/cloud/space/child

Request parameter

Parameter nameTypeINRequiredDescription
space_idLongqueryfalseThe ID of the specified space. If this parameter is empty, it will query the spaces under the root directory of the cloud project.
only_subBooleanqueryfalseSpecifies whether to only query the direct child nodes.
last_row_keyLongqueryfalseThe starting ID of the query. Pass in the last_row_key of the returned result to get the data of the next page.
page_sizeIntegerqueryfalseThe number of items returned per page.

Return parameter

Parameter nameTypeDescription
successBooleanIndicates whether the operation is successful. Valid values:
  • true: The operation succeeded.
  • false: The operation failed.
error_codeStringFor more information, see the error codes.
error_msgStringThe message that is returned if the request fails. It is empty if the request is successful.
resultObjectThe returned result.

Description of result

Parameter nameTypeDescription
dataListThe list of sub-space IDs.
last_row_keyLongThe starting ID of the query.
page_sizeIntegerThe number of items returned per page.

Request example

GET: /v2.0/cloud/space/child?spaceId=1&onlySub=true&lastRowKey=0&pageSize=100

Return example

{
    "result": {
        "last_row_key": 15000003,
        "data": [
            15000002,
            15000003
        ],
        "page_size": 200
    },
    "success": true
}

Error code

For more information, see error code.

Limits on API Request Frequency

For more information, see Limits on API Request Frequency.