Tạo thư mục

Mục lục

Để tạo thư mục cần truyền các tham số SID, safekey, timeStamp, ID thư mục gốc (thư mục được tạo sẽ thuộc thư mục nào) và tên thư mục

Lưu ý: Tổng số thư mục con tối đa trong một thư mục được giới hạn ở 5.000 và tối đa là 15 cấp thư mục. Nếu vượt quá sẽ nhận báo lỗi, quá trình tạo mới thư mục không thành công. Hãy chú ý đến kích thước thư mục, cũng như xóa các thư mục, tập tin không cần thiết.

Create folders,You need to provide SID, safekey, timeStamp, parent folder ID (under which folder you create folders), folder name. Returns the folder ID after success,Error description returned after failure.

Note: The maximum number of directories in a folder is 5000 and the maximum depth is 15 levels. If the number exceeds this, an error will be reported and the creation will fail. Please pay attention to the folder size and delete unnecessary folders and files.

URL #

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

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 thư mụcThư mục được tạo sẽ thuộc thư mục nào
folderNameBắt buộcTên thư mục

Response data #

KeyĐịnh dạngPhản hồiÝ nghĩa
datastring123456ID thư mục vừa được tạo
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=createFolder HTTP/1.1
Host: www.eeo.cn
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

SID=2339736&safeKey=10a6f11c7e2194146c88650439aa0f2e&timeStamp=1493792469&folderId=747759&folderName=tools
  • 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" \
        -d "folderName=课程1" \
        "https://api.eeo.cn/partner/api/cloud.api.php?action=createFolder"

Response sample(The normal return json packet example) #

{
  "data": "123456",
  "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)
104Thao tác 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)
196Thư mục không hỗ trợ thao tác
206Đã có thư mục khác trùng tên tồn tại (ID thư mục sẽ được gửi kèm với báo lỗi)
207Phân cấp thư mục đã vượt quá giới hạn
208Số lượng thư mục đã vượt quá giới hạn