Lấy danh sách tệp tin trong một thư mục của trường

Mục lục

Gets a list of files and folders under the specified folder,You need SID, safekey, timeStamp, and you specify the folder ID (you don’t specify the folder ID, you choose the top-level folder).Returns the folders and files under the specified folder.

URL #

https://api.eeo.cn/partner/api/cloud.api.php?action=getCloudList

HTTP Request Methods #

  • POST

Coding format #

  • UTF-8
 

Request data #

KeyBắt buộcYêu cầu thêmMô tảHướng dẫn
SIDBắt buộcID của trườngXem dữ liệu này tại Trang quản lý classin.com trong mục API
safeKeyBắt buộcFixed 32-bit all lowercase charactersKhóa bảo mật xác thực trường họcsafeKey=MD5(SECRET+timeStamp)
timeStampBắt buộcTheo Unix Epoch timestamp & có hiệu lực trong vòng 20 phútThời gian UNIX Epoch là số giây đã trôi qua kể từ 00:00:00 (giờ chuẩn quốc tế) vào ngày 1 tháng 1 năm 1970
folderIdBắt buộcID của thư mục cần truy xuấtCó thể để trống, nếu trống sẽ trả về danh sách thư mục và tập tin trong thư mục cấp cao nhất

 

Response data #

KeyĐịnh dạngPhản hồiÝ nghĩa
folder_listarray Trả về danh sách thư mục
└ folder 1 Information objectobject Dữ liệu của từng thư mục sẽ gồm các trường bên dưới
  └ folder_idstring123456ID thư mục
  └ folder_namestringCloud drivertên thư mục
  └ is_system_foldernumber1Có phải là thư mục hệ thống không: 0-không, 1-có
└ folder 2 Information objectobject Dữ liệu của từng thư mục sẽ gồm các trường bên dưới
  └ folder_idstring123457ID thư mục
  └ folder_namestringMy teaching materialtên thư mục
  └ is_system_foldernumber1Có phải là thư mục hệ thống không: 0-không, 1-có
└ ······object… 
  └ folder_idstring···
  └ folder_namestring···
  └ is_system_foldernumber···
file_listarray Trả về danh sách tệp tin
└ File 1 information objectobject Dữ liệu của từng tệp tin sẽ gồm các trường bên dưới
  └ idstring1234568ID tệp tin
  └ file_namestringCloud drivertên tệp tin
  └ file_sizestring10KBdung lượng tệp tin
└ File 2 information objectobject Dữ liệu của từng tệp tin sẽ gồm các trường bên dưới
  └ idstring1234578ID tệp tin
  └ file_namestringMy teaching materialtên tệp tin
  └ file_sizestring10KBdung lượng tệp tin
└ ······object …
  └ idstring···
  └ file_namestring···
  └ file_sizestring···
error_infoobject Return message object
└ errnonumber1Mã lỗi
└ errorstring“Normal execution”Chi tiết lỗi

Sample #

  • HTTP request
POST /partner/api/cloud.api.php?action=getCloudList HTTP/1.1
Host: www.eeo.cn
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

SID=2339736&safeKey=209f418afc25710c51327f3e97966a89&timeStamp=1494231322&folderId=123456
  • Shell cURL analog request instruction
curl -H "Content-Type: application/x-www-form-urlencoded" -X "POST" \
      -d "SID=1234567" \
      -d "safeKey=0f7781b3033527a8cc2b1abbf45a5fd2" \
      -d "timeStamp=1484719085" \
      -d "folderId=123456" \
      "https://api.eeo.cn/partner/api/cloud.api.php?action=getCloudList"

Response sample(The normal return json packet example) #

{
  "folder_list": [
    {
      "folder_id": "714013",
      "folder_name": "机构网盘",
      "is_system_folder": 1
    },
    {
      "folder_id": "713961",
      "folder_name": "我的教材",
      "is_system_folder": 1
    },
    {
      "folder_id": "748651",
      "folder_name": "helloworld",
      "is_system_folder": 0
    }
  ],
  "file_list": [
    {
      "id": "496225",
      "file_name": "test.php",
      "file_size": "7KB"
    },
    {
      "id": "496229",
      "file_name": "test.png",
      "file_size": "27KB"
    }
  ],
  "error_info": {
    "errno": 1,
    "error": "程序正常执行"
  }
}

Error Code Description #

Error CodeDescription
1Thành công
100Parameters sai định dạng hoặc không hoàn chỉnh
102Không có quyền thao tác (Xác thực bảo mật thất bại)
193Thư mục không tồn tại
194Thư mục không thuộc trường (Không có quyền thao tác).