Skip to content

Query Folder Tree API ​

API Information ​

  • Request Path: /datafile/folder/tree
  • Request Method: GET
  • Content-Type: application/json

Request Headers ​

ParameterTypeRequiredDescription
AuthorizationStringYesUser authentication token

Request Parameters ​

No request parameters required.

Response Body Structure ​

CommonResponse Object ​

FieldTypeDescription
codeIntegerResponse status code
messageStringResponse message
dataList<FolderTreeNode>Folder tree structure

FolderTreeNode Object (Nested in CommonResponse) ​

FieldTypeDescription
idLongFolder ID
nameStringFolder name
pathStringFolder path
parentIdLongParent folder ID
ctimeLongCreation timestamp
childrenList<FolderTreeNode>List of child folders

Response Examples ​

Success Response ​

json
{
  "code": 200,
  "message": "success",
  "data": [
    {
      "id": 1,
      "name": "root",
      "path": "/",
      "parentId": null,
      "ctime": 1704105600000,
      "children": [
        {
          "id": 2,
          "name": "satellite_data",
          "path": "/satellite_data",
          "parentId": 1,
          "ctime": 1704105600000,
          "children": [
            {
              "id": 3,
              "name": "landsat",
              "path": "/satellite_data/landsat",
              "parentId": 2,
              "ctime": 1704105600000,
              "children": []
            },
            {
              "id": 4,
              "name": "sentinel",
              "path": "/satellite_data/sentinel",
              "parentId": 2,
              "ctime": 1704105600000,
              "children": []
            }
          ]
        },
        {
          "id": 5,
          "name": "vector_data",
          "path": "/vector_data",
          "parentId": 1,
          "ctime": 1704105600000,
          "children": []
        }
      ]
    }
  ]
}

Failure Response ​

json
{
  "code": 401,
  "message": "Unauthorized",
  "data": null
}

Error Code Description ​

Error CodeDescription
200Success
401Unauthorized
500Server internal error

Usage Instructions ​

  1. This API is used to query the complete folder tree structure
  2. User authentication is required
  3. Returns hierarchical folder structure for the authenticated user
  4. No request parameters needed

Notes ​

  • Returns the complete folder hierarchy for the user
  • Useful for folder navigation and file management
  • User authentication token must be included in request headers