Thêm Giáo viên

Mục lục

The addTeacher interface is to bind a registered account to your institution in the teacher identity.

Notes:

  1. The API call requires SID, safeKey, timeStamp, teacher’s mobile phone number and teacher name. The teacher avatar in binary-data format is optional.
  2. For mainland China mobile phone numbers, please do not pass the country calling code. Otherwise, the response prompts that it is an illegal request.
  3. Data in the API response is a relationship ID between the institution and the teacher. Please ignore the relationship ID and store the UID returned after implementing the register interface.

In API integration, addTeacher is an interface that you must implement. To make an API call successfully, please note that:

  • The addTeacher interface is equivalent to the teacher management function in the ClassIn management console. Path: ClassIn management console-Home-Teaching-Teachers-Add Teacher. A registered user must be added to your institution first, then can be scheduled with lessons. If the user is not a teacher belonging to your institution, an error code will be returned when you call API to arrange lessons for the user.
  • New users that have not registered in the ClassIn system before can be directly added to your institution when you call the register interface. Please refer to the register interface for detailed information. For registered users, the register API implementation returns error code 135. Please then call the addTeacher interface to bind the account to your institution.

URL #

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

HTTP Request Methods #

  • POST

Coding Format #

  • UTF-8

Request Data #

keyRequiredMore RestrictionsInstructionsDescription
SIDYesNullSchool IDIt is available through the eeo.cn application
safeKeyYesFixed 32-bit all lowercase charactersSchool authentication security keysafeKey=MD5(SECRET+timeStamp)
timeStampYesNullimestamp used by safeKeyUnix Epoch timeStamp is the number of seconds passed by 00:00 (world standard time) on January 1, 1970
teacherAccountYesMobile phone number or email. Format: 00 country number – mobile phone number; note: mobile phone Numbers in mainland China do not include country .TeacherUid or teacherUid. If teacherAccount and teacherUid are passed at the same time, the teacherUid parameter shall prevailThe teacher’s cell phone numberFor example: fill us mobile phone number 1 (800) 643-7676 as 001-8006437676;The phone number of mainland China is 15800000001
teacherNameYesNullTeacher’s nameNull
FiledataNoBinary streamTeacher’s pictureNull

Response Data #

KeyTypeSample ValueMeaning
datanumber14163The ID of the relationship between the school and the teacher (It is needed in the edit teacher information interface)
error_infoobjectReturn message object
└ errnonumber1Error code
└ errorstring“Normal execution”Error details

Sample #

  • HTTP Request
POST /partner/api/course.api.php?action=addTeacher HTTP/1.1
Host: root_url
Content-Type: application/x-www-form-urlencoded
Cache-Control: no-cache

SID=2339736&safeKey=8d3fb00ceddd29638e2d5dd12d69841d&timeStamp=1492793638&teacherAccount=001-8006437676&teacherName=hubert&Filedata=@~/photo.jpg
  • 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 "teacherAccount=001-8006437676" \
       -d "teacherName=hubert" \
       -d "Filedata=@~/photo.jpg" \
       "https://api.eeo.cn/partner/api/course.api.php?action=addTeacher"

Response sample(The normal return json packet example) #

{
  "data": 14161,
  "error_info": {
    "errno": 1,
    "error": "程序正常执行"
  }
}

Error Code Description #

Error CodeDescription
1Successful execution.
100Incomplete or incorrect parameters.
102No permissions(Security verification failed).
103Failed to upload image to server.
104Operation failed (unknown error).
113The mobile phone number is not registered.
114Server exception.
122The teacher’s account is not legal.
131Registration failed.
133The account already exists in the institution.
288The mobile phone number segment is invalid.
400The requested data is not valid.
884The teacher’s account has been deleted by the user.
845Exceeded the maximum number of enabled teachers in the institution.