Lấy danh sách thư mục của trường

Mục lục

Through this API, you can query the list of folders in the two levels of the school’s cloud inventory, and the returned data contains: folder ids, parent ids, folder names, and so on. #

URL #

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

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ộc Fixed 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

 

Response data #

KeyĐịnh dạngPhản hồiÝ nghĩa
dataobject Danh sách hai cấp thư mục dưới thư mục gốc (root folder) của Drive trường. key là ID của thư mục cấp đầu tiên, value là danh sách các thư mục con cấp thứ 2 bên dưới nó
└ Folder 1array Danh sách các thư mục con trong thư mục cấp một
  └ Folder 1-1object Dữ liệu thư mục
   └ idstring713960 
   └ pidstring713940ID thư mục gốc
   └ namestringCourse 1tên
└ Folder 1-2object Dữ liệu thư mục
   └ idstring713961 
   └ pidstring713959ID thư mục gốc
   └ namestringCourse 1tên
└ …  
└ ···  
error_infoobject Return information object
└ errnonumber1Mã lỗi
└ errorstring“The program is running normally”Chi tiết lỗi

 

Sample #

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

SID=2339736&safeKey=9974697bf6f886a17cc37fb9fd135d0c&timeStamp=1493798252
  • 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" \
      "https://api.eeo.cn/partner/api/cloud.api.php?action=getFolderList"

Response sample(The normal return json packet example) #

{
  "data": {
    "713940": [
      {
        "id": "713960",
        "pid": "713940",
        "name": "全部文件"
      }
    ],
    "713959": [
      {
        "id": "713961",
        "pid": "713959",
        "name": "我的教材"
      }
    ]
  },
  "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)
106Không có dữ liệu