URL tự động mở ứng dụng ClassIn và điều hướng vào lớp học

Mục lục

Để tạo liên kết để điều hướng người dùng trực tiếp vào lớp học cần truyền các tham số: SID, safekey, timeStamp, UID người dùng, CourseID, SectionID, deviceType. Khi đó hệ thống sẽ trả về liên kết (URL) có thể tự động mở ứng dụng ClassIn trên thiết bị người dùng và điều hướng người dùng vào lớp học.

Lưu ý:
Từ ngày 1 tháng 6 năm 2021: URL trả về sẽ không còn chứa khóa authTicket (ClassIn sẽ điều chỉnh dần theo từng đợt theo tài khoản người dùng và tất cả các điều chỉnh sẽ hoàn tất vào ngày 30 tháng 6), điều đó có nghĩa là việc sử dụng khóa tạm thời authTicket để mở app ClassIn truy cập trực tiếp vào lớp học mà không cần nhập mật khẩu sẽ không còn được hỗ trợ.

Điều chỉnh này không ảnh hưởng đến luồng gọi API hiện tại của nhà trường/ tổ chức, nhưng sẽ ảnh hưởng đến thao tác của người dùng. Khi người dùng mở ứng dụng ClassIn lần đầu tiên trên thiết bị thì ứng dụng sẽ dừng ở giao diện đăng nhập để chờ người dùng nhập mật khẩu và nhấn nút “Đăng nhập”.


Ghi chú:

  1. Đối với phần mềm ClassIn trên thiết bị di động, mật khẩu sẽ tự động được ghi nhớ; đối với phần mềm ClassIn trên máy tính, chúng tôi khuyến cáo người dùng nên chọn “Ghi nhớ mật khẩu” để không cần phải nhập lại mật khẩu cho những lần sau.
  2. Nếu người dùng quên mật khẩu, họ có thể nhấp vào “Quên mật khẩu” trên trang đăng nhập để lấy lại mật khẩu.

Get the login client link,Need SID, safekey, timeStamp, provide mobile phone number, the course ID, Class ID,ClassIn client login platform identity, return Can in Pc terminal or mobile terminal arouse ClassIn client links.

Notice:
From June 1, 2021, this interface will be adjusted as follows:

  • the returned URL will no longer contain the temporary key authTicket (ClassIn will gradually adjust in batches according to the user account, and all adjustments will be completed on 6.30), that is to say No longer supports the use of the temporary key authTicket password-free login to evoke the client.
  • This adjustment will not have any impact on your API docking program. It will only affect your user’s experience, the workflow changes after the application is awakened. After the user invokes the ClassIn client on the web page for the first time, the program will stay on the login interface and wait for the user to enter the password and click “Login” before entering the classroom.

Note:

 

  1. For the mobile terminal ClassIn software will automatically remember the password; for the PC ClassIn, it is strongly recommended that the user check the “remember password” after entering the password so that the next time it is called up, there is no need to enter the password again.
  2. If the user forgets the password, he can click “Forgot Password” on the login page to retrieve the password.

URL #

https://api.eeo.cn/partner/api/course.api.php?action=getLoginLinked

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útUnix Epoch timeStamp is the number of seconds passed by 00:00 (world standard time) on January 1, 1970
lifeTimeKhông bắt buộcMặc định là 86400 giâyThời gian hiệu lực của safeKey (tính theo giây)
courseIdBắt buộcID khóa họcThe return value after the course is created
classIdBắt buộcID lớp họcThe return value after the class is created
deviceTypeKhông bắt buộc1 behalf Windows/Mac OS ;2 behalf iOS mobile terminal;3 behalf Android
1= Windows/Mac OS; 2= iOS; 3= Android
uidBắt buộc —UID người dùng

Response data #

KeyĐịnh dạngPhản hồiÝ nghĩa
datastringclassin://www.eeo.cn/enterclass? telephone=001-8006437676& authTicket=04sxvif1bczi6lzs& classId=1424463&courseId=444451& schoolId=1009478URL tự động mở ứng dụng ClassIn và điều hướng người dùng
error_infoobject Return message object
└ errnonumber1Mã lỗi
└ errorstring“Normal execution”Chi tiết lỗi

Sample #

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

SID=2339736&safeKey=8d3fb00ceddd29638e2d5dd12d69841d&timeStamp=1492793638&telephone=001-8006437676&lifeTime=&courseId=332241&classId=1227045&deviceType=1
  • 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 "telephone=001-8006437676" \
        -d "lifeTime=" \
        -d "courseId=332241" \
        -d "classId=1227045" \
        "https://api.eeo.cn/partner/api/course.api.php?action=getLoginLinked"

PC terminal response sample(The normal return json packet example) #

{
  "data": "classin://www.eeo.cn/enterclass?telephone=001-8006437676&authTicket=04sxvif1bczi6lzs&classId=1424463&courseId=444451&schoolId=100947",
  "error_info": {
    "errno": 1,
    "error": "程序正常执行"
  }
}

Example URL #

Wake up 001-8006437676 ClassIn client account

URL này được sử dụng để xác định xem người dùng đã cài đặt ứng dụng ClassIn hay chưa. Nhà trường/ tổ chức cần nối tất cả các tham số trong liên kết được trả về sau khi gọi API này, như hiển thị ở dòng mã thứ hai bên dưới:

  <a href='https://api.eeo.cn/partner/invoke/classin.html?loginlink'>go into the classroom</a>
  <a href="https://api.eeo.cn/partner/invoke/classin.html?classin://www.eeo.cn/enterclass?telephone=001-8006437676&amp;authTicket=g7cx9tj3fs51n7dm&amp;classId=1213545&amp;courseId=394761&amp;schoolId=1009478">Wake up 001-8006437676 ClassIn client account</a>

Error code instruction #

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
114Lỗi server
134Định dạng số điện thoại không chính xác
142Khóa học không có thông tin của lớp học này
143Không có thông tin của khóa học này
144Không có khóa học này trong trường
145Lớp học đã kết thúc
150Người dùng này không phải là sinh viên, giáo viên hoặc người kiểm tra của tổ chức này hoặc không phải là thành viên của khóa học này
212Lớp học đã bị xóa
369Lớp học công khai không hỗ trợ điều chỉnh
467Thao tác chỉ hỗ trợ cho tài khoản đăng ký bằng số điện thoại. Vui lòng liên kết số điện thoại với tài khoản của bạn trước
888Tài khoản của người dùng đã bị xóa