Interface invocation starter guide
Before you start testing the interface, download the Postman tool, which allows you to publish documents quickly and easily. Postman automatically extracts your sample requests, headers, snippets, and so on, populates your document pages with dynamic examples and machine-readable instructions, and can also generate snippets, using multiple frameworks and languages to generate snippets from your requests that can be used to make the same request from your own application. Clickhere to download
Currently, the ClassIn API has two versions: some interfaces use v1, while others use v2. Below are examples of Postman tests for both versions.
Testing the Interface(API v1)
Open ClassIn Interface documentation,Select the interface you want to test on the left, copy the interface to the Postman URL, fill in the request parameters, and click send to see the test results.
Notes:
- SID、SECRET You need to open the "ClassIn API" to get it. Please contact your account manager to open.
- safeKey:MD5(SECRET+timeStamp) Fixed 32-bit all lowercase characters. You can use Online tools quickly generate
- timeStamp: The Unix Epoch timestamp within 20 minutes of the current call interface.You can use Online tools quickly generate
Example:
Testing the Interface (API v2)
Open the ClassIn API Documentation, select the interface you want to test, copy the URL into Postman, and fill in the request headers and body parameters. Then, click "Send" to view the test results.
Notes:
- sid and SECRET: You need to have API access enabled for your ClassIn school account to abtain these. Please contact your account manager for assistance.
- X-EEO-SIGN: This is generated using MD5(parameter string&key=secret), resulting in a fixed 32-character lowercase string. For more details, refer to the Signature Generation Method and Code Example.
- timeStamp: This must be a Unix Epoch timestamp within 5 minutes of the current API call. You can quickly generate it using the online tool.
Example:
View test results
- As shown in the figure above, the test result returns "程序正常执行", which proves that the interface call was successful.
- If the test is abnormal, the error code will be returned. Please refer to the returned error code to modify the request parameters and retest.
Example:
102 error cause analysis:
- Check to see if the sid is correct.
- safeKey whether or not is secret + timeStamp md5 encrypted results(Notice it's lowercase).
- SECRET Better copy, do not fill in manually, pay attention to letter confusion.
- TimeStamp is the number of seconds within 20 minutes of the current time (not milliseconds, note that the time zone is Beijing time zone)
- The school account does not have access to API docking, so it needs to be confirmed in the background of eeo.cn
- The interface is offline
- The agency account has been suspended (contract expired, overdue fees, etc.), please contact the account manager
Generated code segment
Use multiple frameworks and languages to generate code snippets from your requests that can be used to make the same request from your own application.